From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796189; cv=none; d=zohomail.com; s=zohoarc; b=QNSB3VCBsWsReEswSSlYrUaV8lE+deHlqVDEluln93KIGjO2jT4XTWJfSfZaK0NjVRrKZWgbOgQVTeLBr1Vwh9qf3U0k22+ihbkfotYiubPMlGNlwsXEmAonk5DM65yQuv4R+ubeqBgGcCReuxjdyEttF4RSoqWhR+dp5+a9fqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796189; 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=HjE1GAUpBsVeu4S/G0HFROoaDOuDj1x9BTZk7WhVR0g=; b=L+dFIW/abZ/19Xvt4iFTQx9MyjVlsqPwTXMdpBuOUvnHhZlUAp5MANmX2WeoqJwGGSuJICZwM9cbBJElJi2uVbFSXui5W6NwN5PPa/HvYEcH0pC9CDcP3narMzgpcpCCZBtGqZalVNG6UQwWfFRNtxVvDEXuNDlPBrsi+6rzw+Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796189579270.508133993146; Wed, 7 Apr 2021 04:49:49 -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-505-KRCRZZMpP5uEKrPB1koWSg-1; Wed, 07 Apr 2021 07:49:06 -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 18BA8107ACF5; Wed, 7 Apr 2021 11:49:00 +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 DADAE19C46; Wed, 7 Apr 2021 11:48:59 +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 9EAAC1806D15; Wed, 7 Apr 2021 11:48:59 +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 137Bmilg006700 for ; Wed, 7 Apr 2021 07:48:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3EB7814108; Wed, 7 Apr 2021 11:48:44 +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 8232260854; Wed, 7 Apr 2021 11:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796188; 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=HjE1GAUpBsVeu4S/G0HFROoaDOuDj1x9BTZk7WhVR0g=; b=HIl+6CW2lYvvMrP1JlA/OizrW5+GGLl2VmMLcNN/GHO9qlE2mMwtEKhh5RAVFKTI7xT9w4 5nahRESQjrsDZfAjEsI1kCSfEWpIMhPx8Spy4gFf1nZkz/HQxQXCfeokqfmzHWkv/AnnSo r0mewn772v6Q6th1ihrGxCbDfmx3b1U= X-MC-Unique: KRCRZZMpP5uEKrPB1koWSg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/14] conf: Use virTristateXXX in virStorageSource Date: Wed, 7 Apr 2021 13:48:28 +0200 Message-Id: <20210407114841.85009-2-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/domain_conf.c | 12 ++++++++---- src/conf/storage_source_conf.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1e72171586..b8f6c3d606 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8340,11 +8340,15 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node, return -1; } =20 - if ((haveTLS =3D virXMLPropString(node, "tls")) && - (src->haveTLS =3D virTristateBoolTypeFromString(haveTLS)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown disk source 'tls' setting '%s'"), haveTLS); + if ((haveTLS =3D virXMLPropString(node, "tls"))) { + int value; + + if ((value =3D virTristateBoolTypeFromString(haveTLS)) <=3D 0) { + virReportError(VIR_ERR_XML_ERROR, + _("unknown disk source 'tls' setting '%s'"), ha= veTLS); return -1; + } + src->haveTLS =3D value; } =20 if ((flags & VIR_DOMAIN_DEF_PARSE_STATUS) && diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index f42bb1c67d..e6702a1ffc 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -356,7 +356,7 @@ struct _virStorageSource { char *nodestorage; /* name of the storage object */ =20 /* An optional setting to enable usage of TLS for the storage source */ - int haveTLS; /* enum virTristateBool */ + virTristateBool haveTLS; =20 /* Indication whether the haveTLS value was altered due to qemu.conf * setting when haveTLS is missing from the domain config file */ --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796139; cv=none; d=zohomail.com; s=zohoarc; b=b/Z/WX4C+U+Vfc9ZIoAd59+zAAe4xy/vWLTk6s50lwvrcRoD8EqGz2Wp/JYoJRwCgmLZ3JhOw4163WbCCLfT4xzZEwp/vP+qQsVBd2t0axpcmot8omoIktJFI5FWRutG2tvWNdmCQDuCl49Rvl39mAxxq6djdfmAOE1jdyrr/mo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796139; 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=wz4oehQ22Br8i9SOimV+M5SR3yVgsXk6wxJIrF3jF5M=; b=Cs87PfJlCnmQKF8PPOipRSGL10t0gGBHenbQvzmmxDz7PnEJaXH2MPhwrdGQuVZbwAjIcTQhZIFl5sgMwVY08zc5NOS753LMpK2P4OF+pgXDdZUJrhl6ZmfiHwR7MDEgE73nWhlKw9I7KcXnBM5iFUNNCTy5IxzwVr7M960CB04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796139521391.55355702598035; Wed, 7 Apr 2021 04:48:59 -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-79-xgyZncUmN_mO6Q1liNHdew-1; Wed, 07 Apr 2021 07:48:56 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 249EBE99C1; Wed, 7 Apr 2021 11:48:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0E8E5C1C4; Wed, 7 Apr 2021 11:48:48 +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 3D2CB5533E; Wed, 7 Apr 2021 11:48:47 +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 137BmjOM006707 for ; Wed, 7 Apr 2021 07:48:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4B2F914108; Wed, 7 Apr 2021 11:48:45 +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 9153F608BA; Wed, 7 Apr 2021 11:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796138; 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=wz4oehQ22Br8i9SOimV+M5SR3yVgsXk6wxJIrF3jF5M=; b=aecpmR2lwM7/zsilZLdOYhCa0t52XcLC1hICRHfS68QtVPOOp3OhF6JTWwvvPxGF5dYK65 pVTyhHU4nxA0v7xqCyrIBTnAf3mZKSY1tGMm4Fsoa7qMDuhox8G4yUTsMHrzYYuo9d0tCv zdGAshLhs/p6h8oUjaljlGxEjU7yN6g= X-MC-Unique: xgyZncUmN_mO6Q1liNHdew-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 02/14] conf: Use virTristateXXX in virStorageSourceNVMeDef Date: Wed, 7 Apr 2021 13:48:29 +0200 Message-Id: <20210407114841.85009-3-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.79 on 10.5.11.16 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/domain_conf.c | 4 +++- src/conf/storage_source_conf.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b8f6c3d606..dfdca1891a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8480,12 +8480,14 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node, } =20 if ((managed =3D virXMLPropString(node, "managed"))) { - if ((nvme->managed =3D virTristateBoolTypeFromString(managed)) <= =3D 0) { + int value; + if ((value =3D virTristateBoolTypeFromString(managed)) <=3D 0) { virReportError(VIR_ERR_XML_ERROR, _("malformed managed value '%s'"), managed); return -1; } + nvme->managed =3D value; } =20 if (!(address =3D virXPathNode("./address", ctxt))) { diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index e6702a1ffc..1783dc195e 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -251,7 +251,7 @@ typedef struct _virStorageSourceNVMeDef virStorageSourc= eNVMeDef; typedef virStorageSourceNVMeDef *virStorageSourceNVMeDefPtr; struct _virStorageSourceNVMeDef { unsigned long long namespc; - int managed; /* enum virTristateBool */ + virTristateBool managed; virPCIDeviceAddress pciAddr; =20 /* Don't forget to update virStorageSourceNVMeDefCopy */ --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796138; cv=none; d=zohomail.com; s=zohoarc; b=gnAGhGkwkzhfd1H6kww8008L+s4Wt/P3FXR8iEWuO8vkBqGgTBYXRmgTB22xlwnLhIYSxAGEP+d1bM4BYirieroY6Lj3zqSyD6fFwFVw3XdqD195Mk1H8E6eRrS5SLDi6x2aHv2HqfqSw6O9E4xRcQXenY1Gu1eeF55/CpJvh0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796138; 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=wEFWAQhjyrFVxaVXORWILCHssZ6zr9ekQbUZFtoSN5M=; b=OFD12mCwjoenJJMNfNg9URQYBdMy/+zEhyDVt0WjiBHVPHZJl98hcOmueI+KiDoK588uqUsJy60XUwszwmvxlsiUijIbcJaR34FTCT4+09CQ3tSO25C58QXn91lnAQ8TD4L7DS3YFRanM4PQlmkPgDTPSk92otW16YZr6mWLXog= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796138718978.8759320183422; Wed, 7 Apr 2021 04:48:58 -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-43-odZi_VoTPD6YGjHgl-COtA-1; Wed, 07 Apr 2021 07:48:55 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA49AE99C0; Wed, 7 Apr 2021 11:48:49 +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 83531610A8; Wed, 7 Apr 2021 11:48:49 +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 D73F21806D11; Wed, 7 Apr 2021 11:48:47 +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 137BmkoO006718 for ; Wed, 7 Apr 2021 07:48:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 55D32608BA; Wed, 7 Apr 2021 11:48:46 +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 9D29360854; Wed, 7 Apr 2021 11:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796137; 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=wEFWAQhjyrFVxaVXORWILCHssZ6zr9ekQbUZFtoSN5M=; b=gS3CvNs9m1/lLD2+g2+IpmNKL27Ku1uo4nfI4ZUgn19QSfM7LpobdUcywhrfI45w7w0jXP cC5Z5BuWa+wfN3W1iDMN/6lroXb/CliVohBn2M7rJH+jpMog0Fl4nICEj+5/wyJb4U7V0z +Zisnq2Lz5EUAF7P1XQsnMabKHCxF/A= X-MC-Unique: odZi_VoTPD6YGjHgl-COtA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/14] conf: Use virTristateXXX in virDomainDeviceInfo Date: Wed, 7 Apr 2021 13:48:30 +0200 Message-Id: <20210407114841.85009-4-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.79 on 10.5.11.12 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" Note that the wrong "VIR_TRISTATE_*_ABSENT" was used in qemuDomainChangeNet. Signed-off-by: Tim Wiederhake --- src/conf/device_conf.h | 4 ++-- src/conf/domain_conf.c | 26 ++++++++++++++++---------- src/qemu/qemu_command.c | 3 ++- src/qemu/qemu_hotplug.c | 2 +- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index a51bdf10ee..289af1153a 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -153,8 +153,8 @@ struct _virDomainDeviceInfo { } master; /* rombar and romfile are only used for pci hostdev and network * devices. */ - int romenabled; /* enum virTristateBool */ - int rombar; /* enum virTristateSwitch */ + virTristateBool romenabled; + virTristateSwitch rombar; char *romfile; /* bootIndex is only used for disk, network interface, hostdev * and redirdev devices */ diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index dfdca1891a..67954bb42b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6687,17 +6687,23 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr x= mlopt, =20 if ((flags & VIR_DOMAIN_DEF_PARSE_ALLOW_ROM) && (rom =3D virXPathNode("./rom", ctxt))) { - if ((romenabled =3D virXPathString("string(./rom/@enabled)", ctxt)= ) && - ((info->romenabled =3D virTristateBoolTypeFromString(romenable= d)) <=3D 0)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown rom enabled value '%s'"), romenabled= ); - goto cleanup; + if ((romenabled =3D virXPathString("string(./rom/@enabled)", ctxt)= )) { + int value; + if ((value =3D virTristateBoolTypeFromString(romenabled)) <=3D= 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown rom enabled value '%s'"), romena= bled); + goto cleanup; + } + info->romenabled =3D value; } - if ((rombar =3D virXPathString("string(./rom/@bar)", ctxt)) && - ((info->rombar =3D virTristateSwitchTypeFromString(rombar)) <= =3D 0)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown rom bar value '%s'"), rombar); - goto cleanup; + if ((rombar =3D virXPathString("string(./rom/@bar)", ctxt))) { + int value; + if ((value =3D virTristateSwitchTypeFromString(rombar)) <=3D 0= ) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown rom bar value '%s'"), rombar); + goto cleanup; + } + info->rombar =3D value; } info->romfile =3D virXMLPropString(rom, "file"); =20 diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7cb07306f3..92ab7eb34a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -685,7 +685,8 @@ qemuBuildRomStr(virBufferPtr buf, case VIR_TRISTATE_SWITCH_ON: virBufferAddLit(buf, ",rombar=3D1"); break; - default: + case VIR_TRISTATE_SWITCH_ABSENT: + case VIR_TRISTATE_SWITCH_LAST: break; } if (info->romfile) { diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 58d2abb862..142a4b18e1 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3653,7 +3653,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, =20 /* device alias is checked already in virDomainDefCompatibleDevice */ =20 - if (newdev->info.rombar =3D=3D VIR_TRISTATE_BOOL_ABSENT) + if (newdev->info.rombar =3D=3D VIR_TRISTATE_SWITCH_ABSENT) newdev->info.rombar =3D olddev->info.rombar; if (olddev->info.rombar !=3D newdev->info.rombar) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796146; cv=none; d=zohomail.com; s=zohoarc; b=TWqrEveq0vMcPrbm+Zci4jMwnbolzuwpPjt+aXfnhbfQ4feRonhsCGXe9/cr1pMm3Omqcsf87SJ95mLTeFI9ngJAn+woJR389ydu/J8SwNYIDfAOp6HdPyZ1IY0I4480qjWyhQW9n7lYW7TKXWhmbl19fNmEI8wQ6uGGeyj91CI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796146; 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=KVBIeWhBGPq7zFa0GpB5fS2eqL1k9JLXEyLumeWAat0=; b=jUDreXawEl9YCzrrS+EvEwHe7EWPMEwj+oJLAHZ4C6ri178D8cdQAgbp15dEtcdK/g6UVJ8+Y5f+a1/ekyKDRGi1aWKaCQknKxfzrKlDoz8NIt9WOp/Td14N5fS7rd6katf6iZaUVzNYRQ+BLWqdpkJkXgPaXRM3FSm/cBLMtDQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796146806242.8004743428197; Wed, 7 Apr 2021 04:49:06 -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-225-DAK_zIjFPJKXtzkyIxqc5w-1; Wed, 07 Apr 2021 07:49:03 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 71596E99C0; Wed, 7 Apr 2021 11:48:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 48D925C1C4; Wed, 7 Apr 2021 11:48:56 +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 D511755341; Wed, 7 Apr 2021 11:48:55 +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 137Bml0l006734 for ; Wed, 7 Apr 2021 07:48:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 62B7A14108; Wed, 7 Apr 2021 11:48:47 +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 A911B608BA; Wed, 7 Apr 2021 11:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796145; 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=KVBIeWhBGPq7zFa0GpB5fS2eqL1k9JLXEyLumeWAat0=; b=VAG1CC6a/dnCPMC3T1F6cxQ4lhsGSK+EA5n44ceGo92P6z1NbeXL8XDj4KoJIOqKdpkpV0 qQxbDOBvoSIBvKy4rOuuKE+hMDc+4lmJOOVXnwY/umdSWSoqFk/D95Fh5nNcdGFl+IeOSk 9A9YqVPrHfkc3e+Go6keuzuymZqt4Ic= X-MC-Unique: DAK_zIjFPJKXtzkyIxqc5w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/14] conf: Use virTristateXXX in virDomainDiskDef Date: Wed, 7 Apr 2021 13:48:31 +0200 Message-Id: <20210407114841.85009-5-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.79 on 10.5.11.16 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/domain_conf.c | 39 ++++++++++++++++++++++++--------------- src/conf/domain_conf.h | 6 +++--- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 67954bb42b..a99553cb0b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9198,27 +9198,36 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr = def, } VIR_FREE(tmp); =20 - if ((tmp =3D virXMLPropString(cur, "ioeventfd")) && - (def->ioeventfd =3D virTristateSwitchTypeFromString(tmp)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown disk ioeventfd mode '%s'"), tmp); - return -1; + if ((tmp =3D virXMLPropString(cur, "ioeventfd"))) { + int value; + if ((value =3D virTristateSwitchTypeFromString(tmp)) <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown disk ioeventfd mode '%s'"), tmp); + return -1; + } + def->ioeventfd =3D value; } VIR_FREE(tmp); =20 - if ((tmp =3D virXMLPropString(cur, "event_idx")) && - (def->event_idx =3D virTristateSwitchTypeFromString(tmp)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown disk event_idx mode '%s'"), tmp); - return -1; + if ((tmp =3D virXMLPropString(cur, "event_idx"))) { + int value; + if ((value =3D virTristateSwitchTypeFromString(tmp)) <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown disk event_idx mode '%s'"), tmp); + return -1; + } + def->event_idx =3D value; } VIR_FREE(tmp); =20 - if ((tmp =3D virXMLPropString(cur, "copy_on_read")) && - (def->copy_on_read =3D virTristateSwitchTypeFromString(tmp)) <=3D = 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown disk copy_on_read mode '%s'"), tmp); - return -1; + if ((tmp =3D virXMLPropString(cur, "copy_on_read"))) { + int value; + if ((value =3D virTristateSwitchTypeFromString(tmp)) <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown disk copy_on_read mode '%s'"), tmp); + return -1; + } + def->copy_on_read =3D value; } VIR_FREE(tmp); =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3da9ba01bf..1bbf859ca6 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -569,9 +569,9 @@ struct _virDomainDiskDef { int error_policy; /* enum virDomainDiskErrorPolicy */ int rerror_policy; /* enum virDomainDiskErrorPolicy */ int iomode; /* enum virDomainDiskIo */ - int ioeventfd; /* enum virTristateSwitch */ - int event_idx; /* enum virTristateSwitch */ - int copy_on_read; /* enum virTristateSwitch */ + virTristateSwitch ioeventfd; + virTristateSwitch event_idx; + virTristateSwitch copy_on_read; int snapshot; /* virDomainSnapshotLocation, snapshot_conf.h */ int startupPolicy; /* enum virDomainStartupPolicy */ bool transient; --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796230; cv=none; d=zohomail.com; s=zohoarc; b=bxeZ4gYkHqrf40a8jI6jjpHxpQDYpO2aNqXrxNqG2NZwC9FaDSiyP/Hr3OscYF/Dek9ttEStlkCZcIQtWOrfNvOgDTJTESGlyIizNVDDyloYoNBW7AxNUJcPYMg3nBTYB5yPTUW2OcGdrix4bUUha/nP1w29esrY3BDMm/Qgow0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796230; 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=zUX3t4OF90S22bkWBACCw7MrHeRF271Ylm+Q6SJqR7Q=; b=AC99FDc/bLMAA9ms3eVYOJ1voWgcnEgMxAp+a90GxaOSTlEImQAvKpSpkttmzTKmeMC+GhZPptN7ZyFeDR/zZSDLjEY7FsjSjG2IaVhRc2hAL5DziD/DXKpJ2s8zVAcd8bWmj988eAxtD0IbjYI87mJl0r6BoL4tPRRZ6++HR/0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796230000564.2906887465303; Wed, 7 Apr 2021 04:50:30 -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-334-pqFzNB2pP1qnsZOwtyiCtw-1; Wed, 07 Apr 2021 07:49:03 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57FF3835BC3; Wed, 7 Apr 2021 11:48:58 +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 32C675D9D0; Wed, 7 Apr 2021 11:48:58 +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 E6763180B763; Wed, 7 Apr 2021 11:48:57 +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 137BmmtN006744 for ; Wed, 7 Apr 2021 07:48:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6F9C4608BA; Wed, 7 Apr 2021 11:48:48 +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 B62AA60CEA; Wed, 7 Apr 2021 11:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796228; 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=zUX3t4OF90S22bkWBACCw7MrHeRF271Ylm+Q6SJqR7Q=; b=jOR1dbuU1i6s5AZrmGhNlCUzgTwF4SsL1GdMEGcRIMU0+VRtsuI7LNeiYv5aQL+I20+NgA MzkgUaCdR3m44yTwar41WAAXhMI90UV7umLBpZxFh1Gv20l61migmLFiKz+33wUUQm1k58 HfA0XYSsDd/EqtGlBxMEXy+gD0ePewQ= X-MC-Unique: pqFzNB2pP1qnsZOwtyiCtw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/14] conf: Use virTristateXXX in virDomainActualNetDef Date: Wed, 7 Apr 2021 13:48:32 +0200 Message-Id: <20210407114841.85009-6-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.79 on 10.5.11.14 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/domain_conf.c | 17 +++++++++-------- src/conf/domain_conf.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a99553cb0b..d0d03b16bb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10562,14 +10562,15 @@ virDomainActualNetDefParseXML(xmlNodePtr node, goto error; } =20 - trustGuestRxFilters =3D virXMLPropString(node, "trustGuestRxFilters"); - if (trustGuestRxFilters && - ((actual->trustGuestRxFilters - =3D virTristateBoolTypeFromString(trustGuestRxFilters)) <=3D 0))= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown trustGuestRxFilters value '%s'"), - trustGuestRxFilters); - goto error; + if ((trustGuestRxFilters =3D virXMLPropString(node, "trustGuestRxFilte= rs"))) { + int value; + if ((value =3D virTristateBoolTypeFromString(trustGuestRxFilters))= <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown trustGuestRxFilters value '%s'"), + trustGuestRxFilters); + goto error; + } + actual->trustGuestRxFilters =3D value; } =20 virtPortNode =3D virXPathNode("./virtualport", ctxt); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 1bbf859ca6..21c34b33c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -995,7 +995,7 @@ struct _virDomainActualNetDef { virNetDevVPortProfilePtr virtPortProfile; virNetDevBandwidthPtr bandwidth; virNetDevVlan vlan; - int trustGuestRxFilters; /* enum virTristateBool */ + virTristateBool trustGuestRxFilters; virTristateBool isolatedPort; unsigned int class_id; /* class ID for bandwidth 'floor' */ }; --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796263; cv=none; d=zohomail.com; s=zohoarc; b=DEw1wLmCvYggX4gKb/j/3HeFhx4Zm57aHrAQI9S0Z4UpArba7LG4OCFwBUfYIBCm91qMoB2M4vG87zGm0wSXFw+fPlKDAmMq8Xx2oemjl8hZsqU5U7V97c4GdMJFYaxFEDEb/wGfxZXTgzOv3ffzOw0h10JawRoCIJUGnN9w/OM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796263; 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=4oo7QCj/aPCBSbxX7JkGXyFoubdHgR3eKQcigGURLw8=; b=TO/A4RvprPBn5pQ3cM+xkTt+8mhRafrGMq097QPP49SAOIhm5GsdBtxVo/s9MpcLJyTXyBhUieIii01Ga1xiFSaai3zfFA20vjDUMY7dMQqqkNzbfJ4Wz+Im8L40EEM1b41dHBEORwegmosdKw7wpL9LunWhnwzVmOpowvQow6E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796263570408.1434316294801; Wed, 7 Apr 2021 04:51:03 -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-158-31lv4xtSPEq6CRVg_y4Bdg-1; Wed, 07 Apr 2021 07:49:04 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E537188353A; Wed, 7 Apr 2021 11:48:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B23E10013D7; Wed, 7 Apr 2021 11:48:59 +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 F339155343; Wed, 7 Apr 2021 11:48:58 +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 137BmnLY006749 for ; Wed, 7 Apr 2021 07:48:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 799FB608BA; Wed, 7 Apr 2021 11:48:49 +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 C128360C5C; Wed, 7 Apr 2021 11:48:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796262; 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=4oo7QCj/aPCBSbxX7JkGXyFoubdHgR3eKQcigGURLw8=; b=iTcLZBCzuY7aIcQ7c8lxGKv6rAx6+P6M3NVKZtIRwUvUouIDKTGxpXeS+9w1ENexFAya9A JOk8UryNleH9uRi8updhg7Hw1yF6el+qD2CQtkIYA7zdolq06H6Qbh6Qe70qT74TV1xVeJ lChstusVyqslO0I5SRoiOVvB8UqCTWk= X-MC-Unique: 31lv4xtSPEq6CRVg_y4Bdg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 06/14] conf: Use virTristateXXX in virDomainNetDef Date: Wed, 7 Apr 2021 13:48:33 +0200 Message-Id: <20210407114841.85009-7-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.22 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/domain_conf.c | 17 +++++++++-------- src/conf/domain_conf.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d0d03b16bb..e529eb7bc1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10865,14 +10865,15 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xml= opt, def->type =3D VIR_DOMAIN_NET_TYPE_USER; } =20 - trustGuestRxFilters =3D virXMLPropString(node, "trustGuestRxFilters"); - if (trustGuestRxFilters && - ((def->trustGuestRxFilters - =3D virTristateBoolTypeFromString(trustGuestRxFilters)) <=3D 0))= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown trustGuestRxFilters value '%s'"), - trustGuestRxFilters); - goto error; + if ((trustGuestRxFilters =3D virXMLPropString(node, "trustGuestRxFilte= rs"))) { + int value; + if ((value =3D virTristateBoolTypeFromString(trustGuestRxFilters))= <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown trustGuestRxFilters value '%s'"), + trustGuestRxFilters); + goto error; + } + def->trustGuestRxFilters =3D value; } =20 cur =3D node->children; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 21c34b33c2..0c3d74095e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1103,7 +1103,7 @@ struct _virDomainNetDef { GHashTable *filterparams; virNetDevBandwidthPtr bandwidth; virNetDevVlan vlan; - int trustGuestRxFilters; /* enum virTristateBool */ + virTristateBool trustGuestRxFilters; virTristateBool isolatedPort; int linkstate; unsigned int mtu; --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 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=1617796153; cv=none; d=zohomail.com; s=zohoarc; b=cBCiS7Iu/stgrEcP/oP7odkscEuA9Hlg98xKdewHNR2KU9tD92yubijFlsGpwblqyVYvsGj2YinR6Pjs2wUzwNXbxOnNMfY+JUAO7/L+6viDvVvaDnjma9Yuh3EBJnHxYF0bd/qHdiu0+J6Fdlv9ErqVGaWYsLMIlFUDMABuRIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796153; 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=VPVxchz9LUVXrCMhsAs7kgOHYBaifQRSbllUONap+cw=; b=RFmxRDmY6WJvKDemtLP7RVoZnyvmGKy5rKPRR2Aurz90ve+tj/AzN+ihjHsjy6Koz5ABhyu4t/20QGd3ebFZCrr4cCK9hvyOcTtLhDhAXIaYBNnt7bAVw3ZFMFlgTDoTBf5VnkC7nlXDWeWcRMK5M1cRYTnzEVZl3jMxkIyI7qs= 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 1617796153064286.3361516163575; Wed, 7 Apr 2021 04:49:13 -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-192-bn6veVj0MBGvet_gRywybA-1; Wed, 07 Apr 2021 07:49:09 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0DAF1883545; Wed, 7 Apr 2021 11:49:01 +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 840232B1CD; Wed, 7 Apr 2021 11:49:01 +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 402991809C82; Wed, 7 Apr 2021 11:49:01 +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 137BmoPq006759 for ; Wed, 7 Apr 2021 07:48:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 87FAF14108; Wed, 7 Apr 2021 11:48:50 +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 CE51D50DE6; Wed, 7 Apr 2021 11:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796151; 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=VPVxchz9LUVXrCMhsAs7kgOHYBaifQRSbllUONap+cw=; b=EBSjoNiTm/oN1/XPrmMNPSl9cUIe3xeHSSpNaH2W7cO8kPwm2phbrnzr2kLCwhQwt8p+bH u2WsUwPeFbeo0JZtgcAH/KIsrdjza+GyOlsmEKyPQu2Pz4AiyPhxDUGC6axNvMQXD08ifg DzyL/eLsRRqgBaExE/OlrN6kGGhD9CY= X-MC-Unique: bn6veVj0MBGvet_gRywybA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/14] conf: Use virTristateXXX in virDomainChrSourceDef Date: Wed, 7 Apr 2021 13:48:34 +0200 Message-Id: <20210407114841.85009-8-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.79 on 10.5.11.12 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/domain_conf.c | 34 +++++++++++++++++++++------------- src/conf/domain_conf.h | 6 +++--- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e529eb7bc1..2ae3080a8c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11901,12 +11901,14 @@ virDomainChrSourceDefParseTCP(virDomainChrSourceD= efPtr def, def->data.tcp.service =3D virXMLPropString(source, "service"); =20 if ((tmp =3D virXMLPropString(source, "tls"))) { - if ((def->data.tcp.haveTLS =3D virTristateBoolTypeFromString(tmp))= <=3D 0) { + int value; + if ((value =3D virTristateBoolTypeFromString(tmp)) <=3D 0) { virReportError(VIR_ERR_XML_ERROR, _("unknown chardev 'tls' setting '%s'"), tmp); return -1; } + def->data.tcp.haveTLS =3D value; VIR_FREE(tmp); } =20 @@ -11985,12 +11987,15 @@ virDomainChrSourceDefParseFile(virDomainChrSource= DefPtr def, =20 def->data.file.path =3D virXMLPropString(source, "path"); =20 - if ((append =3D virXMLPropString(source, "append")) && - (def->data.file.append =3D virTristateSwitchTypeFromString(append)= ) <=3D 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid append attribute value '%s'"), - append); - return -1; + if ((append =3D virXMLPropString(source, "append"))) { + int value; + if ((value =3D virTristateSwitchTypeFromString(append)) <=3D 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid append attribute value '%s'"), + append); + return -1; + } + def->data.file.append =3D value; } =20 return 0; @@ -12026,12 +12031,15 @@ virDomainChrSourceDefParseLog(virDomainChrSourceD= efPtr def, =20 def->logfile =3D virXMLPropString(log, "file"); =20 - if ((append =3D virXMLPropString(log, "append")) && - (def->logappend =3D virTristateSwitchTypeFromString(append)) <=3D = 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid append attribute value '%s'"), - append); - return -1; + if ((append =3D virXMLPropString(log, "append"))) { + int value; + if ((value =3D virTristateSwitchTypeFromString(append)) <=3D 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid append attribute value '%s'"), + append); + return -1; + } + def->logappend =3D value; } =20 return 0; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 0c3d74095e..ad9b8f632b 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1233,7 +1233,7 @@ struct _virDomainChrSourceDef { /* no for null, vc, stdio */ struct { char *path; - int append; /* enum virTristateSwitch */ + virTristateSwitch append; } file; /* pty, file, pipe, or device */ struct { char *master; @@ -1245,7 +1245,7 @@ struct _virDomainChrSourceDef { bool listen; int protocol; bool tlscreds; - int haveTLS; /* enum virTristateBool */ + virTristateBool haveTLS; bool tlsFromConfig; virDomainChrSourceReconnectDef reconnect; } tcp; @@ -1266,7 +1266,7 @@ struct _virDomainChrSourceDef { } spiceport; } data; char *logfile; - int logappend; + virTristateSwitch logappend; =20 size_t nseclabels; virSecurityDeviceLabelDefPtr *seclabels; --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796209; cv=none; d=zohomail.com; s=zohoarc; b=kr+iMjA8dCzPLk26fGoz4rtFS8P5Q0s2kL0WU9pfKZ5bPh/4/1d8FbHKgJsRsd0ZTuZkNTRvOtmLXju2YdnuI8rLDR++4CykBU1QYVHpvQpe+h/5Yhfb0RlMu/9jTU9d+AgcbVElQ6z6g+vfMJ+2/L1o7ItoiZV+X7K6HFzATBk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796209; 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=0HN0+bmbizXArFdA2/DzPQgsscdMDZ5kXjXIR5cAB7s=; b=k8yCHmf8XWn7FWSxa7VjzIMBlaMHx7U79Ri6Lumiwvl1Y+3ht99C1ANaq4dpsXoYj2Izbq7asIlwmt7/VrVKOiRGRH1habAYzfrrYruwCzBMSToW0qW1VBq2PCWYV9D/HEFp05uBxSG3es58xeWpxhgTQnJJNyg7+HdmrS/NElc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796209874612.4575029611761; Wed, 7 Apr 2021 04:50:09 -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-289-dXIopEwVOYeL5RuvzRS32w-1; Wed, 07 Apr 2021 07:49:10 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC8921883522; Wed, 7 Apr 2021 11:49:02 +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 B5A516A038; Wed, 7 Apr 2021 11:49:02 +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 4993E1806D17; Wed, 7 Apr 2021 11:49:02 +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 137Bmpc8006775 for ; Wed, 7 Apr 2021 07:48:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 94233608BA; Wed, 7 Apr 2021 11:48:51 +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 D9C1160C5C; Wed, 7 Apr 2021 11:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796208; 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=0HN0+bmbizXArFdA2/DzPQgsscdMDZ5kXjXIR5cAB7s=; b=eoM0UVE0jMCnbWEwqVt3+2cwIt0QmFj8zO5bGtiatYLy+XMHLnSNQplOCzUGe3XE3uBYOP d+95Q8++GgrTxkUk6PxRzslOd4MuvFwi92nNC/JGajW0zo8fYXiiotS/4r8aTH//8H62vd 9GJ66hRs1nT7G1Vywfu5ds2FZR9LT/A= X-MC-Unique: dXIopEwVOYeL5RuvzRS32w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/14] conf: Use virTristateXXX in virDomainGraphicsDef Date: Wed, 7 Apr 2021 13:48:35 +0200 Message-Id: <20210407114841.85009-9-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.79 on 10.5.11.13 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/domain_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ad9b8f632b..445f48d8ed 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1863,7 +1863,7 @@ struct _virDomainGraphicsDef { int image; int jpeg; int zlib; - int playback; + virTristateSwitch playback; int streaming; virTristateBool copypaste; virTristateBool filetransfer; --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 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=1617796154; cv=none; d=zohomail.com; s=zohoarc; b=ZMFvm0nC/EiMsDWmhr53BiA6g3U9PtbPi42K1fMq+X/IrbLJQMmC4NJRQk14S8J0XPNcScQWsd2mvGqIkImQmiLInQ1/SfrU6nLin2OV3+sYgASg9t5bc/R/BhNivmZRNZHu0T9v2UEenuWZ1oU8+TCOPhIJz0VQm6D668il6pg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796154; 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=LdZnxDOMrJF9c75AMCe8P/aCq6jKZPRE9M0hJwIiPhM=; b=RgazKZljFlARy7FrDe349AIkbrNzuZTFZPvq2/UKS2DiyDaes0nBTFYe5rh0dltxhjOvgQD1FqCk3hVbQuKJcC3p3G8i9Y4MlUc35eDW+AdrD9EF46C+sTWIeRYmeLXnI1LT1EhJ1T7Kfqb50aKYA86z96+3DOwoqxZhY0PUbpI= 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 1617796154269621.0165906415444; Wed, 7 Apr 2021 04:49:14 -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-270-WFAmR7npO_eHk1P7sG4gjw-1; Wed, 07 Apr 2021 07:49:10 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD11F1008082; Wed, 7 Apr 2021 11:49:05 +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 A75565C5E1; Wed, 7 Apr 2021 11:49:05 +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 69BE41806D17; Wed, 7 Apr 2021 11:49:05 +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 137BmqBt006792 for ; Wed, 7 Apr 2021 07:48:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id A1A4D14108; Wed, 7 Apr 2021 11:48:52 +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 E6F3060C5C; Wed, 7 Apr 2021 11:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796153; 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=LdZnxDOMrJF9c75AMCe8P/aCq6jKZPRE9M0hJwIiPhM=; b=CuhEQtOefgWq/9WJgIyAoG5fmPTGBoUm8GlZ9MP422MG0MX2NGFAhz0fg09d0+mGSNL7Lh 108E8dKNBPBM4Nau3JexRhRN90NUqDLWZ3qn/gMVOD4H0BQmywkqh4LH8Ic3gZXJJ+7WcT n8RgT35pZWQACDRVl4ag7Pf306aL9d8= X-MC-Unique: WFAmR7npO_eHk1P7sG4gjw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/14] conf: Use virTristateXXX in virDomainMemballoonDef Date: Wed, 7 Apr 2021 13:48:36 +0200 Message-Id: <20210407114841.85009-10-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.79 on 10.5.11.16 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/domain_conf.c | 26 ++++++++++++++++---------- src/conf/domain_conf.h | 4 ++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2ae3080a8c..313d7fd291 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14557,18 +14557,24 @@ virDomainMemballoonDefParseXML(virDomainXMLOption= Ptr xmlopt, goto error; } =20 - if ((deflate =3D virXMLPropString(node, "autodeflate")) && - (def->autodeflate =3D virTristateSwitchTypeFromString(deflate)) <= =3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid autodeflate attribute value '%s'"), defl= ate); - goto error; + if ((deflate =3D virXMLPropString(node, "autodeflate"))) { + int value; + if ((value =3D virTristateSwitchTypeFromString(deflate)) <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid autodeflate attribute value '%s'"), = deflate); + goto error; + } + def->autodeflate =3D value; } =20 - if ((freepage_reporting =3D virXMLPropString(node, "freePageReporting"= )) && - (def->free_page_reporting =3D virTristateSwitchTypeFromString(free= page_reporting)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid freePageReporting attribute value '%s'")= , freepage_reporting); - goto error; + if ((freepage_reporting =3D virXMLPropString(node, "freePageReporting"= ))) { + int value; + if ((value =3D virTristateSwitchTypeFromString(freepage_reporting)= ) <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid freePageReporting attribute value '%= s'"), freepage_reporting); + goto error; + } + def->free_page_reporting =3D value; } =20 ctxt->node =3D node; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 445f48d8ed..cdf3e2ed8e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1922,8 +1922,8 @@ struct _virDomainMemballoonDef { int model; virDomainDeviceInfo info; int period; /* seconds between collections */ - int autodeflate; /* enum virTristateSwitch */ - int free_page_reporting; /* enum virTristateSwitch */ + virTristateSwitch autodeflate; + virTristateSwitch free_page_reporting; virDomainVirtioOptionsPtr virtio; }; =20 --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796155; cv=none; d=zohomail.com; s=zohoarc; b=Oja7dltdBJjqiBx7AdaA1IYvwZeYRC+nVFgdMQchVSjlgj5WhhFFXHIDa3/+ZYxVZ1fIdcWpzfh/s5RYRd7d1fmBX5pg+vBhMicr/6WfzQSI1ZaxBJa31Jz4RonIycNz7G/elUBehJcQ0e0xNOissnncCzwF4wzHRoyAFiP6Xtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796155; 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=IQyuotpFnvx3a4m9KtsiXd6VCS7IHM1WN4xLTpog1vI=; b=Jsj+AxTjfq/sXiZ8wSZq7Jq5Dt3kzYJbjGLmf7niYWjZ5C6wVGTLB+laotEHXD5HHT9ieiKSQXJHQCOtqqbpFZJmnzRDfzrSZ6pO8HNfJoZSJHWfHzPnv0OCz9JjsNlgm6xZJguUAqAq7uSnx47dhhNo5DJaUVg/Vn5SRNYgCec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796155721604.7280452080903; Wed, 7 Apr 2021 04:49:15 -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-351-i7WG4pMROQyCYGBEBADs_g-1; Wed, 07 Apr 2021 07:49:11 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 134AA10168CE; Wed, 7 Apr 2021 11:49:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A68AF5FCB5; Wed, 7 Apr 2021 11:49:04 +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 5D1FC55344; Wed, 7 Apr 2021 11:49:04 +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 137Bmr1l006802 for ; Wed, 7 Apr 2021 07:48:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id AEF8A14108; Wed, 7 Apr 2021 11:48:53 +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 0032B608BA; Wed, 7 Apr 2021 11:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796154; 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=IQyuotpFnvx3a4m9KtsiXd6VCS7IHM1WN4xLTpog1vI=; b=QxmCo+lf+b0Wu6PR/soa3Z8RcCwHh8TiDrBgdL03Xnwu2qI5AePyAbUsDD4fmW6E9S5S2n ytnNzyDfxqja4pC82bmJ0J3ZNvpxl6zAWKO0BECfeBvCeQeWWH4qZrb6ktQbFfaFmHhyqo g12dZcTSYd/QlMCQgAlX+B2+WxHq9jo= X-MC-Unique: i7WG4pMROQyCYGBEBADs_g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 10/14] conf: Use virTristateXXX in virDomainLoaderDef Date: Wed, 7 Apr 2021 13:48:37 +0200 Message-Id: <20210407114841.85009-11-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.79 on 10.5.11.12 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/domain_conf.c | 26 ++++++++++++++++---------- src/conf/domain_conf.h | 4 ++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 313d7fd291..24d124158e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19209,18 +19209,24 @@ virDomainLoaderDefParseXML(xmlNodePtr node, VIR_FREE(loader->path); } =20 - if (readonly_str && - (loader->readonly =3D virTristateBoolTypeFromString(readonly_str))= <=3D 0) { - virReportError(VIR_ERR_XML_DETAIL, - _("unknown readonly value: %s"), readonly_str); - return -1; + if (readonly_str) { + int value; + if ((value =3D virTristateBoolTypeFromString(readonly_str)) <=3D 0= ) { + virReportError(VIR_ERR_XML_DETAIL, + _("unknown readonly value: %s"), readonly_str); + return -1; + } + loader->readonly =3D value; } =20 - if (secure_str && - (loader->secure =3D virTristateBoolTypeFromString(secure_str)) <= =3D 0) { - virReportError(VIR_ERR_XML_DETAIL, - _("unknown secure value: %s"), secure_str); - return -1; + if (secure_str) { + int value; + if ((value =3D virTristateBoolTypeFromString(secure_str)) <=3D 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("unknown secure value: %s"), secure_str); + return -1; + } + loader->secure =3D value; } =20 if (type_str) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cdf3e2ed8e..b2e14ba2e1 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2153,9 +2153,9 @@ VIR_ENUM_DECL(virDomainLoader); =20 struct _virDomainLoaderDef { char *path; - int readonly; /* enum virTristateBool */ + virTristateBool readonly; virDomainLoader type; - int secure; /* enum virTristateBool */ + virTristateBool secure; char *nvram; /* path to non-volatile RAM */ char *templt; /* user override of path to master nvram */ }; --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 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=h4jsGEDqPKb9wK/PkJ1w/9Knm3sQcn2g39xoz5vEWBrPJy2RD4y7jwdacjmincgrFI7CbNFWc7G5ameSpFx9M6939qZyhVeIVMufsvq6MmH6aZGs0XRCwd1VHT2DYDVd3lXtbZ7cxWYVvh1Mu8erlTXOSSBPmIbX1x4n7kqJcHc= 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=ckEGl3g1LyiAtmle8EKD6ltKQ/kNv2C925VVejcTzD8=; b=hsbhz5Eg0dtEEIGqn62tqh1utK6OsTnmgn1A6hxWWpjB2o5+z2ZQ7DlftI3Vvs6snr9cMrRX5uqZxDvhzGMfxCp11QVK9XrYLG04rTy1nbcnG79fVJwPWHyexT7O3VwqdZkltoWMAgrZmYvBHnXEkLtAOZpI/W5Tch6s3uv/Opc= 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 1617796158138434.0251897249369; 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-472-cSoT2T7TMMWc0-mj2wtUuw-1; Wed, 07 Apr 2021 07:49:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1752E99C0; Wed, 7 Apr 2021 11:49:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F0079F6A; Wed, 7 Apr 2021 11:49:09 +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 1E4EB55342; 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 137BmsUb006810 for ; Wed, 7 Apr 2021 07:48:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD60014108; Wed, 7 Apr 2021 11:48:54 +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 0D7FA608BA; Wed, 7 Apr 2021 11:48:53 +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=ckEGl3g1LyiAtmle8EKD6ltKQ/kNv2C925VVejcTzD8=; b=UVUwm0cqI1aqrUeI3tG2A6YIC5Koueg1to2PNlNpg+s5mkWElLGyL3YLTWTpeoqzeL+J93 6gevgc9vDiXsZ6DmvBCQ/1hiOZ95gl0Epwst2bId7oEDq37TpDdropFbPO5xBKqh3j2hEE yh/Wf1VJPTIWBri/8Je+cy5fH4msbRY= X-MC-Unique: cSoT2T7TMMWc0-mj2wtUuw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 11/14] conf: Use virTristateXXX in virDomainDef Date: Wed, 7 Apr 2021 13:48:38 +0200 Message-Id: <20210407114841.85009-12-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.79 on 10.5.11.12 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/domain_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b2e14ba2e1..e53f5d1b47 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2756,7 +2756,7 @@ struct _virDomainDef { virDomainHPTResizing hpt_resizing; unsigned long long hpt_maxpagesize; /* Stored in KiB */ char *hyperv_vendor_id; - int apic_eoi; + virTristateSwitch apic_eoi; =20 bool tseg_specified; unsigned long long tseg_size; --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796153; cv=none; d=zohomail.com; s=zohoarc; b=MxjmDDHs84BXH1U5t125ufCwj0M0MsCieyXUfkSvNU1t7jEDV74vvOvuNTAF4ajjI+E3RCS9JLfKFAZ5O00qMEWJeTRpw5rGA1An5PzozEG9zVdOSMWz7NU0AGEvshZNOHFCei+Z622Th1QYPjgDBkH/RO0LL37Vv/8FfYaF0qg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796153; 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=j6ao+lUl8+yj08XuBPBwl7CQ/XHpPONWliVbz2VDPbA=; b=XGKVKY65NwkQGoaZg++vFk+oRp2Saw0HlXhiwF8Ag32zD8lWLKgBAewY3ZxdIpnPn5MIHaus8dNDMhv4JUZm6VwCAa56DCsxFrmwCU4OeyB8VbiARnT1BTzgxVpTF832wqyjq6/H2sbbMs4zgijZhZZEZHjb0QdTILMhYmpuOps= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796153238199.48670234208737; Wed, 7 Apr 2021 04:49:13 -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-477-LS3YhApJMYWdKKmL-Chj0Q-1; Wed, 07 Apr 2021 07:49:10 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7C5E2107ACE4; Wed, 7 Apr 2021 11:49:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 385061690D; Wed, 7 Apr 2021 11:49:03 +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 E775155344; Wed, 7 Apr 2021 11:49:02 +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 137BmtO2006816 for ; Wed, 7 Apr 2021 07:48:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id C6C4C14108; Wed, 7 Apr 2021 11:48:55 +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 1B64260C5C; Wed, 7 Apr 2021 11:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796152; 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=j6ao+lUl8+yj08XuBPBwl7CQ/XHpPONWliVbz2VDPbA=; b=QyKJn9qA61jQYuZOYv0/6tPNGgvhRXX7Yn8fhLqOZ/1T05lDvjRSCY1phLZP0vUEWj10kg ip2vwE5S2ebp2j5GMDUJ0Pihfb7Qvapw1mVvjwmQgCbhZv+62+HN4LzZUfdknrCamVYAyx aHI+vliwdgz8xxp3xy9GgwrHHF+0wpA= X-MC-Unique: LS3YhApJMYWdKKmL-Chj0Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 12/14] conf: Use virTristateXXX in virStorageAdapterFCHost Date: Wed, 7 Apr 2021 13:48:39 +0200 Message-Id: <20210407114841.85009-13-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.79 on 10.5.11.12 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" Note that the comment for virStorageAdapterFCHost::managed was wrong. Signed-off-by: Tim Wiederhake --- src/conf/storage_adapter_conf.c | 4 +++- src/conf/storage_adapter_conf.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_con= f.c index 77ecb8d5f2..69062b4b58 100644 --- a/src/conf/storage_adapter_conf.c +++ b/src/conf/storage_adapter_conf.c @@ -68,13 +68,15 @@ virStorageAdapterParseXMLFCHost(xmlNodePtr node, =20 fchost->parent =3D virXMLPropString(node, "parent"); if ((managed =3D virXMLPropString(node, "managed"))) { - if ((fchost->managed =3D virTristateBoolTypeFromString(managed)) <= 0) { + int value; + if ((value =3D virTristateBoolTypeFromString(managed)) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown fc_host managed setting '%s'"), managed); VIR_FREE(managed); return -1; } + fchost->managed =3D value; } =20 fchost->parent_wwnn =3D virXMLPropString(node, "parent_wwnn"); diff --git a/src/conf/storage_adapter_conf.h b/src/conf/storage_adapter_con= f.h index 4c7da7c8d9..3f64cda9af 100644 --- a/src/conf/storage_adapter_conf.h +++ b/src/conf/storage_adapter_conf.h @@ -51,7 +51,7 @@ struct _virStorageAdapterFCHost { char *parent_fabric_wwn; char *wwnn; char *wwpn; - int managed; /* enum virTristateSwitch */ + virTristateBool managed; }; =20 typedef struct _virStorageAdapter virStorageAdapter; --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796162; cv=none; d=zohomail.com; s=zohoarc; b=TAJvfoo/qcmnBuUxxu+etnLAp8XL++tWhdy7l4ULyc7cdQY9WyA4/3emp8rprAPtTB1aPkQoQDXayMo1d3aVoUxIE2ypBvKNDxcTsawUZtzM3pnFbpM9WG665tCGzoTCLB1RGvnQx1LXRJq3ErYzO30Iv5CvVKjQyjTSK2dUTPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796162; 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=/bcXqZeDP5d4GGECUWsPTeX7A16nmM6SsYGyT0a/FZg=; b=g5SZBSe44ufIjjxqNU8+q9UcI/HaoayEi1cAnT52G2ubnlQ0JrYVYbS1QHIZ8Ft6Bv0wHuAphDd5ySMMOch4/Xre3SBV0pYyS/d3KwiswQvlHT4A22SfXEZEn0+WwuJwsJQXmjLuk7E7aHSMqrVlJrwdYAHnuFoOmLP5GPiuUiM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796162921859.65093303365; Wed, 7 Apr 2021 04:49:22 -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-539-OjCGgvgaPgKc4ZWNKih72Q-1; Wed, 07 Apr 2021 07:49:19 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D87D3107ACF4; Wed, 7 Apr 2021 11:49:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE5441037E8B; Wed, 7 Apr 2021 11:49:12 +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 734B955347; Wed, 7 Apr 2021 11:49:12 +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 137BmuLs006836 for ; Wed, 7 Apr 2021 07:48:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id D1A3A60C5C; Wed, 7 Apr 2021 11:48:56 +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 2406F60854; Wed, 7 Apr 2021 11:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796161; 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=/bcXqZeDP5d4GGECUWsPTeX7A16nmM6SsYGyT0a/FZg=; b=WxYxKd2U0OCfnSt2vsqXwv7q4FQdTwptlONl3MtwAGSC99/f2vcoWUuir9nOq/LOJM+wrI F5Iy9pDd7AzGcb37n9N4DPf/8ZXGikMZrZ6XkalOZp3gvsCTEEFTtR0SU6dzu1EWp4YrT+ DUilfNIl4r5Yv7/PdTps1uc1MmuUEJI= X-MC-Unique: OjCGgvgaPgKc4ZWNKih72Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 13/14] conf: Use virTristateXXX in virStoragePoolSourceDevice Date: Wed, 7 Apr 2021 13:48:40 +0200 Message-Id: <20210407114841.85009-14-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.22 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" Note that the comment for virStoragePoolSourceDevice::part_separator was wr= ong. Signed-off-by: Tim Wiederhake --- src/conf/storage_conf.c | 7 ++++--- src/conf/storage_conf.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 310a062ee7..e92de7e6a3 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -617,14 +617,15 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, =20 partsep =3D virXMLPropString(nodeset[i], "part_separator"); if (partsep) { - dev.part_separator =3D virTristateBoolTypeFromString(partsep); - if (dev.part_separator <=3D 0) { + int value =3D virTristateBoolTypeFromString(partsep); + if (value <=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("invalid part_separator setting '%s'"), partsep); virStoragePoolSourceDeviceClear(&dev); goto cleanup; } + dev.part_separator =3D value; } =20 if (VIR_APPEND_ELEMENT(source->devices, source->ndevice, dev) < 0)= { @@ -1097,7 +1098,7 @@ virStoragePoolSourceFormat(virBufferPtr buf, virBufferEscapeString(buf, "devices[i].path); if (src->devices[i].part_separator !=3D - VIR_TRISTATE_SWITCH_ABSENT) { + VIR_TRISTATE_BOOL_ABSENT) { virBufferAsprintf(buf, " part_separator=3D'%s'", virTristateBoolTypeToString(src->devices= [i].part_separator)); } diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 647eb847bf..8d417af7bb 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -168,7 +168,7 @@ struct _virStoragePoolSourceDevice { virStoragePoolSourceDeviceExtentPtr freeExtents; char *path; int format; /* Pool specific source format */ - int part_separator; /* enum virTristateSwitch */ + virTristateBool part_separator; =20 /* When the source device is a physical disk, * the geometry data is needed --=20 2.26.2 From nobody Fri Apr 26 06:30:50 2024 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