From nobody Tue Feb 10 00:57:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562569943; cv=none; d=zoho.com; s=zohoarc; b=Ssgc06TU/IzNfegLf2FGkhn0TDZc4xEiQqXGm4V3ZiXALHCQH6ENxb7A4Um0QIgcB6Vg/EDGC3j0ViRkDpjNGDXByYajdRkt7RQS2goxg58F1/+ZfDC0tP09Nv2mUmrVXuWvE835EnXujIANwerlPezcCOHu82nDexjq7gICZN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562569943; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=r3iLr4PY+q657BBS/X4r0T6K/uFT7VWIrZz5wEDz7ho=; b=BGjVMiAPiJNyfHKEeSGATgbCmui8HttFQrEBNv7i3PIIGjIVQU1yQ/SnVYkhcgyOUvMnXZGTbgJ3C9LGDSHtbuV9/zzLZ5QzojdFTYr5h3WT5RfFsKlB5U/X3FROE84YG4eq52B4C9fuMsMXJLezIh1V2coz9dwzNwVGLrKynlI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562569943704485.37535425040164; Mon, 8 Jul 2019 00:12:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E9AB8F917; Mon, 8 Jul 2019 07:12:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB4FC2B1BB; Mon, 8 Jul 2019 07:12:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AFB181833006; Mon, 8 Jul 2019 07:12:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x687CKIJ007946 for ; Mon, 8 Jul 2019 03:12:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 025EB5C22F; Mon, 8 Jul 2019 07:12:20 +0000 (UTC) Received: from localhost (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F83E5C226; Mon, 8 Jul 2019 07:12:10 +0000 (UTC) From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 11:07:47 +0400 Message-Id: <20190708070747.1962-24-marcandre.lureau@redhat.com> In-Reply-To: <20190708070747.1962-1-marcandre.lureau@redhat.com> References: <20190708070747.1962-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [libvirt] [PATCH 23/23] tests: add slirp-helper qemuxml2argv test X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 08 Jul 2019 07:12:22 +0000 (UTC) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- .../net-user.x86_64-4.0.0.args | 34 +++++++++++++++++++ tests/qemuxml2argvtest.c | 16 +++++++++ tests/testutilsqemu.h | 1 + 3 files changed, 51 insertions(+) create mode 100644 tests/qemuxml2argvdata/net-user.x86_64-4.0.0.args diff --git a/tests/qemuxml2argvdata/net-user.x86_64-4.0.0.args b/tests/qemu= xml2argvdata/net-user.x86_64-4.0.0.args new file mode 100644 index 0000000000..ef4b77be92 --- /dev/null +++ b/tests/qemuxml2argvdata/net-user.x86_64-4.0.0.args @@ -0,0 +1,34 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ +-machine pc-i440fx-4.0,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ +-netdev socket,fd=3D42,id=3Dhostnet0 \ +-device rtl8139,netdev=3Dhostnet0,id=3Dnet0,mac=3D00:11:22:33:44:55,bus=3D= pci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0ac128be00..1436a36b03 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -17,6 +17,7 @@ # include "qemu/qemu_domain.h" # include "qemu/qemu_migration.h" # include "qemu/qemu_process.h" +# include "qemu/qemu_slirp.h" # include "datatypes.h" # include "conf/storage_conf.h" # include "cpu/cpu_map.h" @@ -398,6 +399,7 @@ testCheckExclusiveFlags(int flags) FLAG_FIPS | FLAG_REAL_CAPS | FLAG_SKIP_LEGACY_CPUS | + FLAG_SLIRP_HELPER | 0, -1); =20 VIR_EXCLUSIVE_FLAGS_RET(FLAG_REAL_CAPS, FLAG_SKIP_LEGACY_CPUS, -1); @@ -526,6 +528,19 @@ testCompareXMLToArgv(const void *data) } } =20 + if (flags & FLAG_SLIRP_HELPER) { + for (i =3D 0; i < vm->def->nnets; i++) { + virDomainNetDefPtr net =3D vm->def->nets[i]; + + if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_USER && + virQEMUCapsGet(info->qemuCaps, QEMU_CAPS_NET_SOCKET_DGRAM)= ) { + qemuSlirpPtr slirp =3D qemuSlirpNew(); + slirp->fd[0] =3D 42; + QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp =3D slirp; + } + } + } + if (!(cmd =3D qemuProcessCreatePretendCmd(&driver, vm, migrateURI, (flags & FLAG_FIPS), false, VIR_QEMU_PROCESS_START_COLD)))= { @@ -1280,6 +1295,7 @@ mymain(void) DO_TEST_FAILURE("net-vhostuser-fail", QEMU_CAPS_VHOSTUSER_MULTIQUEUE); DO_TEST("net-user", NONE); + DO_TEST_CAPS_ARCH_VER_FULL("net-user", "x86_64", "4.0.0", ARG_FLAGS, F= LAG_SLIRP_HELPER); DO_TEST("net-user-addr", NONE); DO_TEST("net-virtio", NONE); DO_TEST("net-virtio-device", diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 0632141d68..a2f7bfcc26 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -51,6 +51,7 @@ typedef enum { FLAG_FIPS =3D 1 << 2, FLAG_REAL_CAPS =3D 1 << 3, FLAG_SKIP_LEGACY_CPUS =3D 1 << 4, + FLAG_SLIRP_HELPER =3D 1 << 5, } testQemuInfoFlags; =20 struct testQemuInfo { --=20 2.22.0.214.g8dca754b1e -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list