This capability can be used to detect whether or not the QEMU
binary supports the virtio-net-* network device.
---
src/qemu/qemu_capabilities.c | 5 +++++
src/qemu/qemu_capabilities.h | 1 +
tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 +
tests/qemuhelptest.c | 18 ++++++++++++------
10 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index a875727..4ad1bdb 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -295,6 +295,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"xio3130-downstream", /* 195 */
"rtl8139",
"e1000",
+ "virtio-net",
);
@@ -1581,6 +1582,10 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "xio3130-downstream", QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM },
{ "rtl8139", QEMU_CAPS_DEVICE_RTL8139 },
{ "e1000", QEMU_CAPS_DEVICE_E1000 },
+ { "virtio-net-pci", QEMU_CAPS_DEVICE_VIRTIO_NET },
+ { "virtio-net-ccw", QEMU_CAPS_DEVICE_VIRTIO_NET },
+ { "virtio-net-s390", QEMU_CAPS_DEVICE_VIRTIO_NET },
+ { "virtio-net-device", QEMU_CAPS_DEVICE_VIRTIO_NET },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 76490cb..2623574 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -237,6 +237,7 @@ typedef enum {
QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM = 195, /* -device xio3130-downstream */
QEMU_CAPS_DEVICE_RTL8139 = 196, /* -device rtl8139 */
QEMU_CAPS_DEVICE_E1000 = 197, /* -device e1000 */
+ QEMU_CAPS_DEVICE_VIRTIO_NET = 198, /* -device virtio-net-* */
QEMU_CAPS_LAST, /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
index d083d18..5f179de 100644
--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
@@ -125,4 +125,5 @@
<flag name='xio3130-downstream'/>
<flag name='rtl8139'/>
<flag name='e1000'/>
+ <flag name='virtio-net'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
index 3fdfdca..dad097a 100644
--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
@@ -140,4 +140,5 @@
<flag name='xio3130-downstream'/>
<flag name='rtl8139'/>
<flag name='e1000'/>
+ <flag name='virtio-net'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
index b9bb82f..1f2682e 100644
--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
@@ -141,4 +141,5 @@
<flag name='xio3130-downstream'/>
<flag name='rtl8139'/>
<flag name='e1000'/>
+ <flag name='virtio-net'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
index 7364cd4..95f364f 100644
--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
@@ -150,4 +150,5 @@
<flag name='xio3130-downstream'/>
<flag name='rtl8139'/>
<flag name='e1000'/>
+ <flag name='virtio-net'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
index 8753b28..6533a6e 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
@@ -156,4 +156,5 @@
<flag name='xio3130-downstream'/>
<flag name='rtl8139'/>
<flag name='e1000'/>
+ <flag name='virtio-net'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
index 5234cca..b2e775b 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
@@ -156,4 +156,5 @@
<flag name='xio3130-downstream'/>
<flag name='rtl8139'/>
<flag name='e1000'/>
+ <flag name='virtio-net'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
index 580ad30..88fe13a 100644
--- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
@@ -172,4 +172,5 @@
<flag name='xio3130-downstream'/>
<flag name='rtl8139'/>
<flag name='e1000'/>
+ <flag name='virtio-net'/>
</qemuCaps>
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 53908cf..7b78537 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -411,7 +411,8 @@ mymain(void)
QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000);
+ QEMU_CAPS_DEVICE_E1000,
+ QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -528,7 +529,8 @@ mymain(void)
QEMU_CAPS_HOST_PCI_MULTIDOMAIN,
QEMU_CAPS_DEVICE_IVSHMEM,
QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000);
+ QEMU_CAPS_DEVICE_E1000,
+ QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -597,7 +599,8 @@ mymain(void)
QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000);
+ QEMU_CAPS_DEVICE_E1000,
+ QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -674,7 +677,8 @@ mymain(void)
QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_USB_STORAGE,
QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000);
+ QEMU_CAPS_DEVICE_E1000,
+ QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-1.0", 1000000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -766,7 +770,8 @@ mymain(void)
QEMU_CAPS_DEVICE_X3130_UPSTREAM,
QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM,
QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000);
+ QEMU_CAPS_DEVICE_E1000,
+ QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST("qemu-1.1.0", 1001000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -871,7 +876,8 @@ mymain(void)
QEMU_CAPS_DEVICE_X3130_UPSTREAM,
QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM,
QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000);
+ QEMU_CAPS_DEVICE_E1000,
+ QEMU_CAPS_DEVICE_VIRTIO_NET);
DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED,
QEMU_CAPS_LAST);
DO_TEST_FULL("qemu-kvm-1.2.0", 1002000, 1, 0, VIR_ERR_CONFIG_UNSUPPORTED,
--
2.4.3