On 8/8/19 4:54 PM, marcandre.lur...@redhat.com wrote:
From: Marc-André Lureau <marcandre.lur...@redhat.com>

Datagram socket is available since qemu 4.0, commit
fdec16e3c2a614e2861f3086b05d444b5d8c3406 ("net/socket: learn to talk
with a unix dgram socket").

Required for slirp-helper communication.

Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
---
  src/qemu/qemu_capabilities.c                      | 6 ++++++
  src/qemu/qemu_capabilities.h                      | 1 +
  tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml | 1 +
  tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml   | 1 +
  tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml | 1 +
  tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml | 1 +
  tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml   | 1 +
  tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml  | 1 +
  tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml  | 1 +
  9 files changed, 14 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 405bc3f288..4cb135cd93 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -536,6 +536,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 335 */
                "bochs-display",
+              "net-socket-dgram",
      );
@@ -4389,6 +4390,11 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCapsPtr qemuCaps)
          ARCH_IS_PPC64(qemuCaps->arch)) {
          virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT);
      }
+
+    /* -net socket,fd= with dgram socket (for ex, with slirp helper) */
+    if (qemuCaps->version >= 3001092) {
+        virQEMUCapsSet(qemuCaps, QEMU_CAPS_NET_SOCKET_DGRAM);
+    }

For some weird reasons we don't allow curly braces around a single line body. Also, I know this is available since 3.1.92 because that's how qemu advertises its versions towards the end of release cycle, but I'd rather see 4.0.0 encoded - that's what is going to match version from a package anyway.

Or even better, isn't there a way for libvirt to detect this using some monitor sorcery?

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to