At 10/06/2011 05:52 AM, Eric Blake Write:
Now that RHEL 6.2 Beta is out, it would be nice to test
multifunction
devices on that platform. This changes things so that the multifunction
cap bit can be set in two different ways: by version comparison (needed
for qemu 0.13 which lacked a -device query), and by -device query
(provided by qemu.git and backported to the RHEL beta build of
qemu-kvm which still claims to be a modified 0.12, and therefore needed
for RHEL).
* src/qemu/qemu_capabilities.c (qemuCapsParseDeviceStr): Allow
second method of setting multifunction cap bit.
* tests/qemuhelptest.c (mymain): Test it.
* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta: New file.
* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device: Likewise.
---
src/qemu/qemu_capabilities.c | 2 +
tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta | 230 ++++++++++++++++++++
.../qemu-kvm-0.12.1.2-rhel62-beta-device | 120 ++++++++++
tests/qemuhelptest.c | 59 +++++
4 files changed, 411 insertions(+), 0 deletions(-)
create mode 100644 tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta
create mode 100644 tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index a653243..49be5a2 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1264,6 +1264,8 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
/* Features of given devices. */
if (strstr(str, "pci-assign.configfd"))
qemuCapsSet(flags, QEMU_CAPS_PCI_CONFIGFD);
+ if (strstr(str, "pci-assign.multifunction"))
+ qemuCapsSet(flags, QEMU_CAPS_PCI_MULTIFUNCTION);
Only qemu-kvm has pci-assign, so I think it is better to check
'virtio-blk-pci.multifunction'.
Thanks
Wen Congyang
if (strstr(str, "virtio-blk-pci.bootindex")) {
qemuCapsSet(flags, QEMU_CAPS_BOOTINDEX);
if (strstr(str, "pci-assign.bootindex"))