From cbdedfac21f4623b16eac84001fefdaa292bb416 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 17 Feb 2009 21:07:20 +0000 Subject: [PATCH] -Fix syntax issues with subshell in xen and kvm migration -Fix test hang when preparing a migration -document nics as a TODO (have to decide a sane syntax for user, then implement) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2762 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 5 +++-- xCAT-server/lib/xcat/plugins/xen.pm | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index bc08e1394..7a26b2a55 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -194,7 +194,7 @@ sub build_nicstruct { my $rethash; $rethash->{type}='bridge'; $rethash->{mac}->{address}=$_; - $rethash->{source}->{bridge}='virbr0'; + $rethash->{source}->{bridge}='virbr0'; #TODO: syntax to tie vnics to bridgenames/vlans/whatever push @rethashes,$rethash; } return \@rethashes; @@ -392,6 +392,7 @@ sub migrate { return (1,"Unable to reach $prevhyp to perform operation of $node, use nodech to change vm.host if certain of no split-brain possibility exists"); } my $destnetcatadd="&netcat=nc"; + undef $testhypconn; eval {#Contain Sys::Virt bugs $testhypconn= Sys::Virt->new(uri=>$target.$destnetcatadd); }; @@ -408,7 +409,7 @@ sub migrate { my $ipa=inet_aton($node); my $pa=sockaddr_in(7,$ipa); #UDP echo service, not needed to be actually #serviced, we just want to trigger MAC move in the switch forwarding dbs - my $rc=system("virsh -c $currhyp".$srcnetcatadd." migrate --live $node $target.$destnetcatadd"); + my $rc=system("virsh -c '$currhyp".$srcnetcatadd."' migrate --live $node '$target"."$destnetcatadd'"); system("arp -d $node"); #Make ethernet fabric take note of change send($sock,"dummy",0,$pa); #UDP packet to force forwarding table update in switches, ideally a garp happened, but just in case... if ($rc) { diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index a4f4e43d7..ac2b47e46 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -194,7 +194,7 @@ sub build_nicstruct { my $rethash; $rethash->{type}='bridge'; $rethash->{mac}->{address}=$_; - $rethash->{source}->{bridge}='xenbr0'; + $rethash->{source}->{bridge}='xenbr0'; #TODO: support syntax in nics field in table, must be able to tie macs/hostname/network id together push @rethashes,$rethash; } return \@rethashes; @@ -392,6 +392,7 @@ sub migrate { return (1,"Unable to reach $prevhyp to perform operation of $node, use nodech to change vm.host if certain of no split-brain possibility exists"); } my $destnetcatadd="&netcat=nc"; + undef $testhypconn; eval {#Contain Sys::Virt bugs $testhypconn= Sys::Virt->new(uri=>$target.$destnetcatadd); }; @@ -408,7 +409,7 @@ sub migrate { my $ipa=inet_aton($node); my $pa=sockaddr_in(7,$ipa); #UDP echo service, not needed to be actually #serviced, we just want to trigger MAC move in the switch forwarding dbs - my $rc=system("virsh -c $currhyp".$srcnetcatadd." migrate --live $node $target.$destnetcatadd"); + my $rc=system("virsh -c '$currhyp".$srcnetcatadd."' migrate --live $node '$target"."$destnetcatadd'"); system("arp -d $node"); #Make ethernet fabric take note of change send($sock,"dummy",0,$pa); #UDP packet to force forwarding table update in switches, ideally a garp happened, but just in case... if ($rc) {