From nobody Mon Feb 2 09:26:42 2026 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; 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=1768229525; cv=none; d=zohomail.com; s=zohoarc; b=mhxWzi4GPWoQzB2mbzBd612z1Qb4j+SYDIY4gSMMbABTuD/gMisMkk3Dz71iSN1jGFGoeoa0TQwcJ3ix4CqC9sRS86787ZgjgYloSrdJ+eIEYa4aChcd62MuBjWDfmkax8qT1B8o7W8LTHgsyvCUospLJ8rc0DRMOq/hRSfItFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768229525; 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=UHYAD9chKwBt5GeuNRF7UeQ1uHOkaPAziWLuFy0SB1g=; b=alFb0BNvPlTyTqlqnHdDtc7eORUWhVP3xPN1FzgXEBXqVZBMhgGQO47VZpCezf2Mp94Um0wgIc2Mb0+X3LbqIQWUJtrXtEUG8Dow1y2vQ/Mq9/IFvue1USkVXcWGq5tEbaPOv/ZM9RUKTnXQwvDS1rinBQ18w1HK2DZXCoszBYo= 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 1768229525525400.17961542381056; Mon, 12 Jan 2026 06:52:05 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id A042D417ED; Mon, 12 Jan 2026 09:52:04 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 993D041AAD; Mon, 12 Jan 2026 09:49:43 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id F1D02417E7; Mon, 12 Jan 2026 09:49:27 -0500 (EST) 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 2E1F0417EC for ; Mon, 12 Jan 2026 09:49:26 -0500 (EST) 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-530-goY4ojyyP3eB8vvdeb8Ong-1; Mon, 12 Jan 2026 09:49:23 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E0FA31956061 for ; Mon, 12 Jan 2026 14:49:22 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.90]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2959530001A2 for ; Mon, 12 Jan 2026 14:49:21 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, 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=1768229365; 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=UHYAD9chKwBt5GeuNRF7UeQ1uHOkaPAziWLuFy0SB1g=; b=eu7BL2vk/UdX33jyqApyg4yyEhjsImM0dfCdtj46IsffmpIaJVIeT7hSOFtYj3AmnoPLAj 7V2ocRUPnI/QrxlSM+Xz5V/5AlR57MOUamYbdZ6EhA7G8izySKNPl2LiChenpfNLhnaoV8 CFW1nzKTIW/0HijFyG2Oy7fqHIvW7MY= X-MC-Unique: goY4ojyyP3eB8vvdeb8Ong-1 X-Mimecast-MFC-AGG-ID: goY4ojyyP3eB8vvdeb8Ong_1768229363 To: devel@lists.libvirt.org Subject: [PATCH 2/4] conf: Rename virDomainDefHasUSB() to virDomainDefHasUSBControllers() Date: Mon, 12 Jan 2026 15:49:14 +0100 Message-ID: <20260112144916.127295-3-abologna@redhat.com> In-Reply-To: <20260112144916.127295-1-abologna@redhat.com> References: <20260112144916.127295-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: I1y-9TgXPI8WjkqR3nlfaUrJTHKyZFrw56TldHDhT1s_1768229363 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: UAELHYHZSRKHL2BUP6RGPQU4A5FPMTTB X-Message-ID-Hash: UAELHYHZSRKHL2BUP6RGPQU4A5FPMTTB 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: 1768229527661158500 Content-Type: text/plain; charset="utf-8"; x-default="true" The new name more accurately describes what the function actually does. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 4 ++-- src/conf/domain_conf.h | 2 +- src/conf/domain_validate.c | 2 +- src/libvirt_private.syms | 2 +- src/qemu/qemu_domain_address.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9ca5c2450c..e7fa4cd769 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5413,7 +5413,7 @@ virDomainSCSIDriveAddressIsUsed(const virDomainDef *d= ef, =20 =20 bool -virDomainDefHasUSB(const virDomainDef *def) +virDomainDefHasUSBControllers(const virDomainDef *def) { size_t i; =20 @@ -29921,7 +29921,7 @@ virDomainDefCompatibleDevice(virDomainDef *def, } } =20 - if (!virDomainDefHasUSB(def) && + if (!virDomainDefHasUSBControllers(def) && def->os.type !=3D VIR_DOMAIN_OSTYPE_EXE && virDomainDeviceIsUSB(dev, false)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cb35ff06bd..a2684ea78d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3682,7 +3682,7 @@ bool virDomainSCSIDriveAddressIsUsed(const virDomainDef *def, const virDomainDeviceDriveAddress *addr); =20 -bool virDomainDefHasUSB(const virDomainDef *def); +bool virDomainDefHasUSBControllers(const virDomainDef *def); =20 bool virDomainDeviceAliasIsUserAlias(const char *aliasStr); =20 diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 7346a61731..647cb23b19 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -1166,7 +1166,7 @@ virDomainRedirdevDefValidate(const virDomainDef *def, const virDomainRedirdevDef *redirdev) { if (redirdev->bus =3D=3D VIR_DOMAIN_REDIRDEV_BUS_USB && - !virDomainDefHasUSB(def)) { + !virDomainDefHasUSBControllers(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("cannot add redirected USB device: USB is disable= d for this domain")); return -1; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 4e57e4a8f6..3fc97bd124 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -349,7 +349,7 @@ virDomainDefHasOldStyleROUEFI; virDomainDefHasOldStyleUEFI; virDomainDefHasPCIHostdev; virDomainDefHasTimer; -virDomainDefHasUSB; +virDomainDefHasUSBControllers; virDomainDefHasVcpusOffline; virDomainDefHasVDPANet; virDomainDefIDsParseString; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 7233df888c..e835266f40 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -3038,7 +3038,7 @@ qemuDomainUSBAddressAddHubs(virDomainDef *def) &data, false)); =20 - if (data.count > 0 && !virDomainDefHasUSB(def)) { + if (data.count > 0 && !virDomainDefHasUSBControllers(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("USB is disabled for this domain, but USB devices= are present in the domain XML")); return -1; --=20 2.52.0