From 176aa0794832f20525817ffcbe44fab0505cbd15 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 30 Jul 2010 19:12:45 +0000 Subject: [PATCH] -Correct chvm behavior in wake of recent changes git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6928 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 4e84eb5af..a6bf890f0 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -862,7 +862,7 @@ sub chvm { if ($store =~ /^nfs:\/\//) { my %disks = %{get_multiple_paths_by_url(url=>$store,node=>$node)}; foreach (keys %disks) { - $useddisks{$disks{$_}}=1; + $useddisks{$disks{$_}->{device}}=1; } } } @@ -903,9 +903,16 @@ sub chvm { my $currstate=getpowstate($dom); if ($currstate eq 'on') { #attempt live attach foreach (@diskstoadd) { - my $suffix =$_; + my $suffix; + my $format; + if (/^[^\.]*\.([^\.]*)\.([^\.]*)/) { + $suffix=$1; + $format=$2; + } elsif (/^[^\.]*\.([^\.]*)/) { + $suffix=$1; + $format='raw'; + } my $bus; - $suffix =~ s/.*\.//; if ($suffix =~ /^sd/) { $bus='scsi'; } elsif ($suffix =~ /^hd/) { @@ -914,7 +921,7 @@ sub chvm { } elsif ($suffix =~ /vd/) { $bus='virtio'; } - my $xml = ""; + my $xml = ""; $dom->attach_device($xml); } }