From nobody Sun Feb 8 04:23:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16428246903109.009267340442193; Fri, 21 Jan 2022 20:11:30 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-387-ShEeIkg8N06NQGO17l82Mw-1; Fri, 21 Jan 2022 23:11:25 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D17D2F26; Sat, 22 Jan 2022 04:11:20 +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 3EABCE726; Sat, 22 Jan 2022 04:11:19 +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 676114CA9B; Sat, 22 Jan 2022 04:11:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20M4BEKI013982 for ; Fri, 21 Jan 2022 23:11:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id B21712166B41; Sat, 22 Jan 2022 04:11:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD4962166B2D for ; Sat, 22 Jan 2022 04:11:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 994BB38035B2 for ; Sat, 22 Jan 2022 04:11:11 +0000 (UTC) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-kkhOrWGQM3mJOH8OJnQ9YQ-1; Fri, 21 Jan 2022 23:11:09 -0500 Received: by mail-pl1-f169.google.com with SMTP id n11so10508103plf.4; Fri, 21 Jan 2022 20:10:59 -0800 (PST) Received: from localhost.localdomain ([113.128.84.192]) by smtp.gmail.com with ESMTPSA id f12sm3846582pfe.204.2022.01.21.20.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 20:10:57 -0800 (PST) X-MC-Unique: ShEeIkg8N06NQGO17l82Mw-1 X-MC-Unique: kkhOrWGQM3mJOH8OJnQ9YQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=65OvVBszKWIaiZr2tb4xX13t6a6Xi7cVc7UPdiheQqw=; b=a8bLwlll08aZMHGo8uPc5lxq1IzFWEXeTg0PHcQ5Cskyz3XUSSx9V8MLVvZ1vUBj2a u6Ee9Zf/XdNYyMPuPkKZTI8K8MbZgqCIM9+S+rJhFsic9mXpeOvaguGTkgykIQbpzkkX fOK7pyZq33yjTYymJTXeOezMD9K2Aqhmsc8clIOV0Ik85XRb1trjJCzV6BK2rdGm1pEV fHsuK5RZk+m/gZ+AOIDPE/SRrKrbpMVe/fcZ+bl8NCb/2AXDHzFZbwcEbU6u8w6tIwzw Klo3sxWOtJYXAR3iGK2ugT7o/cCqWAVWUIPBcC/trTgZTRylkZzPESryGdh912/loIXz H10g== X-Gm-Message-State: AOAM530p30AldqqWHEh1d/J53xTihBcsA4BkA8fMV/+aPcnrw4BbuvGO hjw5f4IYvJK0SrPJ8LLdcaOKwW5C53GJ9Qt1 X-Google-Smtp-Source: ABdhPJwJz4DOCPfUIj2fI/jgObwrgfFWvb1YmwvhI+r6o5iv+AVYppacvgfj7P2whw8R12WGFg6yGA== X-Received: by 2002:a17:902:b598:b0:14a:ca21:9737 with SMTP id a24-20020a170902b59800b0014aca219737mr6603483pls.73.1642824658009; Fri, 21 Jan 2022 20:10:58 -0800 (PST) From: yshxxsjt715@gmail.com To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuxml2argvtest: disk-vhostuser: Add invocation for qemu-4.2 Date: Sat, 22 Jan 2022 12:10:34 +0800 Message-Id: <20220122041035.3550657-2-yshxxsjt715@gmail.com> In-Reply-To: <20220122041035.3550657-1-yshxxsjt715@gmail.com> References: <20220122041035.3550657-1-yshxxsjt715@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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.84 on 10.5.11.23 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-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1642824691894100003 Content-Type: text/plain; charset="utf-8" From: Peter Krempa With qemu versions prior to qemu-5.0 we'll format 'scsi=3Doff' for virtio-blk disks, but also for vhost-user-blk. This is a bug as it's not supported. Add a test case to show that wrong configuration is generated by adding running 'disk-vhostuser' test case on capabilities from qemu-4.2. For this to be possible it's required to enable shared memory via NUMA configuration as old QEMU's don't allow configuration of the default memory backend. This is achieved by adding a copy of the 'disk-vhostuser' XML with NUMA enabled. Signed-off-by: Peter Krempa --- .../disk-vhostuser-numa.x86_64-4.2.0.args | 39 +++++++++++++++++++ .../disk-vhostuser-numa.x86_64-latest.args | 39 +++++++++++++++++++ .../qemuxml2argvdata/disk-vhostuser-numa.xml | 32 +++++++++++++++ tests/qemuxml2argvtest.c | 2 + 4 files changed, 112 insertions(+) create mode 100644 tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0= .args create mode 100644 tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-lates= t.args create mode 100644 tests/qemuxml2argvdata/disk-vhostuser-numa.xml diff --git a/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args b= /tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args new file mode 100644 index 0000000000..6c5d6de46b --- /dev/null +++ b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args @@ -0,0 +1,39 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/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-QEMU= Guest1/master-key.aes \ +-machine pc-i440fx-4.2,usb=3Doff,dump-guest-core=3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m 14336 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-object memory-backend-file,id=3Dram-node0,mem-path=3D/var/lib/libvirt/qem= u/ram/-1-QEMUGuest1/ram-node0,share=3Don,size=3D15032385536 \ +-numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-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 piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-chardev socket,id=3Dchr-vu-virtio-disk0,path=3D/tmp/vhost1.sock \ +-device vhost-user-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,chardev=3Dchr= -vu-virtio-disk0,id=3Dvirtio-disk0,bootindex=3D1 \ +-chardev socket,id=3Dchr-vu-virtio-disk1,path=3D/tmp/vhost1.sock,reconnect= =3D10 \ +-device vhost-user-blk-pci,iommu_platform=3Don,ats=3Don,packed=3Don,scsi= =3Doff,bus=3Dpci.0,addr=3D0x3,chardev=3Dchr-vu-virtio-disk1,id=3Dvirtio-dis= k1 \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-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/disk-vhostuser-numa.x86_64-latest.args = b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-latest.args new file mode 100644 index 0000000000..75b3232dad --- /dev/null +++ b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-latest.args @@ -0,0 +1,39 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m 14336 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/v= ar/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node0","share":true,"size":150323= 85536}' \ +-numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-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"}' \ +-chardev socket,id=3Dchr-vu-virtio-disk0,path=3D/tmp/vhost1.sock \ +-device '{"driver":"vhost-user-blk-pci","bus":"pci.0","addr":"0x2","charde= v":"chr-vu-virtio-disk0","id":"virtio-disk0","bootindex":1}' \ +-chardev socket,id=3Dchr-vu-virtio-disk1,path=3D/tmp/vhost1.sock,reconnect= =3D10 \ +-device '{"driver":"vhost-user-blk-pci","iommu_platform":true,"ats":true,"= packed":true,"bus":"pci.0","addr":"0x3","chardev":"chr-vu-virtio-disk1","id= ":"virtio-disk1"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-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/qemuxml2argvdata/disk-vhostuser-numa.xml b/tests/qemuxml= 2argvdata/disk-vhostuser-numa.xml new file mode 100644 index 0000000000..49efbae0a2 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-vhostuser-numa.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + qemu64 + + + + + + hvm + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 9d2de2a569..afb1cb76e0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1442,6 +1442,8 @@ mymain(void) VIR_FREE(driver.config->vxhsTLSx509certdir); DO_TEST_CAPS_LATEST("disk-no-boot"); DO_TEST_CAPS_LATEST("disk-nvme"); + DO_TEST_CAPS_VER("disk-vhostuser-numa", "4.2.0"); + DO_TEST_CAPS_LATEST("disk-vhostuser-numa"); DO_TEST_CAPS_LATEST("disk-vhostuser"); DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-device-lun-type-invalid"); DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-attaching-partition-nosupport"); --=20 2.25.1