From 0614e490c81ec7dd4e6933894a244849c19403ba Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 2 Oct 2013 20:25:42 -0400 Subject: [PATCH] VirtualDisk: Don't try to force cdrom target=hdc It was required a long long time ago, before qemu supported -drive and possibly ancient xen. Nowadays it should be pointless, and contributes to some issues like bz 905439 --- tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml | 6 +++--- tests/cli-test-xml/compare/w2k3-cdrom.xml | 6 +++--- tests/cli-test-xml/compare/xen-hvm.xml | 2 +- tests/xmlconfig-xml/boot-cpuset.xml | 2 +- .../xmlconfig-xml/boot-fullyvirt-disk-block.xml | 2 +- .../xmlconfig-xml/boot-fullyvirt-disk-file.xml | 2 +- tests/xmlconfig-xml/install-f11-ac97.xml | 2 +- tests/xmlconfig-xml/install-f11-noac97.xml | 2 +- .../install-f11-norheldefaults.xml | 2 +- tests/xmlconfig-xml/install-f11-qemu.xml | 2 +- .../xmlconfig-xml/install-f11-rheldefaults.xml | 2 +- tests/xmlconfig-xml/install-f11.xml | 2 +- .../install-fullyvirt-disk-block.xml | 2 +- .../install-fullyvirt-disk-file.xml | 2 +- .../xmlconfig-xml/install-fullyvirt-livecd.xml | 2 +- tests/xmlconfig-xml/misc-qemu-driver-name.xml | 2 +- .../misc-qemu-driver-overwrite.xml | 2 +- tests/xmlconfig-xml/misc-qemu-iso-disk.xml | 2 +- tests/xmlconfig-xml/misc-xml-escaping.xml | 2 +- virtinst/devicedisk.py | 17 ----------------- 20 files changed, 23 insertions(+), 40 deletions(-) diff --git a/tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml b/tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml index 74f41073..73492e34 100644 --- a/tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml +++ b/tests/cli-test-xml/compare/kvm-win2k3-cdrom.xml @@ -28,7 +28,7 @@ - + @@ -77,7 +77,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/tests/cli-test-xml/compare/w2k3-cdrom.xml b/tests/cli-test-xml/compare/w2k3-cdrom.xml index b5ae4202..dd2ea8e6 100644 --- a/tests/cli-test-xml/compare/w2k3-cdrom.xml +++ b/tests/cli-test-xml/compare/w2k3-cdrom.xml @@ -29,7 +29,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -111,7 +111,7 @@ - + diff --git a/tests/cli-test-xml/compare/xen-hvm.xml b/tests/cli-test-xml/compare/xen-hvm.xml index cc5b7f8f..510553f1 100644 --- a/tests/cli-test-xml/compare/xen-hvm.xml +++ b/tests/cli-test-xml/compare/xen-hvm.xml @@ -27,7 +27,7 @@ - + diff --git a/tests/xmlconfig-xml/boot-cpuset.xml b/tests/xmlconfig-xml/boot-cpuset.xml index c8f35b19..ec934ecf 100644 --- a/tests/xmlconfig-xml/boot-cpuset.xml +++ b/tests/xmlconfig-xml/boot-cpuset.xml @@ -27,7 +27,7 @@ /usr/lib/xen/bin/qemu-dm - + diff --git a/tests/xmlconfig-xml/boot-fullyvirt-disk-block.xml b/tests/xmlconfig-xml/boot-fullyvirt-disk-block.xml index 4bb151ee..a4a42071 100644 --- a/tests/xmlconfig-xml/boot-fullyvirt-disk-block.xml +++ b/tests/xmlconfig-xml/boot-fullyvirt-disk-block.xml @@ -24,7 +24,7 @@ - + diff --git a/tests/xmlconfig-xml/boot-fullyvirt-disk-file.xml b/tests/xmlconfig-xml/boot-fullyvirt-disk-file.xml index 48d857ff..b163f630 100644 --- a/tests/xmlconfig-xml/boot-fullyvirt-disk-file.xml +++ b/tests/xmlconfig-xml/boot-fullyvirt-disk-file.xml @@ -24,7 +24,7 @@ - + diff --git a/tests/xmlconfig-xml/install-f11-ac97.xml b/tests/xmlconfig-xml/install-f11-ac97.xml index 0b2d7fb5..221ffba0 100644 --- a/tests/xmlconfig-xml/install-f11-ac97.xml +++ b/tests/xmlconfig-xml/install-f11-ac97.xml @@ -34,7 +34,7 @@ - + diff --git a/tests/xmlconfig-xml/install-f11-noac97.xml b/tests/xmlconfig-xml/install-f11-noac97.xml index 2531b894..b46782a0 100644 --- a/tests/xmlconfig-xml/install-f11-noac97.xml +++ b/tests/xmlconfig-xml/install-f11-noac97.xml @@ -34,7 +34,7 @@ - + diff --git a/tests/xmlconfig-xml/install-f11-norheldefaults.xml b/tests/xmlconfig-xml/install-f11-norheldefaults.xml index 0b2d7fb5..221ffba0 100644 --- a/tests/xmlconfig-xml/install-f11-norheldefaults.xml +++ b/tests/xmlconfig-xml/install-f11-norheldefaults.xml @@ -34,7 +34,7 @@ - + diff --git a/tests/xmlconfig-xml/install-f11-qemu.xml b/tests/xmlconfig-xml/install-f11-qemu.xml index 79aa3fa0..f9cd3b2b 100644 --- a/tests/xmlconfig-xml/install-f11-qemu.xml +++ b/tests/xmlconfig-xml/install-f11-qemu.xml @@ -34,7 +34,7 @@ - + diff --git a/tests/xmlconfig-xml/install-f11-rheldefaults.xml b/tests/xmlconfig-xml/install-f11-rheldefaults.xml index 936a1ea9..4cbfa68a 100644 --- a/tests/xmlconfig-xml/install-f11-rheldefaults.xml +++ b/tests/xmlconfig-xml/install-f11-rheldefaults.xml @@ -34,7 +34,7 @@ - + diff --git a/tests/xmlconfig-xml/install-f11.xml b/tests/xmlconfig-xml/install-f11.xml index 8bb2f38c..d56ef78e 100644 --- a/tests/xmlconfig-xml/install-f11.xml +++ b/tests/xmlconfig-xml/install-f11.xml @@ -34,7 +34,7 @@ - + diff --git a/tests/xmlconfig-xml/install-fullyvirt-disk-block.xml b/tests/xmlconfig-xml/install-fullyvirt-disk-block.xml index 1ca49d69..7404723a 100644 --- a/tests/xmlconfig-xml/install-fullyvirt-disk-block.xml +++ b/tests/xmlconfig-xml/install-fullyvirt-disk-block.xml @@ -26,7 +26,7 @@ - + diff --git a/tests/xmlconfig-xml/install-fullyvirt-disk-file.xml b/tests/xmlconfig-xml/install-fullyvirt-disk-file.xml index a9943f47..5b0a9b18 100644 --- a/tests/xmlconfig-xml/install-fullyvirt-disk-file.xml +++ b/tests/xmlconfig-xml/install-fullyvirt-disk-file.xml @@ -26,7 +26,7 @@ - + diff --git a/tests/xmlconfig-xml/install-fullyvirt-livecd.xml b/tests/xmlconfig-xml/install-fullyvirt-livecd.xml index fefce991..77561473 100644 --- a/tests/xmlconfig-xml/install-fullyvirt-livecd.xml +++ b/tests/xmlconfig-xml/install-fullyvirt-livecd.xml @@ -21,7 +21,7 @@ /usr/lib/xen/bin/qemu-dm - + diff --git a/tests/xmlconfig-xml/misc-qemu-driver-name.xml b/tests/xmlconfig-xml/misc-qemu-driver-name.xml index 791834fb..7cbaca8c 100644 --- a/tests/xmlconfig-xml/misc-qemu-driver-name.xml +++ b/tests/xmlconfig-xml/misc-qemu-driver-name.xml @@ -28,7 +28,7 @@ - + diff --git a/tests/xmlconfig-xml/misc-qemu-driver-overwrite.xml b/tests/xmlconfig-xml/misc-qemu-driver-overwrite.xml index e148a10e..15a4efee 100644 --- a/tests/xmlconfig-xml/misc-qemu-driver-overwrite.xml +++ b/tests/xmlconfig-xml/misc-qemu-driver-overwrite.xml @@ -28,7 +28,7 @@ - + diff --git a/tests/xmlconfig-xml/misc-qemu-iso-disk.xml b/tests/xmlconfig-xml/misc-qemu-iso-disk.xml index d1d9eef6..a036d162 100644 --- a/tests/xmlconfig-xml/misc-qemu-iso-disk.xml +++ b/tests/xmlconfig-xml/misc-qemu-iso-disk.xml @@ -28,7 +28,7 @@ - + diff --git a/tests/xmlconfig-xml/misc-xml-escaping.xml b/tests/xmlconfig-xml/misc-xml-escaping.xml index da41b176..8b4e9878 100644 --- a/tests/xmlconfig-xml/misc-xml-escaping.xml +++ b/tests/xmlconfig-xml/misc-xml-escaping.xml @@ -29,7 +29,7 @@ - + diff --git a/virtinst/devicedisk.py b/virtinst/devicedisk.py index 2d962ee2..09dd6d25 100644 --- a/virtinst/devicedisk.py +++ b/virtinst/devicedisk.py @@ -799,20 +799,10 @@ class VirtualDisk(VirtualDevice): @returns generated target @rtype C{str} """ - - # Only use these targets if there are no other options - except_targets = ["hdc"] - prefix, maxnode = self.get_target_prefix() if prefix is None: raise ValueError(_("Cannot determine device bus/type.")) - # Special case: IDE cdrom should prefer hdc for back compat - if self.is_cdrom() and prefix == "hd": - if "hdc" not in skip_targets: - self.target = "hdc" - return self.target - if maxnode > (26 * 26 * 26): raise RuntimeError("maxnode value is too high") @@ -839,17 +829,10 @@ class VirtualDisk(VirtualDevice): seen_valid = True gen_t += "%c" % (ord('a') + digit - 1) - if gen_t in except_targets: - continue if gen_t not in skip_targets: self.target = gen_t return self.target - # Check except_targets for any options - for t in except_targets: - if t.startswith(prefix) and t not in skip_targets: - self.target = t - return self.target raise ValueError(_("No more space for disks of type '%s'" % prefix)) VirtualDisk.register_type()