From 7e53e7701771af8214185a4dea7482c6f07cc3dd Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 11 Feb 2010 22:13:54 +0000 Subject: [PATCH] -Fix migration in cases where we do not manage or know the IP identity of a guest VM git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5213 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index ce1847a25..998e3ffba 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -528,7 +528,10 @@ sub migrate { } my $sock = IO::Socket::INET->new(Proto=>'udp'); my $ipa=inet_aton($node); - my $pa=sockaddr_in(7,$ipa); #UDP echo service, not needed to be actually + my $pa; + if ($ipa) { + $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 $nomadomain; eval { @@ -550,8 +553,10 @@ sub migrate { unless ($newdom) { return (1,"Failed migration from $prevhyp to $targ"); } - 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 ($ipa) { + 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... + } #BTW, this should all be moot since the underlying kvm seems good about gratuitous traffic, but it shouldn't hurt anything refresh_vm($newdom); #The migration seems tohave suceeded, but to be sure...