render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
7a3408
From e3f9eca39518a48a31bb3d62c468df34b9448452 Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <e3f9eca39518a48a31bb3d62c468df34b9448452@dist-git>
7a3408
From: Andrea Bolognani <abologna@redhat.com>
7a3408
Date: Fri, 11 Sep 2015 17:00:18 +0200
7a3408
Subject: [PATCH] qemu: Introduce QEMU_CAPS_DEVICE_E1000
7a3408
7a3408
This capability can be used to detect whether or not the QEMU
7a3408
binary supports the e1000 network device.
7a3408
7a3408
(cherry picked from commit fb58318d7f2c05df4d1fc497d96e5718951e9e89)
7a3408
7a3408
Conflicts:
7a3408
	src/qemu/qemu_capabilities.h
7a3408
	tests/qemuhelptest.c
7a3408
7a3408
Conflicts are caused by the fact that some members are missing from
7a3408
the virQEMUCaps enumeration because the relevant commits have not
7a3408
been backported.
7a3408
7a3408
The value of QEMU_CAPS_DEVICE_E1000 has been changed from 197 to 193
7a3408
to avoid making the enumeration sparse.
7a3408
7a3408
The test program has been updated accordingly as well, removing any
7a3408
reference to capabilities that have not been backported.
7a3408
7a3408
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1254044
7a3408
7a3408
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 src/qemu/qemu_capabilities.c                  |  2 ++
7a3408
 src/qemu/qemu_capabilities.h                  |  1 +
7a3408
 tests/qemucapabilitiesdata/caps_1.2.2-1.caps  |  1 +
7a3408
 tests/qemucapabilitiesdata/caps_1.3.1-1.caps  |  1 +
7a3408
 tests/qemucapabilitiesdata/caps_1.4.2-1.caps  |  1 +
7a3408
 tests/qemucapabilitiesdata/caps_1.5.3-1.caps  |  1 +
7a3408
 tests/qemucapabilitiesdata/caps_1.6.0-1.caps  |  1 +
7a3408
 tests/qemucapabilitiesdata/caps_1.6.50-1.caps |  1 +
7a3408
 tests/qemucapabilitiesdata/caps_2.1.1-1.caps  |  1 +
7a3408
 tests/qemuhelptest.c                          | 18 ++++++++++++------
7a3408
 10 files changed, 22 insertions(+), 6 deletions(-)
7a3408
7a3408
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
7a3408
index 69259f5..927b3f9 100644
7a3408
--- a/src/qemu/qemu_capabilities.c
7a3408
+++ b/src/qemu/qemu_capabilities.c
7a3408
@@ -289,6 +289,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
7a3408
               "vhost-user-multiqueue", /* 190 */
7a3408
               "migration-event",
7a3408
               "rtl8139",
7a3408
+              "e1000",
7a3408
     );
7a3408
 
7a3408
 
7a3408
@@ -1571,6 +1572,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
7a3408
     { "pc-dimm", QEMU_CAPS_DEVICE_PC_DIMM },
7a3408
     { "pci-serial", QEMU_CAPS_DEVICE_PCI_SERIAL },
7a3408
     { "rtl8139", QEMU_CAPS_DEVICE_RTL8139 },
7a3408
+    { "e1000", QEMU_CAPS_DEVICE_E1000 },
7a3408
 };
7a3408
 
7a3408
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = {
7a3408
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
7a3408
index 2762cec..a876eb4 100644
7a3408
--- a/src/qemu/qemu_capabilities.h
7a3408
+++ b/src/qemu/qemu_capabilities.h
7a3408
@@ -232,6 +232,7 @@ typedef enum {
7a3408
     QEMU_CAPS_VHOSTUSER_MULTIQUEUE = 190, /* vhost-user with -netdev queues= */
7a3408
     QEMU_CAPS_MIGRATION_EVENT    = 191, /* MIGRATION event */
7a3408
     QEMU_CAPS_DEVICE_RTL8139 = 192, /* -device rtl8139 */
7a3408
+    QEMU_CAPS_DEVICE_E1000 = 193, /* -device e1000 */
7a3408
 
7a3408
     QEMU_CAPS_LAST,                   /* this must always be the last item */
7a3408
 } virQEMUCapsFlags;
7a3408
diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
7a3408
index fd44748..f2fefab 100644
7a3408
--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
7a3408
+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
7a3408
@@ -121,4 +121,5 @@
7a3408
     <flag name='qxl.vgamem_mb'/>
7a3408
     <flag name='qxl-vga.vgamem_mb'/>
7a3408
     <flag name='rtl8139'/>
7a3408
+    <flag name='e1000'/>
7a3408
   </qemuCaps>
7a3408
diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
7a3408
index 0730eab..5e3bdeb 100644
7a3408
--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
7a3408
+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
7a3408
@@ -136,4 +136,5 @@
7a3408
     <flag name='qxl-vga.vgamem_mb'/>
7a3408
     <flag name='pci-serial'/>
7a3408
     <flag name='rtl8139'/>
7a3408
+    <flag name='e1000'/>
7a3408
   </qemuCaps>
7a3408
diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
7a3408
index 66bd901..e8979a2 100644
7a3408
--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
7a3408
+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
7a3408
@@ -137,4 +137,5 @@
7a3408
     <flag name='qxl-vga.vgamem_mb'/>
7a3408
     <flag name='pci-serial'/>
7a3408
     <flag name='rtl8139'/>
7a3408
+    <flag name='e1000'/>
7a3408
   </qemuCaps>
7a3408
diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
7a3408
index fb7a8b0..7a108a1 100644
7a3408
--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
7a3408
+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
7a3408
@@ -146,4 +146,5 @@
7a3408
     <flag name='qxl-vga.vgamem_mb'/>
7a3408
     <flag name='pci-serial'/>
7a3408
     <flag name='rtl8139'/>
7a3408
+    <flag name='e1000'/>
7a3408
   </qemuCaps>
7a3408
diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
7a3408
index 250ef4e..2084f80 100644
7a3408
--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
7a3408
+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
7a3408
@@ -152,4 +152,5 @@
7a3408
     <flag name='qxl-vga.vgamem_mb'/>
7a3408
     <flag name='pci-serial'/>
7a3408
     <flag name='rtl8139'/>
7a3408
+    <flag name='e1000'/>
7a3408
   </qemuCaps>
7a3408
diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
7a3408
index a8850b8..5b2087d 100644
7a3408
--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
7a3408
+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
7a3408
@@ -152,4 +152,5 @@
7a3408
     <flag name='qxl-vga.vgamem_mb'/>
7a3408
     <flag name='pci-serial'/>
7a3408
     <flag name='rtl8139'/>
7a3408
+    <flag name='e1000'/>
7a3408
   </qemuCaps>
7a3408
diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
7a3408
index 705ee65..4b637d4 100644
7a3408
--- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
7a3408
+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
7a3408
@@ -168,4 +168,5 @@
7a3408
     <flag name='pc-dimm'/>
7a3408
     <flag name='pci-serial'/>
7a3408
     <flag name='rtl8139'/>
7a3408
+    <flag name='e1000'/>
7a3408
   </qemuCaps>
7a3408
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
7a3408
index a481693..9b1515e 100644
7a3408
--- a/tests/qemuhelptest.c
7a3408
+++ b/tests/qemuhelptest.c
7a3408
@@ -410,7 +410,8 @@ mymain(void)
7a3408
             QEMU_CAPS_DEVICE_USB_NET,
7a3408
             QEMU_CAPS_DEVICE_USB_KBD,
7a3408
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
7a3408
-            QEMU_CAPS_DEVICE_RTL8139);
7a3408
+            QEMU_CAPS_DEVICE_RTL8139,
7a3408
+            QEMU_CAPS_DEVICE_E1000);
7a3408
     DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
