Re: [et-mgmt-tools] [PATCH] HVM 3rd disk name don't use "hdc"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Dan

Daniel P. Berrange wrote:
>> I try that making the HVM domain with 3+ disks by the virt-install command,
>> but the command says following error message:
>> # virt-install --name=HVM_3DISKS --file=/dev/sda6 --file=/dev/sda7 \
>>  --file=/dev/sda8 --hvm --vnc --ram=376 --cdrom=/dev/cdrom
> 
> This is a ticky one ! We need to a) refuse to allow > 3 --file arguments
> to be used with HVM guests, and b) make sure the 3rd file gets given
> hdd as its device name.

Thank you for your reviewing.
I rewite the patch.

Signed-off-by: Tatsuro Enokura <fj7716hz@xxxxxxxxxxxxxxxxx>

Thanks,
Tatsuro Enokura
diff -r 8ac3199c83d1 virtinst/Guest.py
--- a/virtinst/Guest.py	Fri Mar 23 10:10:03 2007 -0400
+++ b/virtinst/Guest.py	Fri Mar 23 18:36:56 2007 +0900
@@ -551,9 +551,15 @@ class Guest(object):
         for d in self.disks:
             if d.transient and not install:
                 continue
+            if count > 4 and self.disknode == "hd":
+                raise ValueError, "Can't use more than 4 disks on HVM guest"
             if d.device == VirtualDisk.DEVICE_CDROM and count != 2:
-                count = 2
-            disknode = "%(disknode)s%(dev)c" % { "disknode": self.disknode, "dev": ord('a') + count }
+                disknode = "%(disknode)s%(dev)c" % { "disknode": self.disknode, "dev": ord('a') + 2 }
+            else:
+               if count == 2 and d.device != VirtualDisk.DEVICE_CDROM and self.disknode == "hd":
+                   # skip "hdc" 
+                   count += 1
+               disknode = "%(disknode)s%(dev)c" % { "disknode": self.disknode, "dev": ord('a') + count }
             ret += d.get_xml_config(disknode)
             count += 1
         return ret

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux