提交 b238c0be 编写于 作者: H Han Cheng 提交者: Osier Yang

qemu: New cap flags for scsi-generic

Adding two cap flags for scsi-generic:
  QEMU_CAPS_SCSI_GENERIC
  QEMU_CAPS_SCSI_GENERIC_BOOTINDEX
Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: NOsier Yang <jyang@redhat.com>
上级 9677ff08
......@@ -221,9 +221,12 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"tpm-tis",
"nvram", /* 140 */
"pci-bridge", /* 141 */
"vfio-pci", /* 142 */
"vfio-pci.bootindex", /* 143 */
"pci-bridge",
"vfio-pci",
"vfio-pci.bootindex",
"scsi-generic",
"scsi-generic.bootindex", /* 145 */
);
struct _virQEMUCaps {
......@@ -1344,8 +1347,8 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "VGA", QEMU_CAPS_DEVICE_VGA },
{ "cirrus-vga", QEMU_CAPS_DEVICE_CIRRUS_VGA },
{ "vmware-svga", QEMU_CAPS_DEVICE_VMWARE_SVGA },
{ "usb-serial", QEMU_CAPS_DEVICE_USB_SERIAL},
{ "usb-net", QEMU_CAPS_DEVICE_USB_NET},
{ "usb-serial", QEMU_CAPS_DEVICE_USB_SERIAL },
{ "usb-net", QEMU_CAPS_DEVICE_USB_NET },
{ "virtio-rng-pci", QEMU_CAPS_DEVICE_VIRTIO_RNG },
{ "virtio-rng-s390", QEMU_CAPS_DEVICE_VIRTIO_RNG },
{ "virtio-rng-ccw", QEMU_CAPS_DEVICE_VIRTIO_RNG },
......@@ -1354,6 +1357,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "spapr-nvram", QEMU_CAPS_DEVICE_NVRAM },
{ "pci-bridge", QEMU_CAPS_DEVICE_PCI_BRIDGE },
{ "vfio-pci", QEMU_CAPS_DEVICE_VFIO_PCI },
{ "scsi-generic", QEMU_CAPS_DEVICE_SCSI_GENERIC },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = {
......@@ -1403,6 +1407,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUsbHost[] = {
{ "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsScsiGeneric[] = {
{ "bootindex", QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX },
};
struct virQEMUCapsObjectTypeProps {
const char *type;
struct virQEMUCapsStringFlags *props;
......@@ -1438,6 +1446,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbRedir) },
{ "usb-host", virQEMUCapsObjectPropsUsbHost,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbHost) },
{ "scsi-generic", virQEMUCapsObjectPropsScsiGeneric,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsScsiGeneric) },
};
......@@ -1635,6 +1645,7 @@ virQEMUCapsExtractDeviceStr(const char *qemu,
"-device", "usb-redir,?",
"-device", "ide-drive,?",
"-device", "usb-host,?",
"-device", "scsi-generic,?",
NULL);
/* qemu -help goes to stdout, but qemu -device ? goes to stderr. */
virCommandSetErrorBuffer(cmd, &output);
......
......@@ -182,6 +182,8 @@ enum virQEMUCapsFlags {
QEMU_CAPS_DEVICE_PCI_BRIDGE = 141, /* -device pci-bridge */
QEMU_CAPS_DEVICE_VFIO_PCI = 142, /* -device vfio-pci */
QEMU_CAPS_VFIO_PCI_BOOTINDEX = 143, /* bootindex param for vfio-pci device */
QEMU_CAPS_DEVICE_SCSI_GENERIC = 144, /* -device scsi-generic */
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX = 145, /* -device scsi-generic.bootindex */
QEMU_CAPS_LAST, /* this must always be the last item */
};
......
......@@ -136,3 +136,13 @@ virtio-net-pci.romfile=string
virtio-net-pci.rombar=uint32
virtio-net-pci.multifunction=on/off
virtio-net-pci.command_serr_enable=on/off
scsi-generic.drive=drive
scsi-generic.logical_block_size=uint16
scsi-generic.physical_block_size=uint16
scsi-generic.min_io_size=uint16
scsi-generic.opt_io_size=uint32
scsi-generic.bootindex=int32
scsi-generic.discard_granularity=uint32
scsi-generic.channel=uint32
scsi-generic.scsi-id=uint32
scsi-generic.lun=uint32
......@@ -158,3 +158,13 @@ scsi-disk.dpofua=on/off
scsi-disk.channel=uint32
scsi-disk.scsi-id=uint32
scsi-disk.lun=uint32
scsi-generic.drive=drive
scsi-generic.logical_block_size=blocksize
scsi-generic.physical_block_size=blocksize
scsi-generic.min_io_size=uint16
scsi-generic.opt_io_size=uint32
scsi-generic.bootindex=int32
scsi-generic.discard_granularity=uint32
scsi-generic.channel=uint32
scsi-generic.scsi-id=uint32
scsi-generic.lun=uint32
......@@ -208,3 +208,8 @@ usb-host.bootindex=int32
usb-host.pipeline=on/off
usb-host.port=string
usb-host.full-path=on/off
scsi-generic.drive=drive
scsi-generic.bootindex=int32
scsi-generic.channel=uint32
scsi-generic.scsi-id=uint32
scsi-generic.lun=uint32
......@@ -220,3 +220,8 @@ usb-host.bootindex=int32
usb-host.pipeline=on/off
usb-host.port=string
usb-host.full-path=on/off
scsi-generic.drive=drive
scsi-generic.bootindex=int32
scsi-generic.channel=uint32
scsi-generic.scsi-id=uint32
scsi-generic.lun=uint32
......@@ -510,7 +510,8 @@ mymain(void)
QEMU_CAPS_DEVICE_VMWARE_SVGA,
QEMU_CAPS_DEVICE_USB_SERIAL,
QEMU_CAPS_DEVICE_USB_NET,
QEMU_CAPS_DEVICE_PCI_BRIDGE);
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_SCSI_GENERIC);
DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
......@@ -730,7 +731,9 @@ mymain(void)
QEMU_CAPS_DEVICE_CIRRUS_VGA,
QEMU_CAPS_DEVICE_VMWARE_SVGA,
QEMU_CAPS_DEVICE_USB_SERIAL,
QEMU_CAPS_DEVICE_USB_NET);
QEMU_CAPS_DEVICE_USB_NET,
QEMU_CAPS_DEVICE_SCSI_GENERIC,
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX);
DO_TEST("qemu-1.1.0", 1001000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
......@@ -822,7 +825,9 @@ mymain(void)
QEMU_CAPS_DEVICE_USB_NET,
QEMU_CAPS_DTB,
QEMU_CAPS_IPV6_MIGRATION,
QEMU_CAPS_DEVICE_PCI_BRIDGE);
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_SCSI_GENERIC,
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX);
DO_TEST("qemu-1.2.0", 1002000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
......@@ -926,7 +931,9 @@ mymain(void)
QEMU_CAPS_DTB,
QEMU_CAPS_SCSI_MEGASAS,
QEMU_CAPS_IPV6_MIGRATION,
QEMU_CAPS_DEVICE_PCI_BRIDGE);
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_SCSI_GENERIC,
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX);
DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
......@@ -1035,7 +1042,9 @@ mymain(void)
QEMU_CAPS_DTB,
QEMU_CAPS_SCSI_MEGASAS,
QEMU_CAPS_IPV6_MIGRATION,
QEMU_CAPS_DEVICE_PCI_BRIDGE);
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_SCSI_GENERIC,
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册