From nobody Sun Oct 5 01:50:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1758825412; cv=none; d=zohomail.com; s=zohoarc; b=gqSfreYfeiqcsxeVSObk6AzzgPiaan24RxekXqjuHOPhh/0fKnSo2+vxV9szXDPLW/NIehb9Y0rwfNN5oRA5thPHX1V5jXvJB4UsYB/MA20b7GHz8oX44XN2v2Ww0OQXWLaPptUkyMUrw2VMNgXVIGOHx7U4898taytDpMAD2Mc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758825412; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=+RLbwSzlIglITemgNSU9JcKZOfyGs7B0I58nDbvjReU=; b=Wc2xdHhgzIGpK9rcJJYzFufM4kcC/tX9FYYciTST5QuhfQvSC6JoHpJX4evIxnJ0T3yji0d8nM1varirdBW9SnyPs8FLYytfOvIoteCIBq/cm1ufE14wjsjK5Zi59Rne/A6TSUsIuGqW4HBjRgM6cXJ85joQiqiGYM7Q0v6KLjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1758825412419853.5226434449739; Thu, 25 Sep 2025 11:36:52 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 81E744425B; Thu, 25 Sep 2025 14:36:51 -0400 (EDT) Received: from [172.19.199.14] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id A34EC442A7; Thu, 25 Sep 2025 14:09:01 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id EB63A43FF2; Thu, 25 Sep 2025 14:08:52 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 013C843F6D for ; Thu, 25 Sep 2025 14:07:43 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-300-LynPsyPyPXSoJ2VHrfzTQA-1; Thu, 25 Sep 2025 14:07:42 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 47086195608B for ; Thu, 25 Sep 2025 18:07:41 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.225.196]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 744CB300021A for ; Thu, 25 Sep 2025 18:07:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758823663; h=from:from: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; bh=+RLbwSzlIglITemgNSU9JcKZOfyGs7B0I58nDbvjReU=; b=WujJzy8Ph0nrEUUXIbwqwVN0NqO3dAnHcAQ/x25D0Pc7ZtMt9eAR8k1UbJtrQkk8vd/GWs gIdQ3HDOqQm/lEu+xK7wfCjzhQLQriEpDBHvXJXTfXh4sPA45OR46m3knuwYTr9pW+mq1a DkASH79ipzJ5JXg1kBEDgaeb//WujhA= X-MC-Unique: LynPsyPyPXSoJ2VHrfzTQA-1 X-Mimecast-MFC-AGG-ID: LynPsyPyPXSoJ2VHrfzTQA_1758823661 To: devel@lists.libvirt.org Subject: [PATCH v2 09/38] qemu: Check for pci-ohci availability Date: Thu, 25 Sep 2025 20:06:55 +0200 Message-ID: <20250925180724.500758-10-abologna@redhat.com> In-Reply-To: <20250925180724.500758-1-abologna@redhat.com> References: <20250925180724.500758-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: XLWScvOUyRL9U1cVNw60l738IKP4wHotfzsOXMgBc0s_1758823661 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4LZFKVETDBC7PNO6WYAU3VZNXQ5AGIXN X-Message-ID-Hash: 4LZFKVETDBC7PNO6WYAU3VZNXQ5AGIXN X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Andrea Bolognani via Devel Reply-To: Andrea Bolognani X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1758825413989116600 Content-Type: text/plain; charset="utf-8"; x-default="true" We assign the USB controller model without first checking whether the corresponding QEMU device is available, and that results in a late error instead of an early one. Be consistent with how we do things in all other cases and check the presence of the capability before attempting to set the model. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_postparse.c | 3 ++- ...ontroller-automatic-unavailable-realview.aarch64-latest.err | 2 +- ...ontroller-automatic-unavailable-realview.aarch64-latest.xml | 2 +- ...troller-automatic-unavailable-versatilepb.armv7l-latest.err | 2 +- ...troller-automatic-unavailable-versatilepb.armv7l-latest.xml | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 9c2427970d..5f59b79d56 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1299,7 +1299,8 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, if (STREQ(def->os.machine, "versatilepb") || STRPREFIX(def->os.machine, "realview")) { addDefaultUSB =3D true; - usbModel =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + usbModel =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; } =20 if (qemuDomainIsARMVirt(def)) diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-rea= lview.aarch64-latest.err b/tests/qemuxmlconfdata/usb-controller-automatic-u= navailable-realview.aarch64-latest.err index 918b72dbe9..cac4e8e760 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.a= arch64-latest.err +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.a= arch64-latest.err @@ -1 +1 @@ -unsupported configuration: USB controller model 'pci-ohci' not supported i= n this QEMU binary +internal error: Unable to determine model for USB controller idx=3D0 diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-rea= lview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-u= navailable-realview.aarch64-latest.xml index 372d5bda6a..dfa8ef8dbe 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.a= arch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-realview.a= arch64-latest.xml @@ -15,7 +15,7 @@ destroy /usr/bin/qemu-system-aarch64 - + diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-ver= satilepb.armv7l-latest.err b/tests/qemuxmlconfdata/usb-controller-automatic= -unavailable-versatilepb.armv7l-latest.err index 918b72dbe9..cac4e8e760 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilep= b.armv7l-latest.err +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilep= b.armv7l-latest.err @@ -1 +1 @@ -unsupported configuration: USB controller model 'pci-ohci' not supported i= n this QEMU binary +internal error: Unable to determine model for USB controller idx=3D0 diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-ver= satilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic= -unavailable-versatilepb.armv7l-latest.xml index 482029e3b0..93bf8dcd0a 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilep= b.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-versatilep= b.armv7l-latest.xml @@ -17,7 +17,7 @@ destroy /usr/bin/qemu-system-armv7l - +
--=20 2.51.0