mirror of https://gitee.com/openkylin/libvirt.git
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: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
5d98074c7b
commit
ccf41a4b57
|
@ -1308,7 +1308,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
|
|||
|
||||
case VIR_DOMAIN_NET_TYPE_USER:
|
||||
if (!priv->disableSlirp &&
|
||||
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NET_SOCKET_DGRAM)) {
|
||||
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) {
|
||||
qemuSlirpPtr slirp = qemuInterfacePrepareSlirp(driver, net);
|
||||
|
||||
if (!slirp)
|
||||
|
|
|
@ -5756,7 +5756,7 @@ qemuProcessNetworkPrepareDevices(virQEMUDriverPtr driver,
|
|||
goto cleanup;
|
||||
} else if (actualType == VIR_DOMAIN_NET_TYPE_USER &&
|
||||
!priv->disableSlirp &&
|
||||
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NET_SOCKET_DGRAM)) {
|
||||
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) {
|
||||
qemuSlirpPtr slirp = qemuInterfacePrepareSlirp(driver, net);
|
||||
|
||||
QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp = slirp;
|
||||
|
|
|
@ -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 \
|
||||
-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 \
|
||||
-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,\
|
||||
addr=0x2 \
|
||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
||||
|
|
|
@ -533,7 +533,7 @@ testCompareXMLToArgv(const void *data)
|
|||
virDomainNetDefPtr net = vm->def->nets[i];
|
||||
|
||||
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();
|
||||
slirp->fd[0] = 42;
|
||||
QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp = slirp;
|
||||
|
|
Loading…
Reference in New Issue