7a3408
             QEMU_CAPS_VNC_COLON,
7a3408
             QEMU_CAPS_NO_REBOOT,
7a3408
@@ -526,7 +527,8 @@ mymain(void)
7a3408
             QEMU_CAPS_DEVICE_USB_STORAGE,
7a3408
             QEMU_CAPS_HOST_PCI_MULTIDOMAIN,
7a3408
             QEMU_CAPS_DEVICE_IVSHMEM,
7a3408
-            QEMU_CAPS_DEVICE_RTL8139);
7a3408
+            QEMU_CAPS_DEVICE_RTL8139,
7a3408
+            QEMU_CAPS_DEVICE_E1000);
7a3408
     DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
7a3408
             QEMU_CAPS_VNC_COLON,
7a3408
             QEMU_CAPS_NO_REBOOT,
7a3408
@@ -594,7 +596,8 @@ mymain(void)
7a3408
             QEMU_CAPS_DEVICE_USB_NET,
7a3408
             QEMU_CAPS_DEVICE_USB_KBD,
7a3408
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
7a3408
-            QEMU_CAPS_DEVICE_RTL8139);
7a3408
+            QEMU_CAPS_DEVICE_RTL8139,
7a3408
+            QEMU_CAPS_DEVICE_E1000);
7a3408
     DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
7a3408
             QEMU_CAPS_VNC_COLON,
7a3408
             QEMU_CAPS_NO_REBOOT,
7a3408
@@ -670,7 +673,8 @@ mymain(void)
7a3408
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
7a3408
             QEMU_CAPS_DEVICE_USB_KBD,
7a3408
             QEMU_CAPS_DEVICE_USB_STORAGE,
7a3408
-            QEMU_CAPS_DEVICE_RTL8139);
7a3408
+            QEMU_CAPS_DEVICE_RTL8139,
7a3408
+            QEMU_CAPS_DEVICE_E1000);
7a3408
     DO_TEST("qemu-1.0", 1000000, 0, 0,
7a3408
             QEMU_CAPS_VNC_COLON,
7a3408
             QEMU_CAPS_NO_REBOOT,
7a3408
@@ -758,7 +762,8 @@ mymain(void)
7a3408
             QEMU_CAPS_DEVICE_USB_STORAGE,
7a3408
             QEMU_CAPS_SPLASH_TIMEOUT,
7a3408
             QEMU_CAPS_DEVICE_IVSHMEM,
7a3408
-            QEMU_CAPS_DEVICE_RTL8139);
7a3408
+            QEMU_CAPS_DEVICE_RTL8139,
7a3408
+            QEMU_CAPS_DEVICE_E1000);
7a3408
     DO_TEST("qemu-1.1.0", 1001000, 0, 0,
7a3408
             QEMU_CAPS_VNC_COLON,
7a3408
             QEMU_CAPS_NO_REBOOT,
7a3408
@@ -859,7 +864,8 @@ mymain(void)
7a3408
             QEMU_CAPS_OBJECT_USB_AUDIO,
7a3408
             QEMU_CAPS_SPLASH_TIMEOUT,
7a3408
             QEMU_CAPS_DEVICE_IVSHMEM,
7a3408
-            QEMU_CAPS_DEVICE_RTL8139);
7a3408
+            QEMU_CAPS_DEVICE_RTL8139,
7a3408
+            QEMU_CAPS_DEVICE_E1000);
7a3408
     DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED,
7a3408
             QEMU_CAPS_LAST);
7a3408
     DO_TEST_FULL("qemu-kvm-1.2.0", 1002000, 1, 0, VIR_ERR_CONFIG_UNSUPPORTED,
7a3408
-- 
7a3408
2.5.2
7a3408