提交 e8daeeb1 编写于 作者: L Laine Stump

qemu: add capabilities flags related to SG_IO

This patch adds two capabilities flags to deal with various aspects
of supporting SG_IO commands on virtio-blk-pci devices:

  QEMU_CAPS_VIRTIO_BLK_SCSI
    set if -device virtio-blk-pci accepts the scsi="on|off" option
    When present, this is on by default, but can be set to off to disable
    SG_IO functions.

  QEMU_CAPS_VIRTIO_BLK_SG_IO
    set if SG_IO commands are supported in the virtio-blk-pci driver
    (present since qemu 0.11 according to a qemu developer, if I
     understood correctly)
上级 1734cdb9
......@@ -144,6 +144,9 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"ich9-ahci",
"no-acpi",
"fsdev-readonly",
"virtio-blk-pci.scsi",
"blk-sg-io",
);
struct qemu_feature_flags {
......@@ -1149,6 +1152,9 @@ qemuCapsComputeCmdFlags(const char *help,
if (version >= 10000)
qemuCapsSet(flags, QEMU_CAPS_0_10);
if (version >= 11000)
qemuCapsSet(flags, QEMU_CAPS_VIRTIO_BLK_SG_IO);
/* While JSON mode was available in 0.12.0, it was too
* incomplete to contemplate using. The 0.13.0 release
* is good enough to use, even though it lacks one or
......@@ -1386,6 +1392,8 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
qemuCapsSet(flags, QEMU_CAPS_VIRTIO_BLK_EVENT_IDX);
if (strstr(str, "virtio-net-pci.event_idx"))
qemuCapsSet(flags, QEMU_CAPS_VIRTIO_NET_EVENT_IDX);
if (strstr(str, "virtio-blk-pci.scsi"))
qemuCapsSet(flags, QEMU_CAPS_VIRTIO_BLK_SCSI);
return 0;
}
......
......@@ -118,6 +118,9 @@ enum qemuCapsFlags {
QEMU_CAPS_NO_ACPI = 78, /* -no-acpi */
QEMU_CAPS_FSDEV_READONLY =79, /* -fsdev readonly supported */
QEMU_CAPS_VIRTIO_BLK_SCSI = 80, /* virtio-blk-pci.scsi */
QEMU_CAPS_VIRTIO_BLK_SG_IO = 81, /* support for SG_IO commands, reportedly added in 0.11 */
QEMU_CAPS_LAST, /* this must always be the last item */
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册