From nobody Wed Jan 15 13:40:24 2025 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1707932120816338.46621671312505; Wed, 14 Feb 2024 09:35:20 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 818A11CA7; Wed, 14 Feb 2024 12:35:19 -0500 (EST) Received: from lists.libvirt.org.85.43.8.in-addr.arpa (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 7C4DA19F6; Wed, 14 Feb 2024 12:13:42 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id B69A81B22; Wed, 14 Feb 2024 12:11:44 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 2B61519EA for ; Wed, 14 Feb 2024 12:11:37 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-97-iGVg6iiCNWGoFAErT7pf3w-1; Wed, 14 Feb 2024 12:11:34 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ABE0A106CFE9 for ; Wed, 14 Feb 2024 17:11:33 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.45.226.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4298B10BC285 for ; Wed, 14 Feb 2024 17:11:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: iGVg6iiCNWGoFAErT7pf3w-1 From: Andrea Bolognani To: devel@lists.libvirt.org Subject: [PATCH v2 10/17] qemu: Only use legacy USB controller if actually needed Date: Wed, 14 Feb 2024 18:11:17 +0100 Message-ID: <20240214171124.508000-11-abologna@redhat.com> In-Reply-To: <20240214171124.508000-1-abologna@redhat.com> References: <20240214171124.508000-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: IDS42GZJ3B4OGQ3EIGOUH5QI35VEYB7B X-Message-ID-Hash: IDS42GZJ3B4OGQ3EIGOUH5QI35VEYB7B X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1707932121847100001 With the way the code is currently written, we can end up using the legacy USB controller (-usb) for a guest that doesn't have any USB controllers at all in its configuration. This is pretty harmless, since in these cases QEMU will ignore the request and not create any USB controller, but it's also incorrect and gets in the way of further changes that we want to make. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 1 + tests/qemuxmlconfdata/arm-vexpressa9-basic.aarch64-latest.args | 1 - tests/qemuxmlconfdata/arm-vexpressa9-nodevs.aarch64-latest.args | 1 - tests/qemuxmlconfdata/arm-vexpressa9-virtio.aarch64-latest.args | 1 - tests/qemuxmlconfdata/disk-arm-virtio-sd.aarch64-latest.args | 1 - tests/qemuxmlconfdata/sparc-minimal.sparc-latest.args | 1 - .../usb-controller-implicit-isapc.x86_64-latest.args | 1 - 7 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 2719574fb5..7824c31bde 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2962,6 +2962,7 @@ qemuBuildLegacyUSBControllerCommandLine(virCommand *c= md, } =20 if (nusb =3D=3D 0 && + nlegacy > 0 && !qemuBuildDomainForbidLegacyUSBController(def) && !ARCH_IS_S390(def->os.arch)) { /* We haven't added any USB controller yet, but we haven't been as= ked diff --git a/tests/qemuxmlconfdata/arm-vexpressa9-basic.aarch64-latest.args= b/tests/qemuxmlconfdata/arm-vexpressa9-basic.aarch64-latest.args index 1ffef8383e..72d10a732e 100644 --- a/tests/qemuxmlconfdata/arm-vexpressa9-basic.aarch64-latest.args +++ b/tests/qemuxmlconfdata/arm-vexpressa9-basic.aarch64-latest.args @@ -30,7 +30,6 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-armtest= /.config \ -initrd /arm.initrd \ -append 'console=3DttyAMA0,115200n8 rw root=3D/dev/mmcblk0p3 rootwait phys= map.enabled=3D0' \ -dtb /arm.dtb \ --usb \ -drive file=3D/arm.raw,format=3Draw,if=3Dsd,index=3D0 \ -netdev '{"type":"user","id":"hostnet0"}' \ -net nic,macaddr=3D52:54:00:09:a4:37,netdev=3Dhostnet0,model=3Dlan9118,id= =3Dnet0 \ diff --git a/tests/qemuxmlconfdata/arm-vexpressa9-nodevs.aarch64-latest.arg= s b/tests/qemuxmlconfdata/arm-vexpressa9-nodevs.aarch64-latest.args index 86c0d47849..de96ada570 100644 --- a/tests/qemuxmlconfdata/arm-vexpressa9-nodevs.aarch64-latest.args +++ b/tests/qemuxmlconfdata/arm-vexpressa9-nodevs.aarch64-latest.args @@ -30,7 +30,6 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-armtest= /.config \ -initrd /arm.initrd \ -append console=3DttyAMA0,115200n8 \ -dtb /arm.dtb \ --usb \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/arm-vexpressa9-virtio.aarch64-latest.arg= s b/tests/qemuxmlconfdata/arm-vexpressa9-virtio.aarch64-latest.args index 79b569aa38..b4c295be6b 100644 --- a/tests/qemuxmlconfdata/arm-vexpressa9-virtio.aarch64-latest.args +++ b/tests/qemuxmlconfdata/arm-vexpressa9-virtio.aarch64-latest.args @@ -31,7 +31,6 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-armtest= /.config \ -append 'console=3DttyAMA0,115200n8 rw root=3D/dev/vda3 rootwait physmap.e= nabled=3D0' \ -dtb /arm.dtb \ -device '{"driver":"virtio-serial-device","id":"virtio-serial0"}' \ --usb \ -blockdev '{"driver":"file","filename":"/arm.raw","node-name":"libvirt-1-s= torage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ","file":"libvirt-1-storage"}' \ -device '{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"vi= rtio-disk0","bootindex":1}' \ diff --git a/tests/qemuxmlconfdata/disk-arm-virtio-sd.aarch64-latest.args b= /tests/qemuxmlconfdata/disk-arm-virtio-sd.aarch64-latest.args index 2572b51f95..3328189b44 100644 --- a/tests/qemuxmlconfdata/disk-arm-virtio-sd.aarch64-latest.args +++ b/tests/qemuxmlconfdata/disk-arm-virtio-sd.aarch64-latest.args @@ -30,7 +30,6 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-armtest= /.config \ -initrd /arm.initrd \ -append 'console=3DttyAMA0,115200n8 rw root=3D/dev/vda3 rootwait physmap.e= nabled=3D0' \ -dtb /arm.dtb \ --usb \ -drive file=3D/arm-sd.qcow2,format=3Dqcow2,if=3Dsd,index=3D0 \ -drive file.driver=3Dnbd,file.server.type=3Dinet,file.server.host=3Dlocalh= ost,file.server.port=3D10809,file.export=3Dexport,format=3Dqcow2,if=3Dsd,in= dex=3D1 \ -drive file.driver=3Dgluster,file.volume=3DVolume3,file.path=3DImage.qcow2= ,file.server.0.type=3Dinet,file.server.0.host=3Dexample.org,file.server.0.p= ort=3D6000,file.server.1.type=3Dinet,file.server.1.host=3Dexample.org,file.= server.1.port=3D24007,file.server.2.type=3Dunix,file.server.2.path=3D/path/= to/sock,file.debug=3D4,format=3Dqcow2,if=3Dsd,index=3D2 \ diff --git a/tests/qemuxmlconfdata/sparc-minimal.sparc-latest.args b/tests/= qemuxmlconfdata/sparc-minimal.sparc-latest.args index 1cb520cf4a..b285efa615 100644 --- a/tests/qemuxmlconfdata/sparc-minimal.sparc-latest.args +++ b/tests/qemuxmlconfdata/sparc-minimal.sparc-latest.args @@ -24,7 +24,6 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-redhat6= 2sparc/.config \ -rtc base=3Dutc \ -no-shutdown \ -boot strict=3Don \ --usb \ -blockdev '{"driver":"file","filename":"/home/berrange/VirtualMachines/red= hat-6.2-sparc.img","node-name":"libvirt-2-storage","auto-read-only":true,"d= iscard":"unmap"}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"qco= w2","file":"libvirt-2-storage"}' \ -device scsi-hd,bus=3Dscsi.0,scsi-id=3D0,device_id=3Ddrive-scsi0-0-0-0,dri= ve=3Dlibvirt-2-format,id=3Dscsi0-0-0-0,bootindex=3D1 \ diff --git a/tests/qemuxmlconfdata/usb-controller-implicit-isapc.x86_64-lat= est.args b/tests/qemuxmlconfdata/usb-controller-implicit-isapc.x86_64-lates= t.args index 62dc26ee8b..cf8a176cd8 100644 --- a/tests/qemuxmlconfdata/usb-controller-implicit-isapc.x86_64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-implicit-isapc.x86_64-latest.args @@ -26,7 +26,6 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -rtc base=3Dutc \ -no-shutdown \ -boot strict=3Don \ --usb \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org