From nobody Sun Feb 8 19:21:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635867386; cv=none; d=zohomail.com; s=zohoarc; b=TwLoCzMw2fXp1a+0ccgqFMwsJTavtvylDDvutz45ZSWQ79u/lpk5W/ku7A1qK1/36uX5W3nrgKaZTy+A4baMtZZiX6fFlwWi3d15/idtpUKrTRnwwKUuNHXOvSV7xRlEhT0N0p0QFqz3cxAo8Ac1Y6mitjIVmTyG/MeLU3OpEDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635867386; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Z1f8K4/B+DzG/22b2412trGgUHiQT5tdhPZGD9v7LQk=; b=Mq1TuxSBzlQ0REn0OZVKL3vqzN3ZFTN9DQC8MaGavaaa2/H7PsuFaEPncOFlM5QaQ1b2yH/jyl9ByE911v3DC2xkzGx9aOpkuK4b9vARDmNy6RkNp5JU+NjBXdCGcCxYoqH5gsIH0SC0j5QEfwJiwf6cRZ5braCs0HQaNC5Ygx8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635867386186633.5768688397914; Tue, 2 Nov 2021 08:36:26 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-KwJ0tszbOq-70QG2umJY4w-1; Tue, 02 Nov 2021 11:36:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CD2B112A6A6; Tue, 2 Nov 2021 15:36: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 5566460BE5; Tue, 2 Nov 2021 15:36: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 784434EA2A; Tue, 2 Nov 2021 15:36:15 +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 1A2FSLZm030332 for ; Tue, 2 Nov 2021 11:28:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 25C171346F; Tue, 2 Nov 2021 15:28:21 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id A51B167843 for ; Tue, 2 Nov 2021 15:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635867385; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Z1f8K4/B+DzG/22b2412trGgUHiQT5tdhPZGD9v7LQk=; b=jOx68n97LatEpsjwT9WXl4zir2F/hsCH1nltNn7pZkB0/k+XboLv7hw41TLhaAJ6rtyzk3 Kv3o3qgJbQ7F1EUET19Zx7HBEvyUMlhvrnh2qOIkEq42cYhAKUe+luaWsuteGIRX8EF9DW ZpCzuYtSaDeUltmhUfK3xZhnYAbXZRA= X-MC-Unique: KwJ0tszbOq-70QG2umJY4w-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/7] tests: convert name-escape to use real caps Date: Tue, 2 Nov 2021 16:27:56 +0100 Message-Id: <68dd22417d833e4058bc064e9ab0b0a7b42f844d.1635866835.git.jtomko@redhat.com> 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 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635867388368100001 For later QEMUs than 2.11 we do FD passing for character devices. Use both the latest capabilities and 2.11 capabilities, to catch escaping of the chardev paths as well. Signed-off-by: J=C3=A1n Tomko --- ...pe.args =3D> name-escape.x86_64-2.11.0.args} | 7 +-- .../name-escape.x86_64-latest.args | 50 +++++++++++++++++++ tests/qemuxml2argvtest.c | 15 +----- 3 files changed, 56 insertions(+), 16 deletions(-) rename tests/qemuxml2argvdata/{name-escape.args =3D> name-escape.x86_64-2.= 11.0.args} (90%) create mode 100644 tests/qemuxml2argvdata/name-escape.x86_64-latest.args diff --git a/tests/qemuxml2argvdata/name-escape.args b/tests/qemuxml2argvda= ta/name-escape.x86_64-2.11.0.args similarity index 90% rename from tests/qemuxml2argvdata/name-escape.args rename to tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index eb8d9ac10a..71770dc546 100644 --- a/tests/qemuxml2argvdata/name-escape.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -11,7 +11,7 @@ QEMU_AUDIO_DRV=3Dspice \ -name guest=3Dfoo=3D1,,bar=3D2,debug-threads=3Don \ -S \ -object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-foo= =3D1,,bar=3D2/master-key.aes \ --machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-machine pc-i440fx-2.11,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ -m 214 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ @@ -24,11 +24,11 @@ QEMU_AUDIO_DRV=3Dspice \ -no-shutdown \ -no-acpi \ -boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.0,addr=3D0x3 \ --usb \ -device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,cache=3Dnone,throttling.bps-total=3D5000,throttling.iops-total=3D60= 00,throttling.bps-total-max=3D10000,throttling.iops-total-max=3D11000,throt= tling.group=3Dlibvirt_iotune_group1,,foo \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,write-cache=3Don \ -device ccid-card-emulated,backend=3Dcertificates,cert1=3Dcert1,,foo,cert2= =3Dcert2,cert3=3Dcert3,db=3D/etc/pki/nssdb,,foo,id=3Dsmartcard0,bus=3Dccid0= .0 \ -chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2,,foo \ -device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ @@ -42,4 +42,5 @@ QEMU_AUDIO_DRV=3Dspice \ -drive file.driver=3Discsi,file.portal=3Dexample.foo.org:3260,file.target= =3Diqn.1992-01.com.example:my,,storage,file.lun=3D1,file.transport=3Dtcp,if= =3Dnone,format=3Draw,id=3Ddrive-hostdev0 \ -device scsi-generic,drive=3Ddrive-hostdev0,id=3Dhostdev0,bus=3Dscsi0.0,ch= annel=3D0,scsi-id=3D0,lun=3D4 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args b/tests/= qemuxml2argvdata/name-escape.x86_64-latest.args new file mode 100644 index 0000000000..ceea515b17 --- /dev/null +++ b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args @@ -0,0 +1,50 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-foo=3D1,bar=3D2 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-foo=3D1,bar=3D2/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-foo=3D1,bar=3D2/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-foo=3D1,bar=3D2/.config \ +/usr/bin/qemu-system-i386 \ +-name guest=3Dfoo=3D1,,bar=3D2,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-foo=3D1,bar=3D2/master-key.aes"}' \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dp= c.ram \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x= 3"}' \ +-device '{"driver":"usb-ccid","id":"ccid0","bus":"usb.0","port":"1"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto= -read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ +-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ +-device '{"driver":"ccid-card-emulated","backend":"certificates","cert1":"= cert1,foo","cert2":"cert2","cert3":"cert3","db":"/etc/pki/nssdb,foo","id":"= smartcard0","bus":"ccid0.0"}' \ +-chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2,,foo \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-add-fd set=3D0,fd=3D5 \ +-chardev file,id=3Dcharserial1,path=3D/dev/fdset/0,append=3Don \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-chardev pipe,id=3Dcharchannel0,path=3D/tmp/guestfwd,,foo \ +-netdev user,guestfwd=3Dtcp:10.0.2.1:4600-chardev:charchannel0,id=3Dchanne= l0 \ +-audiodev id=3Daudio1,driver=3Dspice \ +-vnc vnc=3Dunix:/tmp/lib/domain--1-foo=3D1,,bar=3D2/vnc.sock,audiodev=3Dau= dio1 \ +-spice unix,addr=3D/tmp/lib/domain--1-foo=3D1,,bar=3D2/spice.sock,gl=3Don,= rendernode=3D/dev/dri/foo,,bar,seamless-migration=3Don \ +-device '{"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}'= \ +-blockdev '{"driver":"iscsi","portal":"example.foo.org:3260","target":"iqn= .1992-01.com.example:my,storage","lun":1,"transport":"tcp","node-name":"lib= virt-2-backend","read-only":false}' \ +-device '{"driver":"scsi-generic","drive":"libvirt-2-backend","id":"hostde= v0","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":4}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x4"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index dad5028380..804f01fb01 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3180,19 +3180,8 @@ mymain(void) ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE, ARG_END); =20 - DO_TEST("name-escape", - QEMU_CAPS_VNC, - QEMU_CAPS_DEVICE_CIRRUS_VGA, - QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX, - QEMU_CAPS_DEVICE_VIRTIO_GPU, - QEMU_CAPS_VIRTIO_GPU_VIRGL, - QEMU_CAPS_SPICE_GL, - QEMU_CAPS_SPICE_RENDERNODE, - QEMU_CAPS_DEVICE_ISA_SERIAL, - QEMU_CAPS_CHARDEV_FILE_APPEND, - QEMU_CAPS_CCID_EMULATED, - QEMU_CAPS_VIRTIO_SCSI); + DO_TEST_CAPS_VER("name-escape", "2.11.0"); + DO_TEST_CAPS_LATEST("name-escape"); =20 DO_TEST_NOCAPS("master-key"); DO_TEST("usb-long-port-path", --=20 2.31.1