Skip to contentSkip to conversation

virtio-scsi: fix with -M pc-i440fx-2.0

PATCH In review Paolo Bonzini 2 participants 2 messages Jul 14, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-scsi: fix with -M pc-i440fx-2.0

Right now starting a machine with virtio-scsi and a <= 2.0 machine type fails with:

qemu-system-x86_64: -device virtio-scsi-pci: Property .any_layout not found

This is because the any_layout bit was actually never set after virtio-scsi was changed to support arbitrary layout for virtio buffers.

(This was just a cleanup and a preparation for virtio 1.0; no guest actually checks the bit, but the new request parsing algorithms are tested even with old guest).

---
 include/hw/virtio/virtio-scsi.h | 2 ++
 1 file changed, 2 insertions(+)
include/hw/virtio/virtio-scsi.h +2 -0
index 0419ee4..188a2d9 100644
@@ -178,6 +178,8 @@ typedef struct {
     DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128)
 
 #define DEFINE_VIRTIO_SCSI_FEATURES(_state, _feature_field)                    \
+    DEFINE_PROP_BIT("any_layout", _state, _feature_field,                      \
+                    VIRTIO_F_ANY_LAYOUT, true),                                \
     DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG,  \
                                                        true),                  \
     DEFINE_PROP_BIT("param_change", _state, _feature_field,                    \
Signature · 1 line
1.9.3
#1 lore raw
Quoted 8 lines · * Paolo Bonzini ([email protected]) wrote:

Right now starting a machine with virtio-scsi and a <= 2.0 machine type fails with:

qemu-system-x86_64: -device virtio-scsi-pci: Property .any_layout not found

This is because the any_layout bit was actually never set after virtio-scsi was changed to support arbitrary layout for virtio buffers.

Quoted 6 lines

(This was just a cleanup and a preparation for virtio 1.0; no guest actually checks the bit, but the new request parsing algorithms are tested even with old guest).

Seems to fix the bug I hit.

Dave

Quoted 20 lines
---
 include/hw/virtio/virtio-scsi.h | 2 ++
 1 file changed, 2 insertions(+)
include/hw/virtio/virtio-scsi.h +2 -0
index 0419ee4..188a2d9 100644
@@ -178,6 +178,8 @@ typedef struct {
     DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128)
 
 #define DEFINE_VIRTIO_SCSI_FEATURES(_state, _feature_field)                    \
+    DEFINE_PROP_BIT("any_layout", _state, _feature_field,                      \
+                    VIRTIO_F_ANY_LAYOUT, true),                                \
     DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG,  \
                                                        true),                  \
     DEFINE_PROP_BIT("param_change", _state, _feature_field,                    \
Signature · 1 line
1.9.3

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK