]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: support vhost-net for generic ethernet devices
authorLaine Stump <laine@laine.org>
Fri, 8 Feb 2013 17:19:09 +0000 (12:19 -0500)
committerLaine Stump <laine@laine.org>
Fri, 8 Feb 2013 18:13:55 +0000 (13:13 -0500)
From qemu's point of view these are still just tap devices, so there's
no reason they shouldn't work with vhost-net; as a matter of fact,
Raja Sivaramakrishnan <srajag00@yahoo.com> verified on libvir-list
that at least the qemu_command.c part of this patch works:

  https://www.redhat.com/archives/libvir-list/2012-December/msg01314.html

(the hotplug case is extrapolation on my part).

src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c

index 33f2ecd533f92e6831918cb863d9abe35fce6f9b..6c28123f7076d44e61af955313b8c4353718bce6 100644 (file)
@@ -6159,6 +6159,7 @@ qemuBuildCommandLine(virConnectPtr conn,
 
             if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
                 actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
+                actualType == VIR_DOMAIN_NET_TYPE_ETHERNET ||
                 actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
                 /* Attempt to use vhost-net mode for these types of
                    network device */
index 4504f0b8b882eed0807d55a801609a0ba0bae9aa..0c28a6a3a9a769aed36c875f6e71680d9031768e 100644 (file)
@@ -754,6 +754,9 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
         iface_connected = true;
         if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0)
             goto cleanup;
+    } else if (actualType == VIR_DOMAIN_NET_TYPE_ETHERNET) {
+        if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0)
+            goto cleanup;
     }
 
     if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NET_NAME) ||