# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1252880415 14400
# Node ID 252ff7bc5ff9e95f49dd7deb6ef6af07287a5055
# Parent 726dc69533961f5cf7865e35be2b851f5f686c52
Don't use virtio for cdrom/floppy devices (bz 517151)
Also add a test case to prevent against this issue in the future.
diff -r 726dc6953396 -r 252ff7bc5ff9 tests/xmlconfig-xml/install-f11.xml
--- a/tests/xmlconfig-xml/install-f11.xml Sun Sep 13 13:05:53 2009 -0400
+++ b/tests/xmlconfig-xml/install-f11.xml Sun Sep 13 18:20:15 2009 -0400
@@ -17,6 +17,10 @@
<vcpu>5</vcpu>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+ <disk type='file' device='floppy'>
+ <source file='/default-pool/testvol1.img'/>
+ <target dev='fda' bus='fdc'/>
+ </disk>
<disk type='file' device='disk'>
<source file='/tmp/test.img'/>
<target dev='vda' bus='virtio'/>
@@ -25,6 +29,11 @@
<source dev='/dev/loop0'/>
<target dev='vdb' bus='virtio'/>
</disk>
+ <disk type='file' device='cdrom'>
+ <source file='/default-pool/default-vol'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ </disk>
<interface type='network'>
<source network='default'/>
<mac address='11:22:33:44:55:66'/>
diff -r 726dc6953396 -r 252ff7bc5ff9 tests/xmlconfig.py
--- a/tests/xmlconfig.py Sun Sep 13 13:05:53 2009 -0400
+++ b/tests/xmlconfig.py Sun Sep 13 18:20:15 2009 -0400
@@ -57,6 +57,9 @@
g.vcpus = 5
return g
+def get_floppy(path="/default-pool/testvol1.img"):
+ return VirtualDisk(path, conn=conn, device=VirtualDisk.DEVICE_FLOPPY)
+
def get_filedisk(path="/tmp/test.img"):
return VirtualDisk(path, size=.0001, conn=conn)
@@ -326,8 +329,11 @@
g = get_basic_fullyvirt_guest("kvm")
g.os_type = "linux"
g.os_variant = "fedora11"
- g.installer = virtinst.PXEInstaller(type="kvm", os_type="hvm",
- conn=g.conn)
+ g.installer = virtinst.DistroInstaller(type="kvm", os_type="hvm",
+ conn=g.conn,
+ location="/default-pool/default-vol")
+ g.installer.cdrom = True
+ g.disks.append(get_floppy())
g.disks.append(get_filedisk())
g.disks.append(get_blkdisk())
g.nics.append(get_virtual_network())
diff -r 726dc6953396 -r 252ff7bc5ff9 virtinst/FullVirtGuest.py
--- a/virtinst/FullVirtGuest.py Sun Sep 13 13:05:53 2009 -0400
+++ b/virtinst/FullVirtGuest.py Sun Sep 13 18:20:15 2009 -0400
@@ -24,6 +24,7 @@
from Guest import Guest
from VirtualDevice import VirtualDevice
+from VirtualDisk import VirtualDisk
from VirtualInputDevice import VirtualInputDevice
from VirtualCharDevice import VirtualCharDevice
@@ -122,7 +123,8 @@
if net_model and not net.model:
net.model = net_model
for disk in self._get_install_devs(VirtualDevice.VIRTUAL_DEV_DISK):
- if disk_bus and not disk.bus:
+ if (disk_bus and not disk.bus and
+ disk.device == VirtualDisk.DEVICE_DISK):
disk.bus = disk_bus
# If no serial devices were attached to the guest, stick the default