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

Tatsuro Enokura 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.

Would you give me a comment on this patch?
If not, please apply it.

Thanks,
Tatsuro Enokura
diff -r 0a4efe737df9 virtinst/Guest.py
--- a/virtinst/Guest.py	Wed Mar 28 17:01:09 2007 -0400
+++ b/virtinst/Guest.py	Thu Mar 29 11:45:54 2007 +0900
@@ -561,9 +561,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