[PATCH v2 12/17] qemu: assume vnet-hdr feature is always available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/qemu/qemu_capabilities.c                       |  7 +------
 src/qemu/qemu_capabilities.h                       |  2 +-
 src/qemu/qemu_command.c                            | 16 ++++------------
 src/qemu/qemu_command.h                            |  2 --
 src/qemu/qemu_hotplug.c                            |  3 +--
 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/qemucaps2xmldata/all_1.6.0-1.caps            |  1 -
 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps |  1 -
 tests/qemuhelptest.c                               |  5 -----
 15 files changed, 7 insertions(+), 37 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 2346e40..ae343cc 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1081,7 +1081,6 @@ virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache)
 static int
 virQEMUCapsComputeCmdFlags(const char *help,
                            unsigned int version,
-                           bool is_kvm,
                            unsigned int kvm_version,
                            virQEMUCapsPtr qemuCaps,
                            bool check_yajl ATTRIBUTE_UNUSED)
@@ -1217,9 +1216,6 @@ virQEMUCapsComputeCmdFlags(const char *help,
         strstr(help, "sockets="))
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_SMP_TOPOLOGY);
 
-    if (is_kvm && (version >= 10000 || kvm_version >= 74))
-        virQEMUCapsSet(qemuCaps, QEMU_CAPS_VNET_HDR);
-
     if (strstr(help, ",vhost="))
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_VHOST_NET);
 
@@ -1448,7 +1444,7 @@ int virQEMUCapsParseHelpStr(const char *qemu,
         goto cleanup;
     }
 
-    if (virQEMUCapsComputeCmdFlags(help, *version, *is_kvm, *kvm_version,
+    if (virQEMUCapsComputeCmdFlags(help, *version, *kvm_version,
                                    qemuCaps, check_yajl) < 0)
         goto cleanup;
 
@@ -3204,7 +3200,6 @@ static qemuMonitorCallbacks callbacks = {
 static void
 virQEMUCapsInitQMPBasic(virQEMUCapsPtr qemuCaps)
 {
-    virQEMUCapsSet(qemuCaps, QEMU_CAPS_VNET_HDR);
     virQEMUCapsSet(qemuCaps, QEMU_CAPS_MIGRATE_QEMU_TCP);
     virQEMUCapsSet(qemuCaps, QEMU_CAPS_MIGRATE_QEMU_EXEC);
     virQEMUCapsSet(qemuCaps, QEMU_CAPS_DRIVE_CACHE_V2);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e13c33d..f5919d9 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -56,7 +56,7 @@ typedef enum {
     X_QEMU_CAPS_NAME, /* Is the -name flag available */
     X_QEMU_CAPS_UUID, /* Is the -uuid flag available */
     X_QEMU_CAPS_DOMID, /* Xenner: -domid flag available */
-    QEMU_CAPS_VNET_HDR,
+    X_QEMU_CAPS_VNET_HDR,
     QEMU_CAPS_MIGRATE_KVM_STDIO, /* avoid kvm tcp migration bug */
 
     /* 10 */
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ffd4e53..d4cd127 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -219,7 +219,6 @@ qemuVirCommandGetDevSet(virCommandPtr cmd, int fd)
  * @def: the definition of the VM (needed by 802.1Qbh and audit)
  * @driver: pointer to the driver instance
  * @net: pointer to the VM's interface description with direct device type
- * @qemuCaps: flags for qemu
  * @vmop: VM operation type
  *
  * Returns a filedescriptor on success or -1 in case of error.
@@ -228,7 +227,6 @@ int
 qemuPhysIfaceConnect(virDomainDefPtr def,
                      virQEMUDriverPtr driver,
                      virDomainNetDefPtr net,
-                     virQEMUCapsPtr qemuCaps,
                      virNetDevVPortProfileOp vmop)
 {
     int rc;
@@ -237,8 +235,7 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
     unsigned int macvlan_create_flags = VIR_NETDEV_MACVLAN_CREATE_WITH_TAP;
 
-    if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNET_HDR) &&
-        net->model && STREQ(net->model, "virtio"))
+    if (net->model && STREQ(net->model, "virtio"))
         vnet_hdr = 1;
 
     rc = virNetDevMacVLanCreateWithVPortProfile(
@@ -367,7 +364,6 @@ int
 qemuNetworkIfaceConnect(virDomainDefPtr def,
                         virQEMUDriverPtr driver,
                         virDomainNetDefPtr net,
-                        virQEMUCapsPtr qemuCaps,
                         int *tapfd,
                         size_t *tapfdSize)
 {
@@ -402,10 +398,8 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
         template_ifname = true;
     }
 
-    if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNET_HDR) &&
-        net->model && STREQ(net->model, "virtio")) {
+    if (net->model && STREQ(net->model, "virtio"))
         tap_create_flags |= VIR_NETDEV_TAP_CREATE_VNET_HDR;
-    }
 
     if (virQEMUDriverIsPrivileged(driver)) {
         if (virNetDevTapCreateInBridgePort(brname, &net->ifname, &net->mac,
@@ -8749,15 +8743,13 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
         memset(tapfd, -1, tapfdSize * sizeof(tapfd[0]));
 
         if (qemuNetworkIfaceConnect(def, driver, net,
-                                    qemuCaps, tapfd,
-                                    &tapfdSize) < 0)
+                                    tapfd, &tapfdSize) < 0)
             goto cleanup;
     } else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
         if (VIR_ALLOC(tapfd) < 0 || VIR_ALLOC(tapfdName) < 0)
             goto cleanup;
         tapfdSize = 1;
-        tapfd[0] = qemuPhysIfaceConnect(def, driver, net,
-                                        qemuCaps, vmop);
+        tapfd[0] = qemuPhysIfaceConnect(def, driver, net, vmop);
         if (tapfd[0] < 0)
             goto cleanup;
     }
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 4aa7f2d..d1af3b7 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -228,7 +228,6 @@ char *qemuBuildRedirdevDevStr(virDomainDefPtr def,
 int qemuNetworkIfaceConnect(virDomainDefPtr def,
                             virQEMUDriverPtr driver,
                             virDomainNetDefPtr net,
-                            virQEMUCapsPtr qemuCaps,
                             int *tapfd,
                             size_t *tapfdSize)
     ATTRIBUTE_NONNULL(2);
@@ -236,7 +235,6 @@ int qemuNetworkIfaceConnect(virDomainDefPtr def,
 int qemuPhysIfaceConnect(virDomainDefPtr def,
                          virQEMUDriverPtr driver,
                          virDomainNetDefPtr net,
-                         virQEMUCapsPtr qemuCaps,
                          virNetDevVPortProfileOp vmop);
 
 int qemuOpenVhostNet(virDomainDefPtr def,
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 110df3b..4a98bdf 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -947,7 +947,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
             goto cleanup;
         memset(vhostfd, -1, sizeof(*vhostfd) * vhostfdSize);
         if (qemuNetworkIfaceConnect(vm->def, driver, net,
-                                    priv->qemuCaps, tapfd, &tapfdSize) < 0)
+                                    tapfd, &tapfdSize) < 0)
             goto cleanup;
         iface_connected = true;
         if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, vhostfd, &vhostfdSize) < 0)
@@ -961,7 +961,6 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
             goto cleanup;
         *vhostfd = -1;
         if ((tapfd[0] = qemuPhysIfaceConnect(vm->def, driver, net,
-                                             priv->qemuCaps,
                                              VIR_NETDEV_VPORT_PROFILE_OP_CREATE)) < 0)
             goto cleanup;
         iface_connected = true;
diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
index 36d3732..c149b6c 100644
--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
index d0057d4..8425e43 100644
--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
index 79ae61a..2b86eba 100644
--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
index 7b8e93d..39133a1 100644
--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
index fe2ea59..50f5af1 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
index 80f62a1..c339dae 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
index eade502..6c5a32c 100644
--- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.caps b/tests/qemucaps2xmldata/all_1.6.0-1.caps
index ac6bca9..0f6c22a 100644
--- a/tests/qemucaps2xmldata/all_1.6.0-1.caps
+++ b/tests/qemucaps2xmldata/all_1.6.0-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
index e941487..15f67d4 100644
--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
+++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
@@ -1,5 +1,4 @@
   <qemuCaps>
-    <flag name='vnet-hdr'/>
     <flag name='migrate-qemu-tcp'/>
     <flag name='migrate-qemu-exec'/>
     <flag name='drive-cache-v2'/>
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 414c874..7bc52f1 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -183,7 +183,6 @@ mymain(void)
             QEMU_CAPS_VNC);
     DO_TEST("qemu-kvm-0.12.1.2-rhel60", 12001, 1, 0,
             QEMU_CAPS_DRIVE_BOOT,
-            QEMU_CAPS_VNET_HDR,
             QEMU_CAPS_MIGRATE_QEMU_TCP,
             QEMU_CAPS_MIGRATE_QEMU_EXEC,
             QEMU_CAPS_DRIVE_CACHE_V2,
@@ -241,7 +240,6 @@ mymain(void)
             QEMU_CAPS_DEVICE_VIRTIO_NET);
     DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
             QEMU_CAPS_DRIVE_BOOT,
