From nobody Sat Feb 7 10:45:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1586178851; cv=none; d=zohomail.com; s=zohoarc; b=neUjfuS/IGkc1tYEpjteNTB+DtSX5BYh2YiMIk2ZXr4l/yrF0cjDTXUHdrxCCairNdi7wF6NWb/egMnDrXS981eerzmo9p5yvQOFxK1LCvNcIy+wUcNDeRjwsmgqt3pMrw6C3p7tgKsNbK2PVFUSKLprP7PDeMnmjI0TcJSeVJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586178851; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VF/6Qh7VrriX4DsGDzZTn90VgpCSsNZqUIZtWZTdF+w=; b=fpV5qPOcE4Jz4cE9OOSj7M0U94YwNdqV8uhcj6kUiAiICGBxI2hIcGM9RRpMstjsVo42YrB86fNrr5BMMVpeLjpG6qeCiBV/GuaDeFaNGxmgEz2+GQObq9AHHL8pATKR8mFeNz+ahgSfrS6efoXvD4KSzhryajkyLBR+rUUOmmw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 15861788513161016.4074181362793; Mon, 6 Apr 2020 06:14:11 -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-447-24M2kxaaPRam_Nmwmr3Ssg-1; Mon, 06 Apr 2020 09:14:06 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id C9FC0DBD0; Mon, 6 Apr 2020 13:14:00 +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 A53871195AD; Mon, 6 Apr 2020 13:14:00 +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 53D2B18089D7; Mon, 6 Apr 2020 13:14:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 036DDgK6015077 for ; Mon, 6 Apr 2020 09:13:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id D8783B17D1; Mon, 6 Apr 2020 13:13:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3999B17EC for ; Mon, 6 Apr 2020 13:13:42 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 80E04185A78E for ; Mon, 6 Apr 2020 13:13:42 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-389-y9L884VfMgiPy9BCSKY-Eg-1; Mon, 06 Apr 2020 09:13:40 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 036D3I8e141900 for ; Mon, 6 Apr 2020 09:13:40 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 3082cgw30j-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 09:13:39 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Apr 2020 14:13:35 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 6 Apr 2020 14:13:32 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 036DDXtt42402034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Apr 2020 13:13:33 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5F09111C050; Mon, 6 Apr 2020 13:13:33 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 40E4111C058; Mon, 6 Apr 2020 13:13:33 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 6 Apr 2020 13:13:33 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586178850; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=VF/6Qh7VrriX4DsGDzZTn90VgpCSsNZqUIZtWZTdF+w=; b=SxpYmvwk/QY5r3ZBddsxXlWlB3brqWnfTFXqt1UKmoPqDFOVL/7B6OPKp+F/nHBgc4qFo+ 5MzVmT5IMw1UMS9UZ9/GVYoNfHcQIYspaEBG4a8W5kHiNvh8KavZd/kIhZOeb4iA6vS1Zk XOhsjZFVbcxMq6BOsqnVOFivJ9YDKCc= X-MC-Unique: 24M2kxaaPRam_Nmwmr3Ssg-1 X-MC-Unique: y9L884VfMgiPy9BCSKY-Eg-1 From: Bjoern Walk To: libvir-list@redhat.com Subject: [PATCH v2 3/4] qemu: command: support for virtio packed option Date: Mon, 6 Apr 2020 15:13:26 +0200 In-Reply-To: <20200406131327.780751-1-bwalk@linux.ibm.com> References: <20200406131327.780751-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 20040613-0028-0000-0000-000003F314F3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20040613-0029-0000-0000-000024B8A902 Message-Id: <20200406131327.780751-4-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_07:2020-04-06, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 suspectscore=1 spamscore=0 clxscore=1015 mlxscore=0 bulkscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060109 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id 036D3I8e141900 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 036DDgK6015077 X-loop: libvir-list@redhat.com Cc: Bjoern Walk 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.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Pass the packed option on the QEMU command line of the capability for packed virtqueues is detected and the parameter is set explicitly. Reviewed-by: J=C3=A1n Tomko Reviewed-by: Boris Fiuczynski Signed-off-by: Bjoern Walk Reviewed-by: Marc Hartmayer --- src/qemu/qemu_command.c | 10 +++++++ tests/qemuxml2argvdata/virtio-options.args | 32 ++++++++++++---------- tests/qemuxml2argvdata/virtio-options.xml | 26 +++++++++--------- tests/qemuxml2argvtest.c | 3 +- tests/qemuxml2xmltest.c | 3 +- 5 files changed, 44 insertions(+), 30 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index df90f5ed..da9450fe 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -614,6 +614,16 @@ qemuBuildVirtioOptionsStr(virBufferPtr buf, virBufferAsprintf(buf, ",ats=3D%s", virTristateSwitchTypeToString(virtio->ats)); } + if (virtio->packed !=3D VIR_TRISTATE_SWITCH_ABSENT) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PACKED_QUEUES)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("the packed setting is not supported with thi= s " + "QEMU binary")); + return -1; + } + virBufferAsprintf(buf, ",packed=3D%s", + virTristateSwitchTypeToString(virtio->packed)); + } =20 return 0; } diff --git a/tests/qemuxml2argvdata/virtio-options.args b/tests/qemuxml2arg= vdata/virtio-options.args index 33ecd8f4..8253a788 100644 --- a/tests/qemuxml2argvdata/virtio-options.args +++ b/tests/qemuxml2argvdata/virtio-options.args @@ -24,36 +24,38 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -no-acpi \ --device virtio-scsi-pci,iommu_platform=3Don,ats=3Don,id=3Dscsi0,bus=3Dpci.= 0,addr=3D0x8 \ --device virtio-serial-pci,id=3Dvirtio-serial0,iommu_platform=3Don,ats=3Don= ,bus=3Dpci.0,\ -addr=3D0x9 \ +-device virtio-scsi-pci,iommu_platform=3Don,ats=3Don,packed=3Don,id=3Dscsi= 0,bus=3Dpci.0,\ +addr=3D0x8 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,iommu_platform=3Don,ats=3Don= ,packed=3Don,\ +bus=3Dpci.0,addr=3D0x9 \ -usb \ -drive file=3D/var/lib/libvirt/images/img1,format=3Draw,if=3Dnone,\ id=3Ddrive-virtio-disk0 \ --device virtio-blk-pci,iommu_platform=3Don,ats=3Don,bus=3Dpci.0,addr=3D0xa= ,\ +-device virtio-blk-pci,iommu_platform=3Don,ats=3Don,packed=3Don,bus=3Dpci.= 0,addr=3D0xa,\ drive=3Ddrive-virtio-disk0,id=3Dvirtio-disk0,bootindex=3D1 \ -fsdev local,security_model=3Dpassthrough,id=3Dfsdev-fs0,path=3D/export/fs= 1 \ -device virtio-9p-pci,id=3Dfs0,fsdev=3Dfsdev-fs0,mount_tag=3Dfs1,iommu_pla= tform=3Don,\ -ats=3Don,bus=3Dpci.0,addr=3D0x3 \ +ats=3Don,packed=3Don,bus=3Dpci.0,addr=3D0x3 \ -fsdev local,security_model=3Dmapped,writeout=3Dimmediate,id=3Dfsdev-fs1,\ path=3D/export/fs2 \ -device virtio-9p-pci,id=3Dfs1,fsdev=3Dfsdev-fs1,mount_tag=3Dfs2,iommu_pla= tform=3Don,\ -ats=3Don,bus=3Dpci.0,addr=3D0x4 \ +ats=3Don,packed=3Don,bus=3Dpci.0,addr=3D0x4 \ -netdev user,id=3Dhostnet0 \ -device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:56:58:5a:5c= ,bus=3Dpci.0,\ -addr=3D0x6,iommu_platform=3Don,ats=3Don \ --device virtio-mouse-pci,id=3Dinput0,bus=3Dpci.0,addr=3D0xe,iommu_platform= =3Don,ats=3Don \ +addr=3D0x6,iommu_platform=3Don,ats=3Don,packed=3Don \ +-device virtio-mouse-pci,id=3Dinput0,bus=3Dpci.0,addr=3D0xe,iommu_platform= =3Don,ats=3Don,\ +packed=3Don \ -device virtio-keyboard-pci,id=3Dinput1,bus=3Dpci.0,addr=3D0x10,iommu_plat= form=3Don,\ -ats=3Don \ +ats=3Don,packed=3Don \ -device virtio-tablet-pci,id=3Dinput2,bus=3Dpci.0,addr=3D0x11,iommu_platfo= rm=3Don,\ -ats=3Don \ +ats=3Don,packed=3Don \ -device virtio-input-host-pci,id=3Dinput3,evdev=3D/dev/input/event1234,bus= =3Dpci.0,\ -addr=3D0x12,iommu_platform=3Don,ats=3Don \ +addr=3D0x12,iommu_platform=3Don,ats=3Don,packed=3Don \ -chardev socket,id=3Dchr-vu-video0,fd=3D1729 \ -device vhost-user-gpu-pci,id=3Dvideo0,max_outputs=3D1,chardev=3Dchr-vu-vi= deo0,\ -bus=3Dpci.0,addr=3D0x2,iommu_platform=3Don,ats=3Don \ +bus=3Dpci.0,addr=3D0x2,iommu_platform=3Don,ats=3Don,packed=3Don \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0xc,iommu_plat= form=3Don,\ -ats=3Don \ +ats=3Don,packed=3Don \ -object rng-random,id=3Dobjrng0,filename=3D/dev/random \ --device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,iommu_platform=3Don,ats=3Do= n,bus=3Dpci.0,\ -addr=3D0xd +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,iommu_platform=3Don,ats=3Do= n,packed=3Don,\ +bus=3Dpci.0,addr=3D0xd diff --git a/tests/qemuxml2argvdata/virtio-options.xml b/tests/qemuxml2argv= data/virtio-options.xml index dd9a4f4a..3ca27840 100644 --- a/tests/qemuxml2argvdata/virtio-options.xml +++ b/tests/qemuxml2argvdata/virtio-options.xml @@ -15,7 +15,7 @@ /usr/bin/qemu-system-x86_64 - +
@@ -27,22 +27,22 @@
- +
- +
- +
- +
@@ -50,30 +50,30 @@ - +
- +
- +
- +
- +
- + /dev/random - +
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index fdeb3c2e..405227fd 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2989,7 +2989,8 @@ mymain(void) QEMU_CAPS_OBJECT_RNG_RANDOM, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, - QEMU_CAPS_VIRTIO_PCI_ATS); + QEMU_CAPS_VIRTIO_PCI_ATS, + QEMU_CAPS_VIRTIO_PACKED_QUEUES); =20 DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_KVM); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index b4c83fcc..756d4e2c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1291,7 +1291,8 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, QEMU_CAPS_VIRTIO_PCI_ATS, - QEMU_CAPS_DEVICE_VHOST_USER_GPU); + QEMU_CAPS_DEVICE_VHOST_USER_GPU, + QEMU_CAPS_VIRTIO_PACKED_QUEUES); =20 DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_KVM); --=20 2.24.1