[PATCH v2 1/2] qemu: Enable slirp-helper iff dbus-vmstate present

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

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_hotplug.c                           | 2 +-
 src/qemu/qemu_process.c                           | 2 +-
 tests/qemuxml2argvdata/net-user.x86_64-4.0.0.args | 2 +-
 tests/qemuxml2argvtest.c                          | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index bd8868b0f7..c31b2928e4 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1329,7 +1329,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)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 955ba4de4c..0b2afe6841 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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;
diff --git a/tests/qemuxml2argvdata/net-user.x86_64-4.0.0.args b/tests/qemuxml2argvdata/net-user.x86_64-4.0.0.args
index d51653dcdd..3fb745c212 100644
--- a/tests/qemuxml2argvdata/net-user.x86_64-4.0.0.args
+++ b/tests/qemuxml2argvdata/net-user.x86_64-4.0.0.args
@@ -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,\
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 1f2ae5958a..0773455b98 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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;
-- 
2.21.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]

  Powered by Linux