提交 5b90ef08 编写于 作者: L Laine Stump

qemu: detect vfio-pci device and its bootindex parameter

QEMU_CAPS_DEVICE_VFIO_PCI is set if the device named "vfio-pci" is
supported in the qemu binary.

QEMU_CAPS_VFIO_PCI_BOOTINDEX is set if the vfio-pci device supports
the "bootindex" parameter;  for some reason, the bootindex parameter
wasn't included in early versions of vfio support (qemu 1.4) so we
have to check for it separately from vfio itself.
上级 1fbf1905
......@@ -223,6 +223,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"nvram", /* 140 */
"pci-bridge", /* 141 */
"vfio-pci", /* 142 */
"vfio-pci.bootindex", /* 143 */
);
struct _virQEMUCaps {
......@@ -1352,6 +1354,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "rng-egd", QEMU_CAPS_OBJECT_RNG_EGD },
{ "spapr-nvram", QEMU_CAPS_DEVICE_NVRAM },
{ "pci-bridge", QEMU_CAPS_DEVICE_PCI_BRIDGE },
{ "vfio-pci", QEMU_CAPS_DEVICE_VFIO_PCI },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = {
......@@ -1374,6 +1377,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPciAssign[] = {
{ "bootindex", QEMU_CAPS_PCI_BOOTINDEX },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVfioPci[] = {
{ "bootindex", QEMU_CAPS_VFIO_PCI_BOOTINDEX },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsScsiDisk[] = {
{ "channel", QEMU_CAPS_SCSI_DISK_CHANNEL },
{ "wwn", QEMU_CAPS_SCSI_DISK_WWN },
......@@ -1420,6 +1427,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
ARRAY_CARDINALITY(virQEMUCapsObjectPropsPciAssign) },
{ "kvm-pci-assign", virQEMUCapsObjectPropsPciAssign,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsPciAssign) },
{ "vfio-pci", virQEMUCapsObjectPropsVfioPci,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsVfioPci) },
{ "scsi-disk", virQEMUCapsObjectPropsScsiDisk,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsScsiDisk) },
{ "ide-drive", virQEMUCapsObjectPropsIDEDrive,
......
......@@ -178,9 +178,10 @@ enum virQEMUCapsFlags {
QEMU_CAPS_MACHINE_USB_OPT = 137, /* -machine xxx,usb=on/off */
QEMU_CAPS_DEVICE_TPM_PASSTHROUGH = 138, /* -tpmdev passthrough */
QEMU_CAPS_DEVICE_TPM_TIS = 139, /* -device tpm_tis */
QEMU_CAPS_DEVICE_NVRAM = 140, /* -global spapr-nvram.reg=xxxx */
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_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.
先完成此消息的编辑!
想要评论请 注册