From 9f4125089d244d6f60c2e4439fd3425ab9dba8e4 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 19 Jul 2010 17:50:38 +0000 Subject: [PATCH] -Have mkvm force adoption before trying to run due to new storage architecture allowed git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6796 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 4fe69a81c..8cba6d642 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -1318,10 +1318,16 @@ sub process_request { $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; - } + } elsif ($command eq "mkvm") { #must adopt to create + unless (adopt(\%orphans,\%hyphash)) { + $callback->({error=>"Can't find ".join(",",keys %orphans),errorcode=>[1]}); + return 1; + } + #mkvm used to be able to happen devoid of any hypervisor, make a fake hypervisor entry to allow this to occur + #commenting that out for now +# foreach (keys %orphans) { +# $hyphash{'!@!XCATDUMMYHYPERVISOR!@!'}->{nodes}->{$_}=1; +# } } else { $callback->({error=>"Can't find ".join(",",keys %orphans),errorcode=>[1]}); return;