-            QEMU_CAPS_VNET_HDR,
             QEMU_CAPS_MIGRATE_QEMU_TCP,
             QEMU_CAPS_MIGRATE_QEMU_EXEC,
             QEMU_CAPS_DRIVE_CACHE_V2,
@@ -279,7 +277,6 @@ mymain(void)
             QEMU_CAPS_VNC);
     DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0,
             QEMU_CAPS_DRIVE_BOOT,
-            QEMU_CAPS_VNET_HDR,
             QEMU_CAPS_MIGRATE_QEMU_TCP,
             QEMU_CAPS_MIGRATE_QEMU_EXEC,
             QEMU_CAPS_DRIVE_CACHE_V2,
@@ -347,7 +344,6 @@ mymain(void)
             QEMU_CAPS_DEVICE_E1000,
             QEMU_CAPS_DEVICE_VIRTIO_NET);
     DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
-            QEMU_CAPS_VNET_HDR,
             QEMU_CAPS_MIGRATE_QEMU_TCP,
             QEMU_CAPS_MIGRATE_QEMU_EXEC,
             QEMU_CAPS_DRIVE_CACHE_V2,
@@ -412,7 +408,6 @@ mymain(void)
             QEMU_CAPS_DEVICE_E1000,
             QEMU_CAPS_DEVICE_VIRTIO_NET);
     DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
-            QEMU_CAPS_VNET_HDR,
             QEMU_CAPS_MIGRATE_QEMU_TCP,
             QEMU_CAPS_MIGRATE_QEMU_EXEC,
             QEMU_CAPS_DRIVE_CACHE_V2,
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]