From nobody Sun Oct 5 01:49:58 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=1758826585; cv=none; d=zohomail.com; s=zohoarc; b=d9abZAytqp8j73BK55GvCuP4P4BUFKFd+lQ15SreEwXcFLfSqLvmhpE63RnMg91/4jr1n1IUUxSUhiYoLkKUzLnKztO8erAFbC1o5sAVF5PgfcWwVDn/PKMiCSc9CQ1/1hvzXNfeIa/Gj3G8kG4CPkWzm7x7hRyYjbluKo66d1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758826585; 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=UvH9JUS2hzQdYL7TCcfnHGJ0oASPZiKrvXrOWR56C68=; b=eIxBRn8a7O6ZcXg98cr9gNv8nLITA0bL53tFz/8PoWuw2We0L1sPYvg5toitAepxQky/JLOamN+s5Hzzt5ntJOUFFMJ+pX6diJD3+OqWjMmmwHfKVL2rp95gJs5OqMKr0I/EGzrtLYkEMLDT0Jrq8ufnbb6Fz0oSw8RXNpBz7xU= 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 1758826585405972.3126124591367; Thu, 25 Sep 2025 11:56:25 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 5295F44058; Thu, 25 Sep 2025 14:56:24 -0400 (EDT) Received: from [172.19.199.14] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id AFD9244654; Thu, 25 Sep 2025 14:20:25 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id C8B1741829; Thu, 25 Sep 2025 14:15:26 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 A6574440EE for ; Thu, 25 Sep 2025 14:07:58 -0400 (EDT) Received: from mx-prod-mc-04.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-245-JOiXXlAsN2Kj79xG1JGiEw-1; Thu, 25 Sep 2025 14:07:56 -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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CFCB019560AF for ; Thu, 25 Sep 2025 18:07:55 +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 08F0C30002D1 for ; Thu, 25 Sep 2025 18:07:54 +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=1758823678; 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=UvH9JUS2hzQdYL7TCcfnHGJ0oASPZiKrvXrOWR56C68=; b=Vc+8qz3LzlH/7E8JjUZUZoClMW4zGMC/nF4S+NytMgd6EqAXj5upJyL8hddOcdW+2lBX3L tXhsqkZj4PZNx2RPf975tiisQk964JAtmmfYIZ3+F0J2bJFZUumj3ZYV8+k9VQZCaSe/kq xXrAWgmslZ9RFBEz+gjNsH1WR19iSHA= X-MC-Unique: JOiXXlAsN2Kj79xG1JGiEw-1 X-Mimecast-MFC-AGG-ID: JOiXXlAsN2Kj79xG1JGiEw_1758823675 To: devel@lists.libvirt.org Subject: [PATCH v2 20/38] qemu: Always default to no USB controller on s390x Date: Thu, 25 Sep 2025 20:07:06 +0200 Message-ID: <20250925180724.500758-21-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: NjpmpGOMXp6rQBaQyRAFe7_A0R9e6zYMqkUIvwhVKHw_1758823675 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ALQBSP6BWLYOSTTIQOL4G44D5NHW3HIN X-Message-ID-Hash: ALQBSP6BWLYOSTTIQOL4G44D5NHW3HIN 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: 1758826586519116600 Content-Type: text/plain; charset="utf-8"; x-default="true" When support for s390x was introduced in libvirt, it naturally followed the conventions established at the time for x86, which were to have a USB controller added by default. Later, in 2013, commit 3a82f628a964 made the default USB controller model for s390x VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE, effectively overriding the architecture-independent default. However, an exception was carved out at the time: if the USB controller had an address assigned to it, then it would be left alone. A couple of years later, commit 09ab9dcc85ec changed things again in two ways: for starters, libvirt would no longer automatically attempt to add a USB controller to newly-defined s390x guests; moreover, the command line generator was changed so that the legacy USB controller (-usb) would never be used on s390x. In other words, unless a model name is explicitly provided for the USB controller, which is something that only actually works when using a recent QEMU version (see commit f9ed4d385ab8), s390x guests will never have USB controllers attached to them. Remove the exception carved out a decade ago and always reflect this fact accurately in the guest XML. Signed-off-by: Andrea Bolognani Reviewed-by: Thomas Huth Reviewed-by: Boris Fiuczynski Reviewed-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_postparse.c | 15 ++++++++++----- .../qemuhotplug-base-ccw-live+ccw-virtio.xml | 5 +---- ...ive-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 5 +---- ...emuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 5 +---- ...live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 5 +---- ...base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 5 +---- .../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 5 +---- .../qemuhotplug-base-ccw-live.xml | 5 +---- .../s390-usb-address.s390x-latest.xml | 6 +----- 9 files changed, 18 insertions(+), 38 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index cf08e6e07c..dd2e4cb9c7 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -380,11 +380,9 @@ qemuDomainControllerDefPostParse(virDomainControllerDe= f *cont, cont->model =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; =20 if (ARCH_IS_S390(def->os.arch)) { - if (cont->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_= NONE) { - /* set the default USB model to none for s390 unless an - * address is found */ - cont->model =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; - } + /* No default model on s390x, one has to be provided + * explicitly by the user */ + cont->model =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; } else if (ARCH_IS_PPC64(def->os.arch)) { /* To not break migration we need to set default USB contr= oller * for ppc64 to pci-ohci if we cannot change ABI of the VM. @@ -412,6 +410,13 @@ qemuDomainControllerDefPostParse(virDomainControllerDe= f *cont, cont->model =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_X= HCI; } } + + /* Make sure the 'none' USB controller doesn't have an address + * associated with it, as that would trip up later checks and + * it doesn't make sense anyway */ + if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) + cont->info.type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; + /* forbid usb model 'qusb1' and 'qusb2' in this kind of hyperviosr= */ if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1 || cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2) { diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-vir= tio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio= .xml index 6e879ded86..300dea1382 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml @@ -29,11 +29,8 @@
- + -
- -
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-= ccw-virtio+ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdomains/qemuhotp= lug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml index 9b16951e46..882a509eeb 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-vir= tio+ccw-virtio-1-reverse.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-vir= tio+ccw-virtio-1-reverse.xml @@ -39,11 +39,8 @@
- + -
- -
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-= ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-wit= h-2-ccw-virtio.xml index b5292a7ed2..6167d54bd2 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-vir= tio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-vir= tio.xml @@ -29,11 +29,8 @@
- + -
- -
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-cc= w-virtio+ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotpl= ug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml index f37868101c..67a5c84a6c 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virti= o+ccw-virtio-2-explicit.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virti= o+ccw-virtio-2-explicit.xml @@ -38,11 +38,8 @@
- + -
- -
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-cc= w-virtio+ccw-virtio-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-c= cw-live-with-ccw-virtio+ccw-virtio-2.xml index f37868101c..67a5c84a6c 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virti= o+ccw-virtio-2.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virti= o+ccw-virtio-2.xml @@ -38,11 +38,8 @@
- + -
- -
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-cc= w-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-= ccw-virtio.xml index 42f89a07a2..07bbfa24a2 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virti= o.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virti= o.xml @@ -28,11 +28,8 @@
- + -
- -
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml b/t= ests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml index f0570b5cf4..4869103a06 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml @@ -19,11 +19,8 @@ restart /usr/bin/qemu-system-s390x - + -
- -
diff --git a/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml b/test= s/qemuxmlconfdata/s390-usb-address.s390x-latest.xml index 595d0b1a1e..e17098a3df 100644 --- a/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml +++ b/tests/qemuxmlconfdata/s390-usb-address.s390x-latest.xml @@ -17,11 +17,7 @@ destroy /usr/bin/qemu-system-s390x - -
- -
-
+