From nobody Wed Feb 11 07:13:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1493309387589408.15399922910933; Thu, 27 Apr 2017 09:09:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D804C80063; Thu, 27 Apr 2017 16:09:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7EBED8292D; Thu, 27 Apr 2017 16:09:44 +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 10317410B1; Thu, 27 Apr 2017 16:09:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v3RG9grZ020555 for ; Thu, 27 Apr 2017 12:09:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1841E17ACF; Thu, 27 Apr 2017 16:09:42 +0000 (UTC) Received: from antique-work.brq.redhat.com (dhcp129-230.brq.redhat.com [10.34.129.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4403F17B62; Thu, 27 Apr 2017 16:09:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D804C80063 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D804C80063 From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 27 Apr 2017 18:09:33 +0200 Message-Id: <53272c1fae38561959f03a990718fbe0b7701164.1493309094.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: abologna@redhat.com Subject: [libvirt] [PATCH v2 1/5] qemu: change the logic of setting default USB controller 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 27 Apr 2017 16:09:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The new logic will set the piix3-uhci if available regardless of any architecture and it will be updated to better model based on architecture and device existence. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_domain.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6824af565b..5cdb99cb4b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3200,11 +3200,17 @@ qemuDomainControllerDefPostParse(virDomainControlle= rDefPtr cont, * when the relevant device is not available. * * See qemuBuildControllerDevCommandLine() */ - if (ARCH_IS_S390(def->os.arch) && - 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; + + /* Default USB controller is piix3-uhci if available. */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) + cont->model =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; + + 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; + } } 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. @@ -3215,11 +3221,10 @@ qemuDomainControllerDefPostParse(virDomainControlle= rDefPtr cont, cont->model =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XH= CI; } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) { cont->model =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OH= CI; + } else { + /* Explicitly fallback to legacy USB controller for PP= C64. */ + cont->model =3D -1; } - } else { - /* Default USB controller for anything else is piix3-uhci = */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) - cont->model =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_= UHCI; } } /* forbid usb model 'qusb1' and 'qusb2' in this kind of hyperviosr= */ --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list