From nobody Mon Sep 8 17:06:10 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=1755622061; cv=none; d=zohomail.com; s=zohoarc; b=cXNuNxtwhUaL/5mKQXhbFdY9pbA8vWXRHut/CSssgV4VpbGuz3Wj3Qecfxj06pOaJKV7lMSzZqyzUJfDiaQlse0MdP2Bv5H/EaZKvNJijCuPFuVR3i7BFaBrucRchs74fMcA1d2iuooF6qWIlCstlXT5q5PJklE5YHpqsGkWoik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1755622061; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post: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=7QmJFukRxJ0u6gEfqXZx3D0JDkN+JWExuD3ZD+zo6j4=; b=mvzVfzKs3Kd64rTE/jnlT4eaegsW/0zl6TkRzB6izzg/ex4/ylk5uchJypKcFJMlSZVsWQ0s9iyXE8/qmrAOXzdvhrpn68g6A9peAaSRDnNjOsgIVazxhyz8GlR8Z+kt/nmoMikb2J6zFRtdyLhw/EiCh4BkUH7+MJ9XFbQTdbA= 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 1755622061336977.8670147100739; Tue, 19 Aug 2025 09:47:41 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6997EC33; Tue, 19 Aug 2025 12:47:40 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id D7B7811E8; Tue, 19 Aug 2025 12:24:16 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id B631EC69; Tue, 19 Aug 2025 12:24:09 -0400 (EDT) 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 1AB71E3B for ; Tue, 19 Aug 2025 12:23:10 -0400 (EDT) Received: from mx-prod-mc-03.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-83-HFTfZAVCPhqu_PH7WlbKuA-1; Tue, 19 Aug 2025 12:23:08 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 656771955F1F for ; Tue, 19 Aug 2025 16:23:07 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.45.224.253]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70E211800447 for ; Tue, 19 Aug 2025 16:23:06 +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=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755620589; 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=k64qXAuDPbca2XVDnjhuYa5ZH0SEjS2b0Uyc6BDcQfU=; b=KTPOJYkEX8p0+WtNAhsa5P8ElIXO1NoIoVm7fg7CDyTKhqDwsUcSDjwGTdT2ouI1NqJ0PP K5N/kyvjMwb4bmsFSAn//v1AuApfODhLk/QxlLdS6/RUT+vlntuUrY1mm/3hAn+4bYLMxo 8KSFp0jTe4zZIVsKPzg8pxK3pTIEVEc= X-MC-Unique: HFTfZAVCPhqu_PH7WlbKuA-1 X-Mimecast-MFC-AGG-ID: HFTfZAVCPhqu_PH7WlbKuA_1755620587 To: devel@lists.libvirt.org Subject: [PATCH 20/31] qemu: Always default to no USB controller on s390x Date: Tue, 19 Aug 2025 18:22:24 +0200 Message-ID: <20250819162235.468215-21-abologna@redhat.com> In-Reply-To: <20250819162235.468215-1-abologna@redhat.com> References: <20250819162235.468215-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: CyI7_BiKb6WIOwVCpTHyCEeAnVU5tNI2L1EirTUepgM_1755620587 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4O3C4GVZKII3FIE22AZKBNYWPIQNLMXX X-Message-ID-Hash: 4O3C4GVZKII3FIE22AZKBNYWPIQNLMXX 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: From: Andrea Bolognani via Devel Reply-To: Andrea Bolognani X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1755622063826116600 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: Boris Fiuczynski Reviewed-by: Thomas Huth --- 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 e2004993f3..cbef101104 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 - -
- -
-
+