From nobody Sun May 5 20:14:53 2024 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 From nobody Sun May 5 20:14:53 2024 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 1642824690351696.6961882871851; 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-49-1kJLswb8Pk2AHuGM0dQbAg-1; Fri, 21 Jan 2022 23:11:25 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3DA131083F61; 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 79E024DC02; 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 536224BB7C; Sat, 22 Jan 2022 04:11:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20M4BClU013966 for ; Fri, 21 Jan 2022 23:11:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 79363C0808A; Sat, 22 Jan 2022 04:11:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74E92C08F3B for ; Sat, 22 Jan 2022 04:11:12 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 592D8837185 for ; Sat, 22 Jan 2022 04:11:12 +0000 (UTC) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-VDwFEH2qN72N_TU8fEhcwg-1; Fri, 21 Jan 2022 23:11:10 -0500 Received: by mail-pf1-f177.google.com with SMTP id h5so2233863pfv.13 for ; Fri, 21 Jan 2022 20:11:02 -0800 (PST) Received: from localhost.localdomain ([113.128.84.192]) by smtp.gmail.com with ESMTPSA id f12sm3846582pfe.204.2022.01.21.20.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 20:11:00 -0800 (PST) X-MC-Unique: 1kJLswb8Pk2AHuGM0dQbAg-1 X-MC-Unique: VDwFEH2qN72N_TU8fEhcwg-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=o+izReIDoXIq2sr7sHYKuegGLFrvypxHypYkQWyP0pI=; b=k3DRoOkPwjol327IP/mkEdsDVQnNxq/KnATAepLTHgEIuO3uju6cNVPEMhac7/TeCk lcvV+EloDRiF92LOo8+nMSphgVU7dbQxFF8K+27tvv4hLWrjNAaMMnk0t4n43K7Gx/eW vXrNmi6MTz4CyQuKav0weC8HNxBG/C760bFmREzNqRJirQT0tDwnmcrc62iR7F5mVM7U x3X4jWhlc/FkFsuuBk5Ruhs9Y7ZyNXUWE6pBaAoIVl/P3vPAaG0uaQLejYo+0gdY6ys2 ORIwkgs6AnnaGoJ3VP98K8KO2UBtP5QicwUMaqnj1CE1sH1u8m2r0TU8taWb1f3sSGXp 4NkQ== X-Gm-Message-State: AOAM531wrlfJgqCV5N8CvSWIN3r/Dt/REbbIPz42FKIYTY8T/07iWndG 6wUSgh4TC/EqVKd5VZNUAwVnja2NQKDUAnzl X-Google-Smtp-Source: ABdhPJyVgsEE8jSxhIZcT9Jd39dBnSZTMULtX/OoRIdM51i/KnLbs0LfHcxX3B47V2yfHHwPiZHcYw== X-Received: by 2002:a62:2f06:0:b0:4c7:43cc:2d51 with SMTP id v6-20020a622f06000000b004c743cc2d51mr6016500pfv.53.1642824661221; Fri, 21 Jan 2022 20:11:01 -0800 (PST) From: yshxxsjt715@gmail.com To: libvir-list@redhat.com Subject: [PATCH 2/2] Remove scsi parameter for vhost-user-blk for qemu 4.2 Date: Sat, 22 Jan 2022 12:10:35 +0800 Message-Id: <20220122041035.3550657-3-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.85 on 10.11.54.8 X-loop: libvir-list@redhat.com Cc: shenjiatong 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.15 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: 1642824691659100001 Content-Type: text/plain; charset="utf-8" From: shenjiatong When trying to attach vhost-user-blk device to virtual machine using libvirt 7.8 and qemu 4.2. Libvirt mistakenly add a scsi=3Doff parameter which is not supported by Qemu Signed-off-by: shenjiatong --- src/qemu/qemu_command.c | 6 +++++- .../qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 662d15e28e..cdf89fc74c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2253,11 +2253,15 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, "S:iothread", iothread, "T:ioeventfd", disk->ioeventfd, "T:event_idx", disk->event_idx, - "T:scsi", scsi, "p:num-queues", disk->queues, "p:queue-size", disk->queue_size, NULL) < 0) return NULL; + + if (virStorageSourceGetActualType(disk->src) !=3D VIR_STORAGE_TYPE= _VHOST_USER) { + if (virJSONValueObjectAdd(&props, "T:scsi", scsi, NULL) < 0) + return NULL; + } } break; =20 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 index 6c5d6de46b..4480266e75 100644 --- a/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args +++ b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args @@ -30,9 +30,9 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -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 \ +-device vhost-user-blk-pci,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 \ +-device vhost-user-blk-pci,iommu_platform=3Don,ats=3Don,packed=3Don,bus=3D= pci.0,addr=3D0x3,chardev=3Dchr-vu-virtio-disk1,id=3Dvirtio-disk1 \ -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 \ --=20 2.25.1