提交 ccf41a4b 编写于 作者: M Michal Privoznik

qemu: Enable slirp-helper iff dbus-vmstate present

The fact that qemu is capable -netdev socket is not enough to
start a migratable domain. It also needs dbus-vmstate capability.
Since there are already some qemu releases which have
net-socket-dgram capability and don't have dbus-vmstate we need
to check for dbus-vmstate.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 5d98074c
...@@ -1308,7 +1308,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, ...@@ -1308,7 +1308,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
case VIR_DOMAIN_NET_TYPE_USER: case VIR_DOMAIN_NET_TYPE_USER:
if (!priv->disableSlirp && if (!priv->disableSlirp &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NET_SOCKET_DGRAM)) { virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) {
qemuSlirpPtr slirp = qemuInterfacePrepareSlirp(driver, net); qemuSlirpPtr slirp = qemuInterfacePrepareSlirp(driver, net);
if (!slirp) if (!slirp)
......
...@@ -5756,7 +5756,7 @@ qemuProcessNetworkPrepareDevices(virQEMUDriverPtr driver, ...@@ -5756,7 +5756,7 @@ qemuProcessNetworkPrepareDevices(virQEMUDriverPtr driver,
goto cleanup; goto cleanup;
} else if (actualType == VIR_DOMAIN_NET_TYPE_USER && } else if (actualType == VIR_DOMAIN_NET_TYPE_USER &&
!priv->disableSlirp && !priv->disableSlirp &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NET_SOCKET_DGRAM)) { virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) {
qemuSlirpPtr slirp = qemuInterfacePrepareSlirp(driver, net); qemuSlirpPtr slirp = qemuInterfacePrepareSlirp(driver, net);
QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp = slirp; QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp = slirp;
......
...@@ -29,7 +29,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ ...@@ -29,7 +29,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-netdev socket,fd=42,id=hostnet0 \ -netdev user,id=hostnet0 \
-device rtl8139,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,\ -device rtl8139,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,\
addr=0x2 \ addr=0x2 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
......
...@@ -533,7 +533,7 @@ testCompareXMLToArgv(const void *data) ...@@ -533,7 +533,7 @@ testCompareXMLToArgv(const void *data)
virDomainNetDefPtr net = vm->def->nets[i]; virDomainNetDefPtr net = vm->def->nets[i];
if (net->type == VIR_DOMAIN_NET_TYPE_USER && if (net->type == VIR_DOMAIN_NET_TYPE_USER &&
virQEMUCapsGet(info->qemuCaps, QEMU_CAPS_NET_SOCKET_DGRAM)) { virQEMUCapsGet(info->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) {
qemuSlirpPtr slirp = qemuSlirpNew(); qemuSlirpPtr slirp = qemuSlirpNew();
slirp->fd[0] = 42; slirp->fd[0] = 42;
QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp = slirp; QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp = slirp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册