From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538680995770142.9285191188918; Thu, 4 Oct 2018 12:23:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7C9F307D851; Thu, 4 Oct 2018 19:23:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8937D1057057; Thu, 4 Oct 2018 19:23:12 +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 4197F4CAAE; Thu, 4 Oct 2018 19:23:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMo6I028009 for ; Thu, 4 Oct 2018 15:22:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 06652413A; Thu, 4 Oct 2018 19:22:50 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7ECE660191 for ; Thu, 4 Oct 2018 19:22:49 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:29 +0200 Message-Id: <172ef7c31d6f0ad11aa49851eb6442f64249f6e1.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/15] tests: add smartcard-passthrough-unix 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 04 Oct 2018 19:23:14 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Test CCID smartcard passthrough from a unix listen socket. Use the capabilities of QEMU 2.5.0 which did not support chardev FD passing and the latest one, which (at the time of this commit) it does. Signed-off-by: J=C3=A1n Tomko --- .../smartcard-passthrough-unix.x86_64-2.5.0.args | 30 ++++++++++++++++++= ++ .../smartcard-passthrough-unix.x86_64-latest.args | 33 ++++++++++++++++++= ++++ .../smartcard-passthrough-unix.xml | 19 +++++++++++++ tests/qemuxml2argvtest.c | 2 ++ 4 files changed, 84 insertions(+) create mode 100644 tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_6= 4-2.5.0.args create mode 100644 tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_6= 4-latest.args create mode 100644 tests/qemuxml2argvdata/smartcard-passthrough-unix.xml diff --git a/tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_64-2.5.0= .args b/tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_64-2.5.0.args new file mode 100644 index 0000000000..19ec438392 --- /dev/null +++ b/tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_64-2.5.0.args @@ -0,0 +1,30 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-machine pc-i440fx-2.5,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +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 \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ +-chardev socket,id=3Dcharsmartcard0,path=3D/tmp/smartcard.sock,server,nowa= it \ +-device ccid-card-passthru,chardev=3Dcharsmartcard0,id=3Dsmartcard0,bus=3D= ccid0.0 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_64-lates= t.args b/tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_64-latest.ar= gs new file mode 100644 index 0000000000..eaa3e0b71d --- /dev/null +++ b/tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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 \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ +-chardev socket,id=3Dcharsmartcard0,fd=3D1729,server,nowait \ +-device ccid-card-passthru,chardev=3Dcharsmartcard0,id=3Dsmartcard0,bus=3D= ccid0.0 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/smartcard-passthrough-unix.xml b/tests/= qemuxml2argvdata/smartcard-passthrough-unix.xml new file mode 100644 index 0000000000..054ae9128e --- /dev/null +++ b/tests/qemuxml2argvdata/smartcard-passthrough-unix.xml @@ -0,0 +1,19 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + /usr/bin/qemu-system-x86_64 + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a7cde3ed7e..13a1092e10 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1504,6 +1504,8 @@ mymain(void) QEMU_CAPS_CCID_PASSTHRU); DO_TEST("smartcard-controller", QEMU_CAPS_CCID_EMULATED); + DO_TEST_CAPS_VER("smartcard-passthrough-unix", "2.5.0"); + DO_TEST_CAPS_LATEST("smartcard-passthrough-unix"); =20 DO_TEST("chardev-reconnect", QEMU_CAPS_CHARDEV_RECONNECT, --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538680979033823.2052135498903; Thu, 4 Oct 2018 12:22:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7EEA830015CE; Thu, 4 Oct 2018 19:22:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85EE367C7E; Thu, 4 Oct 2018 19:22:54 +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 8DE544CA94; Thu, 4 Oct 2018 19:22:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMoG8028017 for ; Thu, 4 Oct 2018 15:22:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0C2D60191; Thu, 4 Oct 2018 19:22:50 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 555396443C for ; Thu, 4 Oct 2018 19:22:50 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:30 +0200 Message-Id: <85c9879baee002f5285348bfaab44b9f72c74e01.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/15] tests: add parallel-unix-chardev 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 04 Oct 2018 19:22:57 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Test creating a parallel port backed by a UNIX socket. Signed-off-by: J=C3=A1n Tomko --- .../parallel-unix-chardev.x86_64-2.5.0.args | 33 ++++++++++++++++++= ++ .../parallel-unix-chardev.x86_64-latest.args | 36 ++++++++++++++++++= ++++ tests/qemuxml2argvdata/parallel-unix-chardev.xml | 35 ++++++++++++++++++= +++ tests/qemuxml2argvtest.c | 2 ++ 4 files changed, 106 insertions(+) create mode 100644 tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-2.5= .0.args create mode 100644 tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-lat= est.args create mode 100644 tests/qemuxml2argvdata/parallel-unix-chardev.xml diff --git a/tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-2.5.0.args= b/tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-2.5.0.args new file mode 100644 index 0000000000..d7d55ac611 --- /dev/null +++ b/tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-2.5.0.args @@ -0,0 +1,33 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-machine pc-i440fx-2.5,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +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 \ +-chardev socket,id=3Dcharparallel0,path=3D/tmp/parport0.socket,server,nowa= it \ +-device isa-parallel,chardev=3Dcharparallel0,id=3Dparallel0 \ +-chardev socket,id=3Dcharparallel1,path=3D/tmp/parport1.socket \ +-device isa-parallel,chardev=3Dcharparallel1,id=3Dparallel1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-latest.arg= s b/tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-latest.args new file mode 100644 index 0000000000..94841ea8c0 --- /dev/null +++ b/tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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 \ +-chardev socket,id=3Dcharparallel0,fd=3D1729,server,nowait \ +-device isa-parallel,chardev=3Dcharparallel0,id=3Dparallel0 \ +-chardev socket,id=3Dcharparallel1,path=3D/tmp/parport1.socket \ +-device isa-parallel,chardev=3Dcharparallel1,id=3Dparallel1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/parallel-unix-chardev.xml b/tests/qemux= ml2argvdata/parallel-unix-chardev.xml new file mode 100644 index 0000000000..d4fe94779e --- /dev/null +++ b/tests/qemuxml2argvdata/parallel-unix-chardev.xml @@ -0,0 +1,35 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + +
+ + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 13a1092e10..6203e45e6a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1463,6 +1463,8 @@ mymain(void) QEMU_CAPS_DEVICE_ISA_SERIAL); DO_TEST("parallel-tcp-chardev", NONE); DO_TEST("parallel-parport-chardev", NONE); + DO_TEST_CAPS_VER("parallel-unix-chardev", "2.5.0"); + DO_TEST_CAPS_LATEST("parallel-unix-chardev"); DO_TEST("console-compat-chardev", QEMU_CAPS_DEVICE_ISA_SERIAL); DO_TEST("pci-serial-dev-chardev", --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538681000859751.9753708223105; Thu, 4 Oct 2018 12:23:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39A7319C336; Thu, 4 Oct 2018 19:23:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4040438A; Thu, 4 Oct 2018 19:23:17 +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 7653E3FAD8; Thu, 4 Oct 2018 19:23:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMssd028034 for ; Thu, 4 Oct 2018 15:22:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id BAFE71347D; Thu, 4 Oct 2018 19:22:54 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 400A018EF3 for ; Thu, 4 Oct 2018 19:22:51 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:31 +0200 Message-Id: <03314b436606f66a95703550793225e401461ee1.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/15] tests: add channel-unix-guestfwd 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 04 Oct 2018 19:23:19 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Test guestfwd channels backed by UNIX sockets. Signed-off-by: J=C3=A1n Tomko --- .../channel-unix-guestfwd.x86_64-2.5.0.args | 33 +++++++++++++++++++ .../channel-unix-guestfwd.x86_64-latest.args | 36 ++++++++++++++++++= +++ tests/qemuxml2argvdata/channel-unix-guestfwd.xml | 37 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 2 ++ 4 files changed, 108 insertions(+) create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5= .0.args create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-lat= est.args create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.xml diff --git a/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args= b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args new file mode 100644 index 0000000000..f0e718e4a2 --- /dev/null +++ b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args @@ -0,0 +1,33 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-machine pc-i440fx-2.5,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +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 \ +-chardev socket,id=3Dcharchannel0,path=3D/tmp/guestfwd-listen.socket,serve= r,nowait \ +-netdev user,guestfwd=3Dtcp:10.0.2.1:4600-chardev:charchannel0,id=3Duser-c= hannel0 \ +-chardev socket,id=3Dcharchannel1,path=3D/tmp/guestfwd-connect.socket \ +-netdev user,guestfwd=3Dtcp:10.0.2.1:4601-chardev:charchannel1,id=3Duser-c= hannel1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.arg= s b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args new file mode 100644 index 0000000000..f9b9ee5fdb --- /dev/null +++ b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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 \ +-chardev socket,id=3Dcharchannel0,fd=3D1729,server,nowait \ +-netdev user,guestfwd=3Dtcp:10.0.2.1:4600-chardev:charchannel0,id=3Duser-c= hannel0 \ +-chardev socket,id=3Dcharchannel1,path=3D/tmp/guestfwd-connect.socket \ +-netdev user,guestfwd=3Dtcp:10.0.2.1:4601-chardev:charchannel1,id=3Duser-c= hannel1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/channel-unix-guestfwd.xml b/tests/qemux= ml2argvdata/channel-unix-guestfwd.xml new file mode 100644 index 0000000000..c9698a1259 --- /dev/null +++ b/tests/qemuxml2argvdata/channel-unix-guestfwd.xml @@ -0,0 +1,37 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + +
+ + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6203e45e6a..ca2bdac7ee 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1471,6 +1471,8 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_SERIAL); =20 DO_TEST("channel-guestfwd", NONE); + DO_TEST_CAPS_VER("channel-unix-guestfwd", "2.5.0"); + DO_TEST_CAPS_LATEST("channel-unix-guestfwd"); DO_TEST("channel-virtio", NONE); DO_TEST("channel-virtio-state", NONE); DO_TEST("channel-virtio-auto", NONE); --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538681005043655.3711027874135; Thu, 4 Oct 2018 12:23:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCB61300206A; Thu, 4 Oct 2018 19:23: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 62B0E71C86; Thu, 4 Oct 2018 19:23:22 +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 EE888180BAD4; Thu, 4 Oct 2018 19:23:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMtSM028039 for ; Thu, 4 Oct 2018 15:22:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 90346413A; Thu, 4 Oct 2018 19:22:55 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1546A1347D for ; Thu, 4 Oct 2018 19:22:54 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:32 +0200 Message-Id: <49de7101108c7a0d4a7c732d6e0aa27b70a94e23.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/15] tests: add console-virtio-unix 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 04 Oct 2018 19:23:23 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Test a virtio console backed by a UNIX socket. Signed-off-by: J=C3=A1n Tomko --- .../console-virtio-unix.x86_64-2.5.0.args | 34 ++++++++++++++++++= ++ .../console-virtio-unix.x86_64-latest.args | 37 ++++++++++++++++++= ++++ tests/qemuxml2argvdata/console-virtio-unix.xml | 33 +++++++++++++++++++ tests/qemuxml2argvtest.c | 2 ++ 4 files changed, 106 insertions(+) create mode 100644 tests/qemuxml2argvdata/console-virtio-unix.x86_64-2.5.0= .args create mode 100644 tests/qemuxml2argvdata/console-virtio-unix.x86_64-lates= t.args create mode 100644 tests/qemuxml2argvdata/console-virtio-unix.xml diff --git a/tests/qemuxml2argvdata/console-virtio-unix.x86_64-2.5.0.args b= /tests/qemuxml2argvdata/console-virtio-unix.x86_64-2.5.0.args new file mode 100644 index 0000000000..425bdc5d12 --- /dev/null +++ b/tests/qemuxml2argvdata/console-virtio-unix.x86_64-2.5.0.args @@ -0,0 +1,34 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-machine pc-i440fx-2.5,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +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 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x2 \ +-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 \ +-chardev socket,id=3Dcharconsole0,path=3D/tmp/listen.socket,server,nowait \ +-device virtconsole,chardev=3Dcharconsole0,id=3Dconsole0 \ +-chardev socket,id=3Dcharconsole1,path=3D/tmp/connect.socket \ +-device virtconsole,chardev=3Dcharconsole1,id=3Dconsole1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/console-virtio-unix.x86_64-latest.args = b/tests/qemuxml2argvdata/console-virtio-unix.x86_64-latest.args new file mode 100644 index 0000000000..193d4b1295 --- /dev/null +++ b/tests/qemuxml2argvdata/console-virtio-unix.x86_64-latest.args @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x2 \ +-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 \ +-chardev socket,id=3Dcharconsole0,fd=3D1729,server,nowait \ +-device virtconsole,chardev=3Dcharconsole0,id=3Dconsole0 \ +-chardev socket,id=3Dcharconsole1,path=3D/tmp/connect.socket \ +-device virtconsole,chardev=3Dcharconsole1,id=3Dconsole1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/console-virtio-unix.xml b/tests/qemuxml= 2argvdata/console-virtio-unix.xml new file mode 100644 index 0000000000..941e5a4a8a --- /dev/null +++ b/tests/qemuxml2argvdata/console-virtio-unix.xml @@ -0,0 +1,33 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + +
+ + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ca2bdac7ee..d8617557d8 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1486,6 +1486,8 @@ mymain(void) DO_TEST("console-virtio-ccw", QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST_CAPS_VER("console-virtio-unix", "2.5.0"); + DO_TEST_CAPS_LATEST("console-virtio-unix"); DO_TEST("console-sclp", QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_DEVICE_SCLPCONSOLE); --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538680983856788.6419339509455; Thu, 4 Oct 2018 12:23:03 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5B0DC0272EE; Thu, 4 Oct 2018 19:23:01 +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 9FC081057054; Thu, 4 Oct 2018 19:23:01 +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 53B98180B5B7; Thu, 4 Oct 2018 19:23:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMuko028044 for ; Thu, 4 Oct 2018 15:22:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 694F618AD9; Thu, 4 Oct 2018 19:22:56 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE70A18AC4 for ; Thu, 4 Oct 2018 19:22:55 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:33 +0200 Message-Id: <256dc010b7f95ee044a34a238a908b3663db1485.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/15] tests: add usb-redir-unix 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 04 Oct 2018 19:23:02 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Test USB redirdevs backed by UNIX sockets. Signed-off-by: J=C3=A1n Tomko --- .../usb-redir-unix.x86_64-2.5.0.args | 35 +++++++++++++++++ .../usb-redir-unix.x86_64-latest.args | 38 ++++++++++++++++++ tests/qemuxml2argvdata/usb-redir-unix.xml | 45 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 2 + 4 files changed, 120 insertions(+) create mode 100644 tests/qemuxml2argvdata/usb-redir-unix.x86_64-2.5.0.args create mode 100644 tests/qemuxml2argvdata/usb-redir-unix.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/usb-redir-unix.xml diff --git a/tests/qemuxml2argvdata/usb-redir-unix.x86_64-2.5.0.args b/test= s/qemuxml2argvdata/usb-redir-unix.x86_64-2.5.0.args new file mode 100644 index 0000000000..bc122db077 --- /dev/null +++ b/tests/qemuxml2argvdata/usb-redir-unix.x86_64-2.5.0.args @@ -0,0 +1,35 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-machine pc-i440fx-2.5,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device ich9-usb-ehci1,id=3Dusb,bus=3Dpci.0,addr=3D0x4.0x7 \ +-device ich9-usb-uhci1,masterbus=3Dusb.0,firstport=3D0,bus=3Dpci.0,multifu= nction=3Don,\ +addr=3D0x4 \ +-device ich9-usb-uhci2,masterbus=3Dusb.0,firstport=3D2,bus=3Dpci.0,addr=3D= 0x4.0x1 \ +-device ich9-usb-uhci3,masterbus=3Dusb.0,firstport=3D4,bus=3Dpci.0,addr=3D= 0x4.0x2 \ +-chardev socket,id=3Dcharredir0,path=3D/tmp/connect.socket \ +-device usb-redir,chardev=3Dcharredir0,id=3Dredir0,bus=3Dusb.0,port=3D1 \ +-chardev socket,id=3Dcharredir1,path=3D/tmp/listen.socket,server,nowait \ +-device usb-redir,chardev=3Dcharredir1,id=3Dredir1,bus=3Dusb.0,port=3D2 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/usb-redir-unix.x86_64-latest.args b/tes= ts/qemuxml2argvdata/usb-redir-unix.x86_64-latest.args new file mode 100644 index 0000000000..2d2dab1dea --- /dev/null +++ b/tests/qemuxml2argvdata/usb-redir-unix.x86_64-latest.args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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 ich9-usb-ehci1,id=3Dusb,bus=3Dpci.0,addr=3D0x4.0x7 \ +-device ich9-usb-uhci1,masterbus=3Dusb.0,firstport=3D0,bus=3Dpci.0,multifu= nction=3Don,\ +addr=3D0x4 \ +-device ich9-usb-uhci2,masterbus=3Dusb.0,firstport=3D2,bus=3Dpci.0,addr=3D= 0x4.0x1 \ +-device ich9-usb-uhci3,masterbus=3Dusb.0,firstport=3D4,bus=3Dpci.0,addr=3D= 0x4.0x2 \ +-chardev socket,id=3Dcharredir0,path=3D/tmp/connect.socket \ +-device usb-redir,chardev=3Dcharredir0,id=3Dredir0,bus=3Dusb.0,port=3D1 \ +-chardev socket,id=3Dcharredir1,fd=3D1729,server,nowait \ +-device usb-redir,chardev=3Dcharredir1,id=3Dredir1,bus=3Dusb.0,port=3D2 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/usb-redir-unix.xml b/tests/qemuxml2argv= data/usb-redir-unix.xml new file mode 100644 index 0000000000..471999c6bc --- /dev/null +++ b/tests/qemuxml2argvdata/usb-redir-unix.xml @@ -0,0 +1,45 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + +
+ + + +
+ + + +
+ + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d8617557d8..6919722188 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1577,6 +1577,8 @@ mymain(void) QEMU_CAPS_USB_REDIR, QEMU_CAPS_SPICE, QEMU_CAPS_USB_REDIR_FILTER); + DO_TEST_CAPS_VER("usb-redir-unix", "2.5.0"); + DO_TEST_CAPS_LATEST("usb-redir-unix"); DO_TEST("usb1-usb2", QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_USB_HUB, --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538680995351107.51802930721999; Thu, 4 Oct 2018 12:23:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF46840F14; Thu, 4 Oct 2018 19:23:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A72B308BDAB; Thu, 4 Oct 2018 19:23:12 +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 422724CAB0; Thu, 4 Oct 2018 19:23:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMvuP028057 for ; Thu, 4 Oct 2018 15:22:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B3FF60191; Thu, 4 Oct 2018 19:22:57 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B45BB6443C for ; Thu, 4 Oct 2018 19:22:56 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:34 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/15] tests: add virtio-rng-egd-unix 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 04 Oct 2018 19:23:13 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Test RNG devices connected to EGD via UNIX sockets. Signed-off-by: J=C3=A1n Tomko --- .../virtio-rng-egd-unix.x86_64-2.5.0.args | 30 ++++++++++++++++++= ++ .../virtio-rng-egd-unix.x86_64-latest.args | 33 ++++++++++++++++++= ++++ tests/qemuxml2argvdata/virtio-rng-egd-unix.xml | 29 +++++++++++++++++++ tests/qemuxml2argvtest.c | 2 ++ 4 files changed, 94 insertions(+) create mode 100644 tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-2.5.0= .args create mode 100644 tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-lates= t.args create mode 100644 tests/qemuxml2argvdata/virtio-rng-egd-unix.xml diff --git a/tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-2.5.0.args b= /tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-2.5.0.args new file mode 100644 index 0000000000..ce19aa0bdf --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-2.5.0.args @@ -0,0 +1,30 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-machine pc-i440fx-2.5,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +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 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-chardev socket,id=3Dcharrng0,path=3D/tmp/rng.socket,server,nowait \ +-object rng-egd,id=3Dobjrng0,chardev=3Dcharrng0 \ +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.0,addr=3D0x3 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-latest.args = b/tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-latest.args new file mode 100644 index 0000000000..2d5575aa53 --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-chardev socket,id=3Dcharrng0,fd=3D1729,server,nowait \ +-object rng-egd,id=3Dobjrng0,chardev=3Dcharrng0 \ +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/virtio-rng-egd-unix.xml b/tests/qemuxml= 2argvdata/virtio-rng-egd-unix.xml new file mode 100644 index 0000000000..ce959cbfe6 --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-rng-egd-unix.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6919722188..3d25e0a4ea 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2095,6 +2095,8 @@ mymain(void) DO_TEST("virtio-rng-egd", QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_EGD); + DO_TEST_CAPS_VER("virtio-rng-egd-unix", "2.5.0"); + DO_TEST_CAPS_LATEST("virtio-rng-egd-unix"); DO_TEST("virtio-rng-multiple", QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_EGD, --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538681009471840.0426338530933; Thu, 4 Oct 2018 12:23:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C42C8C07189A; Thu, 4 Oct 2018 19:23:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B5D171C85; Thu, 4 Oct 2018 19:23:27 +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 2788A3D3F4; Thu, 4 Oct 2018 19:23:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMwUH028064 for ; Thu, 4 Oct 2018 15:22:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 16C5F18EF8; Thu, 4 Oct 2018 19:22:58 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E07F60191 for ; Thu, 4 Oct 2018 19:22:57 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:35 +0200 Message-Id: <431e009eec754abb70d6cd0429995baf50e49088.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/15] tests: use real capabilities for net-vhostuser 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 04 Oct 2018 19:23:28 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Commit ed5aa85f371aebb0103e712f9a103d011ab9ae43 qemu: don't use chardev FD passing for vhostuser backend altered the legacy DO_TEST macro. Run the test against capabilities of QEMU 2.5.0 (which did not support QEMU_CAPS_CHARDEV_FD_PASS) as well as the latest version. Signed-off-by: J=C3=A1n Tomko --- .../net-vhostuser.x86_64-2.5.0.args | 39 ++++++++++++++++++= ++ .../net-vhostuser.x86_64-latest.args | 42 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 2 ++ 3 files changed, 83 insertions(+) create mode 100644 tests/qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args create mode 100644 tests/qemuxml2argvdata/net-vhostuser.x86_64-latest.args diff --git a/tests/qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args b/tests= /qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args new file mode 100644 index 0000000000..677a3c9e49 --- /dev/null +++ b/tests/qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args @@ -0,0 +1,39 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-machine pc-i440fx-2.5,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +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 \ +-chardev socket,id=3Dcharnet0,path=3D/tmp/vhost0.sock,server \ +-netdev vhost-user,chardev=3Dcharnet0,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:ee:96:6b= ,bus=3Dpci.0,\ +addr=3D0x2 \ +-chardev socket,id=3Dcharnet1,path=3D/tmp/vhost1.sock \ +-netdev vhost-user,chardev=3Dcharnet1,id=3Dhostnet1 \ +-device virtio-net-pci,netdev=3Dhostnet1,id=3Dnet1,mac=3D52:54:00:ee:96:6c= ,bus=3Dpci.0,\ +addr=3D0x3 \ +-netdev socket,listen=3D:2015,id=3Dhostnet2 \ +-device rtl8139,netdev=3Dhostnet2,id=3Dnet2,mac=3D52:54:00:95:db:c0,bus=3D= pci.0,\ +addr=3D0x4 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/net-vhostuser.x86_64-latest.args b/test= s/qemuxml2argvdata/net-vhostuser.x86_64-latest.args new file mode 100644 index 0000000000..7dee2bdf58 --- /dev/null +++ b/tests/qemuxml2argvdata/net-vhostuser.x86_64-latest.args @@ -0,0 +1,42 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +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-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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 \ +-chardev socket,id=3Dcharnet0,path=3D/tmp/vhost0.sock,server \ +-netdev vhost-user,chardev=3Dcharnet0,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:ee:96:6b= ,bus=3Dpci.0,\ +addr=3D0x2 \ +-chardev socket,id=3Dcharnet1,path=3D/tmp/vhost1.sock \ +-netdev vhost-user,chardev=3Dcharnet1,id=3Dhostnet1 \ +-device virtio-net-pci,netdev=3Dhostnet1,id=3Dnet1,mac=3D52:54:00:ee:96:6c= ,bus=3Dpci.0,\ +addr=3D0x3 \ +-netdev socket,listen=3D:2015,id=3Dhostnet2 \ +-device rtl8139,netdev=3Dhostnet2,id=3Dnet2,mac=3D52:54:00:95:db:c0,bus=3D= pci.0,\ +addr=3D0x4 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3d25e0a4ea..39a7f1f53c 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1359,6 +1359,8 @@ mymain(void) DO_TEST("misc-uuid", NONE); DO_TEST_PARSE_ERROR("vhost_queues-invalid", NONE); DO_TEST("net-vhostuser", QEMU_CAPS_CHARDEV_FD_PASS); + DO_TEST_CAPS_VER("net-vhostuser", "2.5.0"); + DO_TEST_CAPS_LATEST("net-vhostuser"); DO_TEST("net-vhostuser-multiq", QEMU_CAPS_VHOSTUSER_MULTIQUEUE); DO_TEST_FAILURE("net-vhostuser-multiq", NONE); --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538681013793856.0559613015178; Thu, 4 Oct 2018 12:23:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 29703307D864; Thu, 4 Oct 2018 19:23:32 +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 DCDA71710E; Thu, 4 Oct 2018 19:23:31 +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 8D30D180BAE1; Thu, 4 Oct 2018 19:23:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMwoF028070 for ; Thu, 4 Oct 2018 15:22:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id E62FA18EFD; Thu, 4 Oct 2018 19:22:58 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65EE560191 for ; Thu, 4 Oct 2018 19:22:58 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:36 +0200 Message-Id: <7b5f67bedb00fb13b1d6344e608f0224d4a3cbe4.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/15] qemuProcessPrepareDomain: pass xmlopt when creating monConfig 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 04 Oct 2018 19:23:32 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Pass the driver's xmlopt to allocate the chardev source private data correctly. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e9c76188a4..77b7464436 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5984,7 +5984,7 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver, goto cleanup; } =20 - if (!(priv->monConfig =3D virDomainChrSourceDefNew(NULL))) + if (!(priv->monConfig =3D virDomainChrSourceDefNew(driver->xmlopt))) goto cleanup; =20 VIR_DEBUG("Preparing monitor state"); --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538680995928120.37521561615449; Thu, 4 Oct 2018 12:23:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6D8B83F44; Thu, 4 Oct 2018 19:23:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A75317130; Thu, 4 Oct 2018 19:23:12 +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 4FC0E4A460; Thu, 4 Oct 2018 19:23:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JMxWS028080 for ; Thu, 4 Oct 2018 15:22:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id BBC2160191; Thu, 4 Oct 2018 19:22:59 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C5C418EFD for ; Thu, 4 Oct 2018 19:22:59 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:37 +0200 Message-Id: <201395895cf9f24dd05d9c1f764ec8d431fca021.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/15] qemu: add fd to qemuDomainChrSourcePrivate 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 04 Oct 2018 19:23:14 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Introduce a variable to store the file descriptor for possible fd passing. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 3 +++ src/qemu/qemu_domain.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f00f1b3fdb..70f82c9e81 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1180,6 +1180,8 @@ qemuDomainChrSourcePrivateNew(void) if (!(priv =3D virObjectNew(qemuDomainChrSourcePrivateClass))) return NULL; =20 + priv->fd =3D -1; + return (virObjectPtr) priv; } =20 @@ -1190,6 +1192,7 @@ qemuDomainChrSourcePrivateDispose(void *obj) qemuDomainChrSourcePrivatePtr priv =3D obj; =20 qemuDomainSecretInfoFree(&priv->secinfo); + VIR_FORCE_CLOSE(priv->fd); } =20 =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 80bd4bde91..827e2e44d7 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -466,6 +466,8 @@ struct _qemuDomainChrSourcePrivate { /* for char devices using secret * NB: *not* to be written to qemu domain object XML */ qemuDomainSecretInfoPtr secinfo; + + int fd; }; =20 =20 --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538681001004607.5485143922184; Thu, 4 Oct 2018 12:23:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1BB2A30832EE; Thu, 4 Oct 2018 19:23:19 +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 C447F71C48; Thu, 4 Oct 2018 19:23:18 +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 747C5180BAD1; Thu, 4 Oct 2018 19:23:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JN0CK028098 for ; Thu, 4 Oct 2018 15:23:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D92260191; Thu, 4 Oct 2018 19:23:00 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1129D18F00 for ; Thu, 4 Oct 2018 19:22:59 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:38 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/15] qemuBuildChrChardevStr: split attribute formatting 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 04 Oct 2018 19:23:19 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Remove repetition of the 'socket' device and its alias. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d77cf8c2d6..ef91fa7d27 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5195,6 +5195,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, break; =20 case VIR_DOMAIN_CHR_TYPE_UNIX: + virBufferAsprintf(&buf, "socket,id=3D%s", charAlias); if (dev->data.nix.listen && (flags & QEMU_BUILD_CHARDEV_UNIX_FD_PASS) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS)) { @@ -5208,11 +5209,11 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, if (fd < 0) goto cleanup; =20 - virBufferAsprintf(&buf, "socket,id=3D%s,fd=3D%d", charAlias, f= d); + virBufferAsprintf(&buf, ",fd=3D%d", fd); =20 virCommandPassFD(cmd, fd, VIR_COMMAND_PASS_FD_CLOSE_PARENT); } else { - virBufferAsprintf(&buf, "socket,id=3D%s,path=3D", charAlias); + virBufferAddLit(&buf, ",path=3D"); virQEMUBuildBufferEscapeComma(&buf, dev->data.nix.path); } if (dev->data.nix.listen) { --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153868099972076.70414154854473; Thu, 4 Oct 2018 12:23:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19ABF5F739; Thu, 4 Oct 2018 19:23:17 +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 C890477C1E; Thu, 4 Oct 2018 19:23:16 +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 7E830180B5B7; Thu, 4 Oct 2018 19:23:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JN1pJ028105 for ; Thu, 4 Oct 2018 15:23:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 632F160191; Thu, 4 Oct 2018 19:23:01 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCC1C18AD9 for ; Thu, 4 Oct 2018 19:23:00 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:39 +0200 Message-Id: <381331916e0becdc26aefde838137477a58fcd73.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/15] qemuBuildChrChardevStr: increase scope of qemuBuildChrChardevStr 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 04 Oct 2018 19:23:18 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Make it avaiable to other chardev types. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ef91fa7d27..25ea127095 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5067,6 +5067,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, virQEMUCapsPtr qemuCaps, unsigned int flags) { + qemuDomainChrSourcePrivatePtr chrSourcePriv =3D QEMU_DOMAIN_CHR_SOURCE= _PRIVATE(dev); virBuffer buf =3D VIR_BUFFER_INITIALIZER; bool telnet; char *charAlias =3D NULL; @@ -5160,8 +5161,6 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, qemuBuildChrChardevReconnectStr(&buf, &dev->data.tcp.reconnect); =20 if (dev->data.tcp.haveTLS =3D=3D VIR_TRISTATE_BOOL_YES) { - qemuDomainChrSourcePrivatePtr chrSourcePriv =3D - QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev); char *objalias =3D NULL; const char *tlsCertEncSecAlias =3D NULL; =20 --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538681020075456.2586932493649; Thu, 4 Oct 2018 12:23:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC8399B438; Thu, 4 Oct 2018 19:23:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF90577F02; Thu, 4 Oct 2018 19:23:36 +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 675DE3D381; Thu, 4 Oct 2018 19:23:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JN2Zr028110 for ; Thu, 4 Oct 2018 15:23:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E0D118EF3; Thu, 4 Oct 2018 19:23:02 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B545818AD9 for ; Thu, 4 Oct 2018 19:23:01 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:40 +0200 Message-Id: <25883c38335141bfe371a7e68042638a45dc4be0.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/15] qemuBuildChrChardevStr: pass fd from private data 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 04 Oct 2018 19:23:39 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 If present, prefer the file descriptor created earlier instead of creating one in a qemuBuild function. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 23 +++------ src/qemu/qemu_process.c | 127 ++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 133 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 25ea127095..54a1a299e2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5058,7 +5058,7 @@ enum { * host side of the character device */ static char * qemuBuildChrChardevStr(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, + virSecurityManagerPtr secManager ATTRIBUTE_UNUSED, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -5195,22 +5195,11 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, =20 case VIR_DOMAIN_CHR_TYPE_UNIX: virBufferAsprintf(&buf, "socket,id=3D%s", charAlias); - if (dev->data.nix.listen && - (flags & QEMU_BUILD_CHARDEV_UNIX_FD_PASS) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS)) { - if (qemuSecuritySetSocketLabel(secManager, (virDomainDefPtr)de= f) < 0) - goto cleanup; - int fd =3D qemuOpenChrChardevUNIXSocket(dev); - if (qemuSecurityClearSocketLabel(secManager, (virDomainDefPtr)= def) < 0) { - VIR_FORCE_CLOSE(fd); - goto cleanup; - } - if (fd < 0) - goto cleanup; - - virBufferAsprintf(&buf, ",fd=3D%d", fd); - - virCommandPassFD(cmd, fd, VIR_COMMAND_PASS_FD_CLOSE_PARENT); + if (chrSourcePriv && + chrSourcePriv->fd !=3D -1) { + virBufferAsprintf(&buf, ",fd=3D%d", chrSourcePriv->fd); + virCommandPassFD(cmd, chrSourcePriv->fd, VIR_COMMAND_PASS_FD_C= LOSE_PARENT); + chrSourcePriv->fd =3D -1; } else { virBufferAddLit(&buf, ",path=3D"); virQEMUBuildBufferEscapeComma(&buf, dev->data.nix.path); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 77b7464436..f315d28dd0 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6136,6 +6136,127 @@ qemuProcessOpenVhostVsock(virDomainVsockDefPtr vsoc= k) } =20 =20 +static int +qemuProcessMaybeOpenChrSource(virDomainObjPtr vm, + const virDomainChrSourceDef *src) +{ + qemuDomainChrSourcePrivatePtr srcPriv =3D QEMU_DOMAIN_CHR_SOURCE_PRIVA= TE(src); + qemuDomainObjPrivatePtr priv =3D vm->privateData; + virQEMUDriverPtr driver =3D priv->driver; + virQEMUCapsPtr qemuCaps =3D priv->qemuCaps; + int fd =3D -1; + int ret =3D -1; + + if (src->type !=3D VIR_DOMAIN_CHR_TYPE_UNIX) + return 0; + + if (!src->data.nix.listen) + return 0; + + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS)) + return 0; + + if (qemuSecuritySetSocketLabel(driver->securityManager, vm->def) < 0) + goto cleanup; + fd =3D qemuOpenChrChardevUNIXSocket(src); + if (qemuSecurityClearSocketLabel(driver->securityManager, vm->def) < 0) + goto cleanup; + + if (fd < 0) + goto cleanup; + + srcPriv->fd =3D fd; + fd =3D -1; + ret =3D 0; + + cleanup: + VIR_FORCE_CLOSE(fd); + return ret; +} + + +static int +qemuProcessPrepareChrFDs(virDomainObjPtr vm, + virDomainDefPtr def) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + int ret =3D -1; + size_t i; + + if (priv->monConfig) { + if (qemuProcessMaybeOpenChrSource(vm, priv->monConfig) < 0) + goto cleanup; + } + + /* VIR_DOMAIN_NET_TYPE_VHOSTUSER can be backed by a chardev + * but FD passing does not work, see commit ed5aa85f3 */ + + for (i =3D 0; i < def->nsmartcards; i++) { + virDomainSmartcardDefPtr smartcard =3D def->smartcards[i]; + if (smartcard->type !=3D VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH) + continue; + if (qemuProcessMaybeOpenChrSource(vm, smartcard->data.passthru) < = 0) + goto cleanup; + } + + /* Shmems can also have a chardev source, but the listen mode is + * set to false in the XML parser. Nothing to do here */ + + for (i =3D 0; i < def->nserials; i++) { + virDomainChrDefPtr serial =3D def->serials[i]; + if (qemuProcessMaybeOpenChrSource(vm, serial->source) < 0) + goto cleanup; + } + + for (i =3D 0; i < def->nparallels; i++) { + virDomainChrDefPtr parallel =3D def->parallels[i]; + if (qemuProcessMaybeOpenChrSource(vm, parallel->source) < 0) + goto cleanup; + } + + for (i =3D 0; i < def->nchannels; i++) { + virDomainChrDefPtr channel =3D def->channels[i]; + if (channel->targetType !=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GU= ESTFWD && + channel->targetType !=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VI= RTIO) + continue; + if (qemuProcessMaybeOpenChrSource(vm, channel->source) < 0) + goto cleanup; + } + + for (i =3D 0; i < def->nconsoles; i++) { + virDomainChrDefPtr console =3D def->consoles[i]; + if (console->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_= SERIAL) + continue; + if (qemuProcessMaybeOpenChrSource(vm, console->source) < 0) + goto cleanup; + } + + for (i =3D 0; i < def->nredirdevs; i++) { + virDomainRedirdevDefPtr redirdev =3D def->redirdevs[i]; + if (qemuProcessMaybeOpenChrSource(vm, redirdev->source) < 0) + goto cleanup; + } + + for (i =3D 0; i < def->nrngs; i++) { + virDomainRNGDefPtr rng =3D def->rngs[i]; + switch ((virDomainRNGBackend) rng->backend) { + case VIR_DOMAIN_RNG_BACKEND_RANDOM: + case VIR_DOMAIN_RNG_BACKEND_LAST: + /* no chardev backend is needed */ + return 0; + + case VIR_DOMAIN_RNG_BACKEND_EGD: + if (qemuProcessMaybeOpenChrSource(vm, rng->source.chardev) < 0) + goto cleanup; + } + } + + ret =3D 0; + cleanup: + return ret; +} + + /** * qemuProcessPrepareHost: * @driver: qemu driver @@ -6228,6 +6349,9 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver, qemuProcessMakeDir(driver, vm, priv->channelTargetDir) < 0) goto cleanup; =20 + if (qemuProcessPrepareChrFDs(vm, vm->def) < 0) + goto cleanup; + VIR_DEBUG("Write domain masterKey"); if (qemuDomainWriteMasterKeyFile(driver, vm) < 0) goto cleanup; @@ -6886,6 +7010,9 @@ qemuProcessCreatePretendCmd(virQEMUDriverPtr driver, if (qemuProcessPrepareDomain(driver, vm, flags) < 0) goto cleanup; =20 + if (qemuProcessPrepareChrFDs(vm, vm->def) < 0) + goto cleanup; + VIR_DEBUG("Building emulator command line"); cmd =3D qemuBuildCommandLine(driver, NULL, --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538681005971132.76894353945124; Thu, 4 Oct 2018 12:23:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DB7E2D0FC2; Thu, 4 Oct 2018 19:23:24 +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 CC8A21710E; Thu, 4 Oct 2018 19:23:23 +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 7C313180BAE2; Thu, 4 Oct 2018 19:23:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JN3Hr028118 for ; Thu, 4 Oct 2018 15:23:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1523918EF5; Thu, 4 Oct 2018 19:23:03 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DA4F60191 for ; Thu, 4 Oct 2018 19:23:02 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:41 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 13/15] qemu: remove QEMU_BUILD_CHARDEV_UNIX_FD_PASS 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 04 Oct 2018 19:23:24 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 This reverts the flag addition parts of: commit ed5aa85f371aebb0103e712f9a103d011ab9ae43 Now that we format the file descriptor only if one was opened earlier, the flag is unused. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 54a1a299e2..7719cdc032 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5051,7 +5051,6 @@ qemuOpenChrChardevUNIXSocket(const virDomainChrSource= Def *dev) enum { QEMU_BUILD_CHARDEV_TCP_NOWAIT =3D (1 << 0), QEMU_BUILD_CHARDEV_FILE_LOGD =3D (1 << 1), - QEMU_BUILD_CHARDEV_UNIX_FD_PASS =3D (1 << 2), }; =20 /* This function outputs a -chardev command line option which describes on= ly the @@ -5494,8 +5493,7 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManag= er, qemuDomainObjPrivatePtr priv) { char *chrdev; - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (priv->chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; =20 @@ -5630,8 +5628,7 @@ qemuBuildRNGBackendChrdevStr(virLogManagerPtr logMana= ger, char **chr, bool chardevStdioLogd) { - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; *chr =3D NULL; @@ -8708,8 +8705,7 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logMan= ager, virBuffer opt =3D VIR_BUFFER_INITIALIZER; const char *database; const char *contAlias =3D NULL; - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; =20 @@ -8945,8 +8941,7 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager, virBuffer buf =3D VIR_BUFFER_INITIALIZER; char *devstr =3D NULL; int rc; - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; =20 @@ -9117,8 +9112,7 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManage= r, { size_t i; bool havespice =3D false; - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; =20 @@ -9181,8 +9175,7 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logMan= ager, bool chardevStdioLogd) { size_t i; - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; =20 @@ -9219,8 +9212,7 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logMana= ger, bool chardevStdioLogd) { size_t i; - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; =20 @@ -9277,8 +9269,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManag= er, bool chardevStdioLogd) { size_t i; - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; =20 @@ -9451,8 +9442,7 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logMana= ger, bool chardevStdioLogd) { size_t i; - unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT | - QEMU_BUILD_CHARDEV_UNIX_FD_PASS; + unsigned int cdevflags =3D QEMU_BUILD_CHARDEV_TCP_NOWAIT; if (chardevStdioLogd) cdevflags |=3D QEMU_BUILD_CHARDEV_FILE_LOGD; =20 --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153868100518956.13670699942111; Thu, 4 Oct 2018 12:23:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5163732B669; Thu, 4 Oct 2018 19:23:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 134F91057056; Thu, 4 Oct 2018 19:23:23 +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 B2A893FA5C; Thu, 4 Oct 2018 19:23:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JN49K028135 for ; Thu, 4 Oct 2018 15:23:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 16CDB60191; Thu, 4 Oct 2018 19:23:04 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 657F918EFD for ; Thu, 4 Oct 2018 19:23:03 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:42 +0200 Message-Id: <22596372631e41a19625e47f95a95e21f12033cc.1538680720.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 14/15] qemuBuildCommandLine: do not pass security manager 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 04 Oct 2018 19:23:24 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Its purpose is to affect the host state, which qemuBuildCommandLine ideally should not do. Remove it now that it's no longer used. This reverts the remaining parts of: commit b0c6300fc42bbc3e5eb0b236392f7344581c5810 Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 80 ++++++++++++++++-----------------------------= ---- src/qemu/qemu_command.h | 1 - src/qemu/qemu_process.c | 2 -- 3 files changed, 26 insertions(+), 57 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7719cdc032..94bb5d184d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5057,7 +5057,6 @@ enum { * host side of the character device */ static char * qemuBuildChrChardevStr(virLogManagerPtr logManager, - virSecurityManagerPtr secManager ATTRIBUTE_UNUSED, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -5486,7 +5485,6 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd, =20 static int qemuBuildMonitorCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, virDomainDefPtr def, @@ -5500,8 +5498,7 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManag= er, if (!priv->monConfig) return 0; =20 - if (!(chrdev =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(chrdev =3D qemuBuildChrChardevStr(logManager, cmd, cfg, def, priv->monConfig, "monitor", priv->qemuCaps, cdevflags))) return -1; @@ -5619,7 +5616,6 @@ qemuBuildSclpDevStr(virDomainChrDefPtr dev) =20 static int qemuBuildRNGBackendChrdevStr(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -5640,8 +5636,7 @@ qemuBuildRNGBackendChrdevStr(virLogManagerPtr logMana= ger, return 0; =20 case VIR_DOMAIN_RNG_BACKEND_EGD: - if (!(*chr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(*chr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, def, rng->source.chardev, rng->info.alias, qemuCaps, cdevflags))) @@ -5764,7 +5759,6 @@ qemuBuildRNGDevStr(const virDomainDef *def, =20 static int qemuBuildRNGCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -5787,7 +5781,7 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager, } =20 /* possibly add character device for backend */ - if (qemuBuildRNGBackendChrdevStr(logManager, secManager, cmd, cfg,= def, + if (qemuBuildRNGBackendChrdevStr(logManager, cmd, cfg, def, rng, qemuCaps, &tmp, chardevStdioLogd) < 0) return -1; @@ -8204,7 +8198,6 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr c= fg, static int qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virDomainDefPtr def, virDomainNetDefPtr net, @@ -8226,8 +8219,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, =20 switch ((virDomainChrType)net->data.vhostuser->type) { case VIR_DOMAIN_CHR_TYPE_UNIX: - if (!(chardev =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(chardev =3D qemuBuildChrChardevStr(logManager, cmd, cfg, def, net->data.vhostuser, net->info.alias, qemuCaps, = 0))) goto cleanup; @@ -8294,7 +8286,6 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, static int qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virDomainDefPtr def, virDomainNetDefPtr net, @@ -8425,7 +8416,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, break; =20 case VIR_DOMAIN_NET_TYPE_VHOSTUSER: - ret =3D qemuBuildVhostuserCommandLine(driver, logManager, secManag= er, cmd, def, + ret =3D qemuBuildVhostuserCommandLine(driver, logManager, cmd, def, net, qemuCaps, bootindex); goto cleanup; break; @@ -8602,7 +8593,6 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, static int qemuBuildNetCommandLine(virQEMUDriverPtr driver, virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virDomainDefPtr def, virQEMUCapsPtr qemuCaps, @@ -8630,7 +8620,7 @@ qemuBuildNetCommandLine(virQEMUDriverPtr driver, for (i =3D 0; i < def->nnets; i++) { virDomainNetDefPtr net =3D def->nets[i]; =20 - if (qemuBuildInterfaceCommandLine(driver, logManager, secManag= er, cmd, def, net, + if (qemuBuildInterfaceCommandLine(driver, logManager, cmd, def= , net, qemuCaps, bootNet, vmop, standalone, nnicindexes, nicindexes) < 0) @@ -8692,7 +8682,6 @@ qemuBuildSmartcardFindCCIDController(const virDomainD= ef *def, =20 static int qemuBuildSmartcardCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -8769,8 +8758,7 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logMan= ager, return -1; } =20 - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, def, smartcard->data.passthru, smartcard->info.alias, qemuCaps, cdevflags))) { @@ -8929,7 +8917,6 @@ qemuBuildShmemBackendMemProps(virDomainShmemDefPtr sh= mem) =20 static int qemuBuildShmemCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, virDomainDefPtr def, @@ -9004,8 +8991,7 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager, VIR_FREE(devstr); =20 if (shmem->server.enabled) { - devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, def, &shmem->server.chr, shmem->info.alias, qemuCaps, cdevflags); @@ -9103,7 +9089,6 @@ qemuChrIsPlatformDevice(const virDomainDef *def, =20 static int qemuBuildSerialCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -9130,8 +9115,7 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManage= r, if (serial->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_SPICEPORT && != havespice) continue; =20 - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, def, serial->source, serial->info.alias, qemuCaps, cdevflags))) @@ -9167,7 +9151,6 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManage= r, =20 static int qemuBuildParallelsCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -9183,8 +9166,7 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logMan= ager, virDomainChrDefPtr parallel =3D def->parallels[i]; char *devstr; =20 - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, def, parallel->source, parallel->info.alias, qemuCaps, cdevflags))) @@ -9204,7 +9186,6 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logMan= ager, =20 static int qemuBuildChannelsCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -9222,8 +9203,7 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logMana= ger, =20 switch (channel->targetType) { case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD: - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, = def, channel->source, channel->info.alias, qemuCaps, cdevflags))) @@ -9239,8 +9219,7 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logMana= ger, break; =20 case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, = def, channel->source, channel->info.alias, qemuCaps, cdevflags))) @@ -9261,7 +9240,6 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logMana= ger, =20 static int qemuBuildConsoleCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -9286,8 +9264,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManag= er, return -1; } =20 - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, = def, console->source, console->info.alias, qemuCaps, cdevflags))) @@ -9307,8 +9284,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManag= er, return -1; } =20 - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, = def, console->source, console->info.alias, qemuCaps, cdevflags))) @@ -9322,8 +9298,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManag= er, break; =20 case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO: - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, = def, console->source, console->info.alias, qemuCaps, cdevflags))) @@ -9434,7 +9409,6 @@ qemuBuildRedirdevDevStr(const virDomainDef *def, =20 static int qemuBuildRedirdevCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virCommandPtr cmd, virQEMUDriverConfigPtr cfg, const virDomainDef *def, @@ -9450,8 +9424,7 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logMana= ger, virDomainRedirdevDefPtr redirdev =3D def->redirdevs[i]; char *devstr; =20 - if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, - cmd, cfg, def, + if (!(devstr =3D qemuBuildChrChardevStr(logManager, cmd, cfg, def, redirdev->source, redirdev->info.alias, qemuCaps, cdevflags))) { @@ -10178,7 +10151,6 @@ qemuBuildVsockCommandLine(virCommandPtr cmd, virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver, virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virDomainObjPtr vm, const char *migrateURI, virDomainSnapshotObjPtr snapshot, @@ -10287,7 +10259,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildSgaCommandLine(cmd, def, qemuCaps) < 0) goto error; =20 - if (qemuBuildMonitorCommandLine(logManager, secManager, cmd, cfg, def,= priv) < 0) + if (qemuBuildMonitorCommandLine(logManager, cmd, cfg, def, priv) < 0) goto error; =20 if (qemuBuildClockCommandLine(cmd, def, qemuCaps) < 0) @@ -10317,28 +10289,28 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildFSDevCommandLine(cmd, def, qemuCaps) < 0) goto error; =20 - if (qemuBuildNetCommandLine(driver, logManager, secManager, cmd, def, + if (qemuBuildNetCommandLine(driver, logManager, cmd, def, qemuCaps, vmop, standalone, nnicindexes, nicindexes, &bootHostdevNet) = < 0) goto error; =20 - if (qemuBuildSmartcardCommandLine(logManager, secManager, cmd, cfg, de= f, qemuCaps, + if (qemuBuildSmartcardCommandLine(logManager, cmd, cfg, def, qemuCaps, chardevStdioLogd) < 0) goto error; =20 - if (qemuBuildSerialCommandLine(logManager, secManager, cmd, cfg, def, = qemuCaps, + if (qemuBuildSerialCommandLine(logManager, cmd, cfg, def, qemuCaps, chardevStdioLogd) < 0) goto error; =20 - if (qemuBuildParallelsCommandLine(logManager, secManager, cmd, cfg, de= f, qemuCaps, + if (qemuBuildParallelsCommandLine(logManager, cmd, cfg, def, qemuCaps, chardevStdioLogd) < 0) goto error; =20 - if (qemuBuildChannelsCommandLine(logManager, secManager, cmd, cfg, def= , qemuCaps, + if (qemuBuildChannelsCommandLine(logManager, cmd, cfg, def, qemuCaps, chardevStdioLogd) < 0) goto error; =20 - if (qemuBuildConsoleCommandLine(logManager, secManager, cmd, cfg, def,= qemuCaps, + if (qemuBuildConsoleCommandLine(logManager, cmd, cfg, def, qemuCaps, chardevStdioLogd) < 0) goto error; =20 @@ -10360,7 +10332,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildWatchdogCommandLine(cmd, def, qemuCaps) < 0) goto error; =20 - if (qemuBuildRedirdevCommandLine(logManager, secManager, cmd, cfg, def= , qemuCaps, + if (qemuBuildRedirdevCommandLine(logManager, cmd, cfg, def, qemuCaps, chardevStdioLogd) < 0) goto error; =20 @@ -10373,7 +10345,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildMemballoonCommandLine(cmd, def, qemuCaps) < 0) goto error; =20 - if (qemuBuildRNGCommandLine(logManager, secManager, cmd, cfg, def, qem= uCaps, + if (qemuBuildRNGCommandLine(logManager, cmd, cfg, def, qemuCaps, chardevStdioLogd) < 0) goto error; =20 @@ -10408,7 +10380,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, goto error; =20 for (i =3D 0; i < def->nshmems; i++) { - if (qemuBuildShmemCommandLine(logManager, secManager, cmd, cfg, + if (qemuBuildShmemCommandLine(logManager, cmd, cfg, def, def->shmems[i], qemuCaps, chardevStdioLogd)) goto error; diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 98d4ac90b5..3f4a660e87 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -46,7 +46,6 @@ VIR_ENUM_DECL(qemuVideo) =20 virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver, virLogManagerPtr logManager, - virSecurityManagerPtr secManager, virDomainObjPtr vm, const char *migrateURI, virDomainSnapshotObjPtr snapshot, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f315d28dd0..9519178603 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6539,7 +6539,6 @@ qemuProcessLaunch(virConnectPtr conn, VIR_DEBUG("Building emulator command line"); if (!(cmd =3D qemuBuildCommandLine(driver, qemuDomainLogContextGetManager(logCtx= t), - driver->securityManager, vm, incoming ? incoming->launchURI : NULL, snapshot, vmop, @@ -7016,7 +7015,6 @@ qemuProcessCreatePretendCmd(virQEMUDriverPtr driver, VIR_DEBUG("Building emulator command line"); cmd =3D qemuBuildCommandLine(driver, NULL, - driver->securityManager, vm, migrateURI, NULL, --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 23:25:51 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538681026034493.6533893795329; Thu, 4 Oct 2018 12:23:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D7B080F7C; Thu, 4 Oct 2018 19:23:42 +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 A8F1218EF8; Thu, 4 Oct 2018 19:23:41 +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 57C9C18005B3; Thu, 4 Oct 2018 19:23:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w94JNAWq028156 for ; Thu, 4 Oct 2018 15:23:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id F389F18EFE; Thu, 4 Oct 2018 19:23:09 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 748E960191 for ; Thu, 4 Oct 2018 19:23:04 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Oct 2018 21:22:43 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 15/15] qemuOpenChrChardevUNIXSocket: move to qemu_process 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 04 Oct 2018 19:23:43 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Move it closer to its new user. Left exported because it needs to be mocked and it might be used for hotplug in the future. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 57 --------------------------------------------= -- src/qemu/qemu_command.h | 4 ---- src/qemu/qemu_process.c | 59 ++++++++++++++++++++++++++++++++++++++++++++= +++- src/qemu/qemu_process.h | 3 +++ tests/qemuxml2argvmock.c | 3 ++- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 94bb5d184d..0b2d8d29fa 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4991,63 +4991,6 @@ qemuBuildChrChardevReconnectStr(virBufferPtr buf, } =20 =20 -int -qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev) -{ - struct sockaddr_un addr; - socklen_t addrlen =3D sizeof(addr); - int fd; - - if ((fd =3D socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - virReportSystemError(errno, "%s", - _("Unable to create UNIX socket")); - goto error; - } - - memset(&addr, 0, sizeof(addr)); - addr.sun_family =3D AF_UNIX; - if (virStrcpyStatic(addr.sun_path, dev->data.nix.path) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("UNIX socket path '%s' too long"), - dev->data.nix.path); - goto error; - } - - if (unlink(dev->data.nix.path) < 0 && errno !=3D ENOENT) { - virReportSystemError(errno, - _("Unable to unlink %s"), - dev->data.nix.path); - goto error; - } - - if (bind(fd, (struct sockaddr *)&addr, addrlen) < 0) { - virReportSystemError(errno, - _("Unable to bind to UNIX socket path '%s'"), - dev->data.nix.path); - goto error; - } - - if (listen(fd, 1) < 0) { - virReportSystemError(errno, - _("Unable to listen to UNIX socket path '%s'"= ), - dev->data.nix.path); - goto error; - } - - /* We run QEMU with umask 0002. Compensate for the umask - * libvirtd might be running under to get the same permission - * QEMU would have. */ - if (virFileUpdatePerm(dev->data.nix.path, 0002, 0664) < 0) - goto error; - - return fd; - - error: - VIR_FORCE_CLOSE(fd); - return -1; -} - - enum { QEMU_BUILD_CHARDEV_TCP_NOWAIT =3D (1 << 0), QEMU_BUILD_CHARDEV_FILE_LOGD =3D (1 << 1), diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 3f4a660e87..96cfa563bb 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -72,10 +72,6 @@ int qemuBuildTLSx509BackendProps(const char *tlspath, virQEMUCapsPtr qemuCaps, virJSONValuePtr *propsret); =20 -/* Open a UNIX socket for chardev FD passing */ -int -qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev); - /* Generate '-device' string for chardev device */ int qemuBuildChrDeviceStr(char **deviceStr, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9519178603..ae1bac8ecb 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6136,6 +6136,63 @@ qemuProcessOpenVhostVsock(virDomainVsockDefPtr vsock) } =20 =20 +int +qemuProcessOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev) +{ + struct sockaddr_un addr; + socklen_t addrlen =3D sizeof(addr); + int fd; + + if ((fd =3D socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { + virReportSystemError(errno, "%s", + _("Unable to create UNIX socket")); + goto error; + } + + memset(&addr, 0, sizeof(addr)); + addr.sun_family =3D AF_UNIX; + if (virStrcpyStatic(addr.sun_path, dev->data.nix.path) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("UNIX socket path '%s' too long"), + dev->data.nix.path); + goto error; + } + + if (unlink(dev->data.nix.path) < 0 && errno !=3D ENOENT) { + virReportSystemError(errno, + _("Unable to unlink %s"), + dev->data.nix.path); + goto error; + } + + if (bind(fd, (struct sockaddr *)&addr, addrlen) < 0) { + virReportSystemError(errno, + _("Unable to bind to UNIX socket path '%s'"), + dev->data.nix.path); + goto error; + } + + if (listen(fd, 1) < 0) { + virReportSystemError(errno, + _("Unable to listen to UNIX socket path '%s'"= ), + dev->data.nix.path); + goto error; + } + + /* We run QEMU with umask 0002. Compensate for the umask + * libvirtd might be running under to get the same permission + * QEMU would have. */ + if (virFileUpdatePerm(dev->data.nix.path, 0002, 0664) < 0) + goto error; + + return fd; + + error: + VIR_FORCE_CLOSE(fd); + return -1; +} + + static int qemuProcessMaybeOpenChrSource(virDomainObjPtr vm, const virDomainChrSourceDef *src) @@ -6158,7 +6215,7 @@ qemuProcessMaybeOpenChrSource(virDomainObjPtr vm, =20 if (qemuSecuritySetSocketLabel(driver->securityManager, vm->def) < 0) goto cleanup; - fd =3D qemuOpenChrChardevUNIXSocket(src); + fd =3D qemuProcessOpenChrChardevUNIXSocket(src); if (qemuSecurityClearSocketLabel(driver->securityManager, vm->def) < 0) goto cleanup; =20 diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index c2f7c2b5d2..1135556a5a 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -116,6 +116,9 @@ int qemuProcessPrepareDomain(virQEMUDriverPtr driver, unsigned int flags); =20 int qemuProcessOpenVhostVsock(virDomainVsockDefPtr vsock); +/* Open a UNIX socket for chardev FD passing */ +int qemuProcessOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev); + =20 int qemuProcessPrepareHost(virQEMUDriverPtr driver, virDomainObjPtr vm, diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 79152d928e..dadf0f0a62 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -38,6 +38,7 @@ #include "virutil.h" #include "qemu/qemu_interface.h" #include "qemu/qemu_command.h" +#include "qemu/qemu_process.h" #include #include #include @@ -233,7 +234,7 @@ qemuInterfaceOpenVhostNet(virDomainDefPtr def ATTRIBUTE= _UNUSED, =20 =20 int -qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev ATTRIBUTE_UN= USED) +qemuProcessOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev ATTRI= BUTE_UNUSED) =20 { /* We need to return an FD number for a UNIX listener socket, --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list