Revert "devices: disk: Use virtio-scsi for CDROMs where supported"

This reverts commit a746150bef.

See discussion:
https://www.redhat.com/archives/virt-tools-list/2019-March/msg00058.html

Apparently some debian versions struggle with this. Let's stick with
the old method until there's a sufficiently compelling reason to change

Some adjustment is required to deal with changes added by later patches
This commit is contained in:
Cole Robinson 2019-03-08 11:30:24 -05:00
parent 6780bc0c0e
commit 32034c6847
3 changed files with 12 additions and 9 deletions

View File

@ -40,11 +40,10 @@
<disk type="file" device="cdrom">
<driver name="qemu" type="qcow2"/>
<source file="/dev/default-pool/testvol1.img"/>
<target dev="sda" bus="scsi"/>
<target dev="hda" bus="ide"/>
<readonly/>
</disk>
<controller type="usb" index="0" model="qemu-xhci" ports="15"/>
<controller type="scsi" index="0" model="virtio-scsi"/>
<interface type="user">
<mac address="00:11:22:33:44:55"/>
<model type="virtio"/>
@ -110,11 +109,10 @@
<target dev="vda" bus="virtio"/>
</disk>
<disk type="file" device="cdrom">
<target dev="sda" bus="scsi"/>
<target dev="hda" bus="ide"/>
<readonly/>
</disk>
<controller type="usb" index="0" model="qemu-xhci" ports="15"/>
<controller type="scsi" index="0" model="virtio-scsi"/>
<interface type="user">
<mac address="00:11:22:33:44:55"/>
<model type="virtio"/>

View File

@ -40,7 +40,7 @@
<disk type="file" device="cdrom">
<driver name="qemu"/>
<source file="/tmp/fake-fedora17-tree.iso"/>
<target dev="sda" bus="scsi"/>
<target dev="hda" bus="ide"/>
<readonly/>
</disk>
<controller type="usb" index="0" model="ich9-ehci1"/>
@ -53,7 +53,6 @@
<controller type="usb" index="0" model="ich9-uhci3">
<master startport="4"/>
</controller>
<controller type="scsi" index="0" model="virtio-scsi"/>
<console type="pty"/>
<channel type="unix">
<source mode="bind"/>
@ -115,7 +114,7 @@
<target dev="vda" bus="virtio"/>
</disk>
<disk type="file" device="cdrom">
<target dev="sda" bus="scsi"/>
<target dev="hda" bus="ide"/>
<readonly/>
</disk>
<controller type="usb" index="0" model="ich9-ehci1"/>
@ -128,7 +127,6 @@
<controller type="usb" index="0" model="ich9-uhci3">
<master startport="4"/>
</controller>
<controller type="scsi" index="0" model="virtio-scsi"/>
<console type="pty"/>
<channel type="unix">
<source mode="bind"/>

View File

@ -951,12 +951,19 @@ class DeviceDisk(Device):
return "ide"
if self.is_disk() and guest.supports_virtiodisk():
return "virtio"
if self.is_cdrom() and guest.supports_virtioscsi():
if (self.is_cdrom() and
guest.supports_virtioscsi() and
not guest.os.is_x86()):
# x86 long time default has been IDE CDROM, stick with that to
# avoid churn, but every newer virt arch that supports virtio-scsi
# should use it
return "scsi"
if guest.os.is_arm():
return "sd"
if guest.os.is_q35():
return "sata"
if self.is_cdrom() and guest.os.is_s390x():
return "scsi"
return "ide"
def set_defaults(self, guest):