提交 66d9bc00 编写于 作者: L Laine Stump

qemu: support vhost-net for generic ethernet devices

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).
上级 a6cfed26
...@@ -6159,6 +6159,7 @@ qemuBuildCommandLine(virConnectPtr conn, ...@@ -6159,6 +6159,7 @@ qemuBuildCommandLine(virConnectPtr conn,
if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK || if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
actualType == VIR_DOMAIN_NET_TYPE_BRIDGE || actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
actualType == VIR_DOMAIN_NET_TYPE_ETHERNET ||
actualType == VIR_DOMAIN_NET_TYPE_DIRECT) { actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
/* Attempt to use vhost-net mode for these types of /* Attempt to use vhost-net mode for these types of
network device */ network device */
......
...@@ -754,6 +754,9 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, ...@@ -754,6 +754,9 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
iface_connected = true; iface_connected = true;
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0) if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0)
goto cleanup; 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) || if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NET_NAME) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册