From nobody Mon Feb 9 12:09:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617796158; cv=none; d=zohomail.com; s=zohoarc; b=X8Sxh7suZpOg83bIwu7A0DkJE02QiQwC2a1kamlHyhIEEZ5T9iVX/VEezzaRYd6ZhR6rjDWWZPmqhtuWjArsr14OojD/qLSQZP4aTXjDSXyqYwSkp6D0Vf92pz8/MIvqp9qjxInJkLvx+SBAhFeXhacNj2tsQ8RaFYpqrzTWrpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796158; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2ZB/WEXZX+yC9aZdn+iJK3Hx0RqJYSjQ0g4Z1bhbLTg=; b=dtwbC6jGUEg+zsFPrwp4+UmSeFgDN0/kYSzIayK6gtOfBA9039DgxYMrLfMUoAFCcBqLPBgOZgrmOkUSZ5qXQ61FKTM3qCHuL5KHH47el155daWnXJc5+WCPgKTw4pSNHW+5zIVd+rypMwby5AIN87SsUEtZY93bqyLyT/exgOw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 161779615807250.11153269318311; Wed, 7 Apr 2021 04:49:18 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-PIraXGjpPBKNybnSkXUFLQ-1; Wed, 07 Apr 2021 07:49:15 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E13C83DD20; Wed, 7 Apr 2021 11:49:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 300C219D9F; Wed, 7 Apr 2021 11:49:10 +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 E35D41806D17; Wed, 7 Apr 2021 11:49:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 137Bn8H6006940 for ; Wed, 7 Apr 2021 07:49:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id F2716608BA; Wed, 7 Apr 2021 11:49:07 +0000 (UTC) Received: from work.redhat.com (ovpn-113-23.ams2.redhat.com [10.36.113.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43E5C50DE6; Wed, 7 Apr 2021 11:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796157; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2ZB/WEXZX+yC9aZdn+iJK3Hx0RqJYSjQ0g4Z1bhbLTg=; b=bXAAijDIa4ZEqlTiLX/GDMrzWs+GY0jDVQ/LJpUtf07DiQbRSn2zvnurnxd8fiCvhZMoa5 w07EhJ0ZLcsyFhzjUmJhCCkrC0+VZXOYTeV7OENyZVD7W6xr1TINXcwVQwfToC/CX6efGD fNJw94ui6ewREtqL9onmzDN+08uBK3Y= X-MC-Unique: PIraXGjpPBKNybnSkXUFLQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 14/14] conf: Use virTristateXXX in virPCIDeviceAddress Date: Wed, 7 Apr 2021 13:48:41 +0200 Message-Id: <20210407114841.85009-15-twiederh@redhat.com> In-Reply-To: <20210407114841.85009-1-twiederh@redhat.com> References: <20210407114841.85009-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/conf/device_conf.c | 16 +++++++++------- src/util/virpci.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 714ac50762..0dd60985e9 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -246,13 +246,15 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, return -1; } =20 - if (multi && - ((addr->multi =3D virTristateSwitchTypeFromString(multi)) <=3D 0))= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unknown value '%s' for
'multifunction'= attribute"), - multi); - return -1; - + if (multi) { + int value; + if ((value =3D virTristateSwitchTypeFromString(multi)) <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown value '%s' for
'multifunct= ion' attribute"), + multi); + return -1; + } + addr->multi =3D value; } if (!virPCIDeviceAddressIsEmpty(addr) && !virPCIDeviceAddressIsValid(a= ddr, true)) return -1; diff --git a/src/util/virpci.h b/src/util/virpci.h index 9b37a12883..2c86642ea7 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -65,7 +65,7 @@ struct _virPCIDeviceAddress { unsigned int bus; unsigned int slot; unsigned int function; - int multi; /* virTristateSwitch */ + virTristateSwitch multi; int extFlags; /* enum virPCIDeviceAddressExtensionFlags */ virZPCIDeviceAddress zpci; /* Don't forget to update virPCIDeviceAddressCopy if needed. */ --=20 2.26.2