From c9ae7831ad5dc9d72acc290e68fd2f7c7f431809 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 4 Sep 2009 16:17:12 +0000 Subject: [PATCH] -Allow mkvm to proceed without guests having to be allocated to hypervisors for KVM git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4104 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 914912bc3..15de999ca 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -905,6 +905,10 @@ sub process_request { } elsif ($command eq "rmigrate") { $callback->({error=>"Can't find ".join(",",keys %orphans),errorcode=>[1]}); return; + } elsif ($command eq "mkvm") { #mkvm can happen devoid of any hypervisor, make a fake hypervisor entry to allow this to occur + foreach (keys %orphans) { + $hyphash{'!@!XCATDUMMYHYPERVISOR!@!'}->{nodes}->{$_}=1; + } } else { $callback->({error=>"Can't find ".join(",",keys %orphans),errorcode=>[1]}); return; @@ -1116,7 +1120,11 @@ sub dohyp { eval { #Contain Sys::Virt bugs that make $@ useless - $hypconn= Sys::Virt->new(uri=>"qemu+ssh://root@".$hyp."/system?no_tty=1&netcat=nc"); + if ($hyp eq '!@!XCATDUMMYHYPERVISOR!@!') { #Fake connection for commands that have a fake hypervisor key + $hypconn = 1; + } else { + $hypconn= Sys::Virt->new(uri=>"qemu+ssh://root@".$hyp."/system?no_tty=1&netcat=nc"); + } }; unless ($hypconn) { eval { #Contain Sys::Virt bugs that make $@ useless