From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054538; cv=none; d=zohomail.com; s=zohoarc; b=IjkXsvC9axNZRsCpK2M8N46E3GrTnySBxiCcqRxEBW7xtAi4Yg3XiS4IOu8TPM9IkBULcb7+b1YH5+2p7YD14sDflr6OB0ITXK11F1REFuXnVehzVySCFQXRT4jTCpPLufIuKkknQGAfgW/hulxYfAuqZyMjLXDI5sgT0UzOT0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054538; 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=8T1Ag+0Cl0J7LkU/8Ghkpw8Y8QZW2k6PjGulGCEAQy8=; b=N67sXtbyRRsyx2Ws6cBJvicIPxf5TvPdAShw2Uq065Anp09wCRMR6Wm1ITT5EDDnDjxVbzcmsyk+DifTd+vN2SDNIgNPYxIKD+uwV1n2kGs1Kl0lHnPTnO/Z+IOct6E5uTKFiYRJzafl4lYqdWrG8rPUXABBcrufdkHEVHBki6o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054537617278.58594803514654; Thu, 18 Mar 2021 01:02:17 -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-340-u6cmtT85NaqaTMIg6BP6dQ-1; Thu, 18 Mar 2021 04:01:42 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF5188189D2; Thu, 18 Mar 2021 08:01:36 +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 877DC69108; Thu, 18 Mar 2021 08:01:36 +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 11DEC1809C83; Thu, 18 Mar 2021 08:01:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81Ot1028124 for ; Thu, 18 Mar 2021 04:01:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 289D066A16; Thu, 18 Mar 2021 08:01:24 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BC55669F2; Thu, 18 Mar 2021 08:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054504; 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=8T1Ag+0Cl0J7LkU/8Ghkpw8Y8QZW2k6PjGulGCEAQy8=; b=IFnP6hei8C2JNaInxoUa48elcgMsQ+aplZ2TBkq/+kKa+0LARsap8aqkK711eex0EtvYnP xuXdeFZ/SmtUoXu57GJp8bUpbLaNxJbjgtxEkeufvuJ4jGAGtOEPNC3BQLfjQcFKNHuj/3 XIx0fDYbOEHW1b10wKHEg0p1HBwimiw= X-MC-Unique: u6cmtT85NaqaTMIg6BP6dQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/38] virStorageAdapterFCHost: Fix comment Date: Thu, 18 Mar 2021 09:00:40 +0100 Message-Id: <20210318080117.70255-2-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.11 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 Reviewed-by: Michal Privoznik --- src/conf/storage_adapter_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/storage_adapter_conf.h b/src/conf/storage_adapter_con= f.h index 4c7da7c8d9..93879acb6e 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 */ + int managed; /* enum virTristateBool */ }; =20 typedef struct _virStorageAdapter virStorageAdapter; --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054511; cv=none; d=zohomail.com; s=zohoarc; b=HGROGv8a+u/IYa/dkEL24onxBpeuAVZhr54ruNRvrwhuhVZDrjWJ/u4fbn0y2l4MAEkjqFR9HnykkwCxejmLPFQeHfijU4VIRtmPN8mjRQXxEd98t/QegDbWFNa++GEBGyINyuBA3pzGA4t77mbsC0ikReTboOQtoDrigWqFz3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054511; 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=SRs5SIveEfJa4GutIbum6Opqsgnvauwh5Cg+ywWYOVo=; b=U0BtMXZSQIP66/CHfdSuOiGVkhIvLgMGXLueRQkcO6k+v4oz6V68AnldrkU42upBY7I606bAbPinpH5TNVrtWTNA/fQgN7mFk4nqEAVutY8kdKw89v13+98hnCVD7mt09QBU0fSOIhixqY36QUCaLPgYMPFmBBgVOZbON/bBypg= 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 1616054511771236.5239234454035; Thu, 18 Mar 2021 01:01:51 -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-361-8xjVvj-xNQCR6PXs75e8Cw-1; Thu, 18 Mar 2021 04:01:48 -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 D06B110866BF; Thu, 18 Mar 2021 08:01:40 +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 A46245D9D3; Thu, 18 Mar 2021 08:01:40 +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 5C6494A703; Thu, 18 Mar 2021 08:01:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81Pq4028133 for ; Thu, 18 Mar 2021 04:01:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4747B66A05; Thu, 18 Mar 2021 08:01:25 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CBA3669F2; Thu, 18 Mar 2021 08:01:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054510; 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=SRs5SIveEfJa4GutIbum6Opqsgnvauwh5Cg+ywWYOVo=; b=CxdUVK1N1fJHMenXHUKTm+wPWfzZrBR6a70uBSqIRt+HFLHyFuhentCbLdpgOLTYJbMLf3 hqv28V+xFhHGr3lIo7Ar31NqA/rAMLY1wnOZP1b/dKw5g64iR08Nr6721eI8doLBQH1wdF UC/hWF0MheBQHNel98Y6agGOhdK2yzw= X-MC-Unique: 8xjVvj-xNQCR6PXs75e8Cw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 02/38] virxml: Add virXMLPropYesNo Date: Thu, 18 Mar 2021 09:00:41 +0100 Message-Id: <20210318080117.70255-3-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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" Convenience function to return value of a yes / no attribute. Does not use virTristateBoolTypeFromString to disallow "default". Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/util/virxml.c | 37 +++++++++++++++++++++++++++++++++++++ src/util/virxml.h | 4 ++++ 2 files changed, 41 insertions(+) diff --git a/src/util/virxml.c b/src/util/virxml.c index 060b7530fc..47e8414bd5 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -556,6 +556,43 @@ virXMLNodeContentString(xmlNodePtr node) } =20 =20 +/** + * virXMLPropYesNo: + * @node: XML dom node pointer + * @name: Name of the property (attribute) to get + * @value: The returned virTristateBool value + * + * Convenience function to return value of a yes / no attribute. + * + * Returns 1 in case of success in which case @value is set, + * or 0 if the attribute is not present, + * or -1 and reports an error on failure. + */ +int +virXMLPropYesNo(xmlNodePtr node, const char* name, virTristateBool *value) +{ + g_autofree char *tmp =3D virXMLPropString(node, name); + + if (!tmp) + return 0; + + if (STREQ("yes", tmp)) { + *value =3D VIR_TRISTATE_BOOL_YES; + return 1; + } + + if (STREQ("no", tmp)) { + *value =3D VIR_TRISTATE_BOOL_NO; + return 1; + } + + virReportError(VIR_ERR_XML_ERROR, + _("Invalid value for attribute '%s' in node '%s': '%s'.= Expected 'yes' or 'no'"), + name, node->name, tmp); + return -1; +} + + /** * virXPathBoolean: * @xpath: the XPath string to evaluate diff --git a/src/util/virxml.h b/src/util/virxml.h index d32f77b867..072948b3e2 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -28,6 +28,7 @@ #include =20 #include "virbuffer.h" +#include "virenum.h" =20 xmlXPathContextPtr virXMLXPathContextNew(xmlDocPtr xml) G_GNUC_WARN_UNUSED_RESULT; @@ -77,6 +78,9 @@ char * virXMLPropStringLimit(xmlNodePtr node, const char *name, size_t maxlen); char * virXMLNodeContentString(xmlNodePtr node); +int virXMLPropYesNo(xmlNodePtr node, + const char *name, + virTristateBool *value); =20 /* Internal function; prefer the macros below. */ xmlDocPtr virXMLParseHelper(int domcode, --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054500; cv=none; d=zohomail.com; s=zohoarc; b=W8k8ZRc+W3yXYRf3fBwewMkJhuqxJg7qr0+G5B2N9+CM7YV4QDPi7vbtZ5yjBkqmYIKYfAt2V4NoUnxVoSzsdWMw11WLJii9bb5qxWxsGI1SpASnqrcZzCrImGdmCSdPTIIWjQanufWyPqSt50JrdUVaJ6m+KpmyyCspLIJHGl8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054500; 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=2w5osUfTibKeF1ntemUfdjbj2l4Ep+a07SgBEFrxtCU=; b=Vk5N6IxOMKEcMWJ1Zo2DX2G2GF92hBa6CFTzqkqBydjkRmnoLpyXWwFpgWI7AfuHAr/Jn+YlQIeq/Zi+SOFWEdGkTxhdLw+xLotRqD1PMRtKAjasmxQp8WKBw8S17AI7G5iJ/GA8nQmkLYquCtv9P51s4RKOOHhl8kiHv/fCDuA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054500397974.8306554293928; Thu, 18 Mar 2021 01:01:40 -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-510-3bgwZqCdOjyn7NYm4vj1BQ-1; Thu, 18 Mar 2021 04:01:36 -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 0B0B8800FF0; Thu, 18 Mar 2021 08:01:30 +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 DAC5D60C13; Thu, 18 Mar 2021 08:01:29 +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 963904BB7C; Thu, 18 Mar 2021 08:01:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81QFf028139 for ; Thu, 18 Mar 2021 04:01:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6D38D66A05; Thu, 18 Mar 2021 08:01:26 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4D1366FFF; Thu, 18 Mar 2021 08:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054498; 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=2w5osUfTibKeF1ntemUfdjbj2l4Ep+a07SgBEFrxtCU=; b=Qo/fq/xu5vzcbFNhNQBbMtwjSlJwa//udG1N/r5j3q7v+EM1kXzL0rf2rsHQyugtT8Hldt 29jPqn0NQt6eY9vPXKtaXSgNB4uT3oTNx9lNopkEGDdTLmj4+4EhjG+HKzIDrS9rmZAJVD zifMp0wRAiYz5FELhh0CMml9v8ZFbKA= X-MC-Unique: 3bgwZqCdOjyn7NYm4vj1BQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/38] virxml: Add virXMLPropOnOff Date: Thu, 18 Mar 2021 09:00:42 +0100 Message-Id: <20210318080117.70255-4-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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" Convenience function to return value of an on / off attribute. Does not use virTristateSwitchTypeFromString to disallow "default". Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/util/virxml.c | 37 +++++++++++++++++++++++++++++++++++++ src/util/virxml.h | 3 +++ 2 files changed, 40 insertions(+) diff --git a/src/util/virxml.c b/src/util/virxml.c index 47e8414bd5..7c06530d25 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -593,6 +593,43 @@ virXMLPropYesNo(xmlNodePtr node, const char* name, vir= TristateBool *value) } =20 =20 +/** + * virXMLPropOnOff: + * @node: XML dom node pointer + * @name: Name of the property (attribute) to get + * @value: The returned virTristateSwitch value + * + * Convenience function to return value of an on / off attribute. + * + * Returns 1 in case of success in which case @value is set, + * or 0 if the attribute is not present, + * or -1 and reports an error on failure. + */ +int +virXMLPropOnOff(xmlNodePtr node, const char* name, virTristateSwitch *valu= e) +{ + g_autofree char *tmp =3D virXMLPropString(node, name); + + if (!tmp) + return 0; + + if (STREQ("on", tmp)) { + *value =3D VIR_TRISTATE_SWITCH_ON; + return 1; + } + + if (STREQ("off", tmp)) { + *value =3D VIR_TRISTATE_SWITCH_OFF; + return 1; + } + + virReportError(VIR_ERR_XML_ERROR, + _("Invalid value for attribute '%s' in node '%s': '%s'.= Expected 'on' or 'off'"), + name, node->name, tmp); + return -1; +} + + /** * virXPathBoolean: * @xpath: the XPath string to evaluate diff --git a/src/util/virxml.h b/src/util/virxml.h index 072948b3e2..d0577723ef 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -81,6 +81,9 @@ char * virXMLNodeContentString(xmlNodePtr node); int virXMLPropYesNo(xmlNodePtr node, const char *name, virTristateBool *value); +int virXMLPropOnOff(xmlNodePtr node, + const char *name, + virTristateSwitch *value); =20 /* Internal function; prefer the macros below. */ xmlDocPtr virXMLParseHelper(int domcode, --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054517; cv=none; d=zohomail.com; s=zohoarc; b=H32yxrFgNLuFu6eKg/53ekDdYTGA1RVKOZzp4GZ1TH4LPpOhEiQ9PeLLqxCg5mgEfenXAkv5XZmEL/QBkAxJM2UkOPdXx276+j3p2DrSO7KdWGMQyHSwuH5XxqTh1chmwr3aJj7EniHg2H88Ws7Fauq8lPBmJPhKfYX74v8sEtw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054517; 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=DHC8hxma1wzi2ob+ncuXN1xrkMspfYC8TdcU5gXYWMs=; b=jGLCIKHkmKaYc8AkJ192ZlM+dP4EgBIdAum77vB0PVJvXj9s99sHxDyO0HlEEgKGt8wtar/hv/GLwVPRSpij8rjXnzicDNEJZiODbL+IDME1kT0br4NXR8bS4lZ3h7YQ5PHeS0oTD9HjHXRoTZA+zYHgw8Mv9jkSV7fovZcQ6k8= 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 161605451782769.98185193933068; Thu, 18 Mar 2021 01:01:57 -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-112-YoVDVdz2Mh2VuWM54ayFNg-1; Thu, 18 Mar 2021 04:01:53 -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 121D6814339; Thu, 18 Mar 2021 08:01:48 +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 A70467086A; Thu, 18 Mar 2021 08:01:47 +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 637354A708; Thu, 18 Mar 2021 08:01:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81R9S028149 for ; Thu, 18 Mar 2021 04:01:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 705CD66FFF; Thu, 18 Mar 2021 08:01:27 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB165669F2; Thu, 18 Mar 2021 08:01:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054515; 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=DHC8hxma1wzi2ob+ncuXN1xrkMspfYC8TdcU5gXYWMs=; b=EMbylzV9ffuAZtm/DLqtio4AJHlRP93ipFC84xLGgZVREowMgkRYdWeuxDRmRJbCUFirCe VV8lGYxau8DBfvo0SGA5Phi3Kzxey5cD++VvtG68dL/PZzCVFCXxH0p2qPKoVHs2vpDHvX Cb2Y6//xT7Gu2LTlvfstiPXNJ6LsiFU= X-MC-Unique: YoVDVdz2Mh2VuWM54ayFNg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainKeyWrapCipherDefParseXML Date: Thu, 18 Mar 2021 09:00:43 +0100 Message-Id: <20210318080117.70255-5-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 47756ff0be..b6e505b384 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1441,10 +1441,9 @@ static int virDomainKeyWrapCipherDefParseXML(virDomainKeyWrapDefPtr keywrap, xmlNodePtr node) { - int state_type; + virTristateSwitch state_type =3D VIR_TRISTATE_SWITCH_ABSENT; int name_type; g_autofree char *name =3D NULL; - g_autofree char *state =3D NULL; =20 if (!(name =3D virXMLPropString(node, "name"))) { virReportError(VIR_ERR_CONF_SYNTAX, "%s", @@ -1458,15 +1457,11 @@ virDomainKeyWrapCipherDefParseXML(virDomainKeyWrapD= efPtr keywrap, return -1; } =20 - if (!(state =3D virXMLPropString(node, "state"))) { - virReportError(VIR_ERR_CONF_SYNTAX, - _("missing state for cipher named %s"), name); + if (virXMLPropOnOff(node, "state", &state_type) < 0) return -1; - } - - if ((state_type =3D virTristateSwitchTypeFromString(state)) < 0) { + if (state_type =3D=3D VIR_TRISTATE_SWITCH_ABSENT) { virReportError(VIR_ERR_CONF_SYNTAX, - _("%s is not a supported cipher state"), state); + _("missing state for cipher named %s"), name); return -1; } =20 --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054538; cv=none; d=zohomail.com; s=zohoarc; b=lJ045ZS4JTpnAlXGia9V3DQV7gXfO0foJAtj/UoeaquhVraprutYoih1dY82qlWwM21WNJSDtErhjIXdnlsBwyV7ImPuwn2z5k84p/4LuyZVxw7J6muDJn7ut6q/ErkvvGj1ok8p4KY5ZXK12/tUE6lcZhYEV1XpX+1AihiIfm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054538; 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=cO1BbFAqP9F9z1ai9kAcVmOwXVXUqSp9KMp3vlnlQaQ=; b=PA89iJQlCIrofbAS5zpj1FL3KwdpIMe3Lt8EtX9lFCemntPZo+b4HJvyT7byfKLX5vTq8LCAtCZVSxU7Zzw/BHu4yKnj5VjnigSESb3R2NjQr/ydjA1t9pU3TxuFF1GI8hSSeC/24v7b4gbIByOlg70I98k6MUemaTSxTpWRwKk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054538504468.0268347072812; Thu, 18 Mar 2021 01:02: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-288-WYwownfaMhKbrSWZR2bRbQ-1; Thu, 18 Mar 2021 04:01:43 -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 C676D8189D3; Thu, 18 Mar 2021 08:01:36 +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 9CFB96F973; Thu, 18 Mar 2021 08:01:36 +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 516B21809C82; Thu, 18 Mar 2021 08:01:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81SMT028161 for ; Thu, 18 Mar 2021 04:01:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7F8BC66A16; Thu, 18 Mar 2021 08:01:28 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id C275B669F2; Thu, 18 Mar 2021 08:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054505; 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=cO1BbFAqP9F9z1ai9kAcVmOwXVXUqSp9KMp3vlnlQaQ=; b=BMqdsVQFCYmpmpE53L8QpGVMOSmbsco5R28cJ1DqZnPkSsZ7CPONhGg3Bzb4GzVlzJVV0t 4o1tZvTc7BzSctOfiqp1UAWfq39EKqwmOw/NPWM0QTA8HdAParyU7yW0G4heZEK3N8cEx+ zN3eQRwZbB3sXniIApI2PuxMl0kPA4c= X-MC-Unique: WYwownfaMhKbrSWZR2bRbQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainVirtioOptionsParseXML Date: Thu, 18 Mar 2021 09:00:44 +0100 Message-Id: <20210318080117.70255-6-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b6e505b384..3a4b01ad1e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1590,9 +1590,7 @@ static int virDomainVirtioOptionsParseXML(xmlNodePtr driver, virDomainVirtioOptionsPtr *virtio) { - int val; virDomainVirtioOptionsPtr res; - g_autofree char *str =3D NULL; =20 if (*virtio || !driver) return 0; @@ -1601,34 +1599,14 @@ virDomainVirtioOptionsParseXML(xmlNodePtr driver, =20 res =3D *virtio; =20 - if ((str =3D virXMLPropString(driver, "iommu"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("invalid iommu value")); - return -1; - } - res->iommu =3D val; - } - VIR_FREE(str); + if (virXMLPropOnOff(driver, "iommu", &res->iommu) < 0) + return -1; =20 - if ((str =3D virXMLPropString(driver, "ats"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("invalid ats value")); - return -1; - } - res->ats =3D val; - } - VIR_FREE(str); + if (virXMLPropOnOff(driver, "ats", &res->ats) < 0) + return -1; =20 - if ((str =3D virXMLPropString(driver, "packed"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("invalid packed value")); - return -1; - } - res->packed =3D val; - } + if (virXMLPropOnOff(driver, "packed", &res->packed) < 0) + return -1; =20 return 0; } --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054510; cv=none; d=zohomail.com; s=zohoarc; b=kd6zz40rr2zZ33PYUWA2YtKCFy3BtAQ8fSq+JbiIK1LROXXVQV+ZSPbcWURmZL7zAfGgJYgxb78UxCp+rE6u3U+dsjb0kCK4r6+CC5GzpmL4U1U1bCR0IjsF158qz1cMCh5AEtiU2v8b0fZpt5OBPxWNAsfUt38NoKiY79h8Fsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054510; 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=72yxgYViobxy3G8l77eAovb+cAtqTTJuw1E+kOWTzYE=; b=HHMZfasZVPJHy7Q3yoD+JsLZ6jh0Xf2mt9h/IIuxRNPLvvUS7kB85abjvAT4hjN4BZlSmpnbNpZVBYX9M9HnqXDxpDtsFn2EviNVIWS+gdWNqZ1h/VMyAio749tj3EKMNFt8UTNwPSuFRRxMd7FwkgeP9Cd01gBafqamBG84Ik4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054510855889.5838551432809; Thu, 18 Mar 2021 01:01:50 -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-544-18daMksLMs6SdM-NHgSqzA-1; Thu, 18 Mar 2021 04:01:46 -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 C19AC10866BC; Thu, 18 Mar 2021 08:01:40 +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 9A4805FC17; Thu, 18 Mar 2021 08:01:40 +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 527ED4A701; Thu, 18 Mar 2021 08:01:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81TVd028169 for ; Thu, 18 Mar 2021 04:01:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8B8CA66A05; Thu, 18 Mar 2021 08:01:29 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0AC7669F2; Thu, 18 Mar 2021 08:01:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054509; 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=72yxgYViobxy3G8l77eAovb+cAtqTTJuw1E+kOWTzYE=; b=ZFA1gOBQr71eCX6e+a5CuavwzzYcOCghUBKWd/7st8XAmt2p8Y+8Vxl6S+CK7Hdn/FwKS/ uReUKEiXsa9DWqjq5Iu2vU9mpzoFpg4QMHYIJfu65oBEMcr5tG/OEC6JOWuAjEYEpQr/oQ /u0OMEcmtgnzcWK+0iw/+J7n0nXNtQg= X-MC-Unique: 18daMksLMs6SdM-NHgSqzA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 06/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainDeviceInfoParseXML Date: Thu, 18 Mar 2021 09:00:45 +0100 Message-Id: <20210318080117.70255-7-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3a4b01ad1e..e1b2baf621 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6620,8 +6620,6 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xml= opt, xmlNodePtr boot =3D NULL; xmlNodePtr rom =3D NULL; int ret =3D -1; - g_autofree char *romenabled =3D NULL; - g_autofree char *rombar =3D NULL; g_autofree char *aliasStr =3D NULL; =20 virDomainDeviceInfoClear(info); @@ -6673,18 +6671,17 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr x= mlopt, } =20 if (rom) { - if ((romenabled =3D virXMLPropString(rom, "enabled")) && - ((info->romenabled =3D virTristateBoolTypeFromString(romenable= d)) <=3D 0)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown rom enabled value '%s'"), romenabled= ); + virTristateBool romenabled =3D VIR_TRISTATE_BOOL_ABSENT; + virTristateSwitch rombar =3D VIR_TRISTATE_SWITCH_ABSENT; + + if (virXMLPropYesNo(rom, "enabled", &romenabled) < 0) goto cleanup; - } - if ((rombar =3D virXMLPropString(rom, "bar")) && - ((info->rombar =3D virTristateSwitchTypeFromString(rombar)) <= =3D 0)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown rom bar value '%s'"), rombar); + + if (virXMLPropOnOff(rom, "bar", &rombar) < 0) goto cleanup; - } + + info->romenabled =3D romenabled; + info->rombar =3D rombar; info->romfile =3D virXMLPropString(rom, "file"); =20 if (info->romenabled =3D=3D VIR_TRISTATE_BOOL_NO && --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054521; cv=none; d=zohomail.com; s=zohoarc; b=Iy3ezTah260x3VVjMkSl4MgrjE7D3YZ8KALLq/dUsM8ShQG2WTrtdqZ/9s6hEvQPOeezkvnNltrhP4fZgztiSnBKv6yEwMLWYMvMrrExC8hvRwA75iRIxNdgmIK65PicKAIDXimY5JkiLYyGfdUifYdDYdRFvOfFXW62bwhhqqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054521; 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=pI0AycasS9urG/Jnqxr38lBJapwabKKUFOzmNuHRKg0=; b=Fb1K0MBSa9NK4nvNnn4l2p2RUQPPtwJykZHmfuWbq64c/je+A4yHKjv/EPNHb29yCLTI0KuAVm8hXekaDU4Kijy2BWd+bmGxbSvaNb+4aoMlwBhFHlgV2p4RRmXAEJvGK4WyrulorShdISeg/k/5xFndi2WZAL7lIty4ZBttCX0= 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 161605452156298.83694842139084; Thu, 18 Mar 2021 01:02:01 -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-359-cKzYsqgTOcCnKly-E_zvgw-1; Thu, 18 Mar 2021 04:01:57 -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 546318015BD; Thu, 18 Mar 2021 08:01:51 +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 25EE710027A5; Thu, 18 Mar 2021 08:01:51 +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 B3D881800662; Thu, 18 Mar 2021 08:01:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81UoV028184 for ; Thu, 18 Mar 2021 04:01:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 994F166A16; Thu, 18 Mar 2021 08:01:30 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF544669F2; Thu, 18 Mar 2021 08:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054520; 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=pI0AycasS9urG/Jnqxr38lBJapwabKKUFOzmNuHRKg0=; b=MlszcHsLs0OQrbWNgMMm90E8Wt5KSSuwICS8dbM2jMqidwLfGHVBO2cHySjVfsrBPB/xvf hCGxYcKXqklzoYm3DKInNHEuZKpQcT7e0RKukDTcjelpCUWhf7se0NT/12CR9mqnfiM4Ay fdiSCn9GB08PNS9w6N1DvyRGNeK4Ptk= X-MC-Unique: cKzYsqgTOcCnKly-E_zvgw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainDiskSourceNetworkParse Date: Thu, 18 Mar 2021 09:00:46 +0100 Message-Id: <20210318080117.70255-8-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e1b2baf621..55920e7a7d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8303,9 +8303,9 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node, { int tlsCfgVal; g_autofree char *protocol =3D NULL; - g_autofree char *haveTLS =3D NULL; g_autofree char *tlsCfg =3D NULL; g_autofree char *sslverifystr =3D NULL; + virTristateBool haveTLS =3D VIR_TRISTATE_BOOL_ABSENT; xmlNodePtr tmpnode; =20 if (!(protocol =3D virXMLPropString(node, "protocol"))) { @@ -8327,12 +8327,9 @@ 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); - return -1; - } + if (virXMLPropYesNo(node, "tls", &haveTLS) < 0) + return -1; + src->haveTLS =3D haveTLS; =20 if ((flags & VIR_DOMAIN_DEF_PARSE_STATUS) && (tlsCfg =3D virXMLPropString(node, "tlsFromConfig"))) { --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054713; cv=none; d=zohomail.com; s=zohoarc; b=GNhfWzo/LJRBFDKij52LiP4WTCSjoBr/q6EBP2FuWeoyYym3hLj6ATUbKVsxfF4WbMbcBFvZAFOE0DWPQwDjSLvA51NPY01ZweXQTIjlljRSczZfJuXQrltK14U8VxsYxjCck1SUqESj/Q0xT72OtG81ci4QNXI0BibuDAbhkKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054713; 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=tyLUn6LR3cf9IMjgUJlLRoJ6L7vhJIG9kpN5TKrxl04=; b=IIfXE9vE8SZW9sNtcVJ+5mf3IWBwf/rgCFaZtNBS8zUkhRTYNZHmULTVeR8KyoHQGuTGmoROwWYVM1iCQlq8NSMiy5tncftiKrtBraVMEi1sDuOnoGoJh1LxAnDtt/CUZGt5E5Mc50CME36VW/z64SscP6qM+XPNsOGnAP/RPc0= 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 1616054713969856.306307992884; Thu, 18 Mar 2021 01:05: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-184-v4cA2TuVOnGTcwSZF7jZoA-1; Thu, 18 Mar 2021 04:02:00 -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 2D57A18C8C36; Thu, 18 Mar 2021 08:01:55 +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 031A61F041; Thu, 18 Mar 2021 08:01:55 +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 AFF08180C5A8; Thu, 18 Mar 2021 08:01:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81Vtc028191 for ; Thu, 18 Mar 2021 04:01:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id A68D466A05; Thu, 18 Mar 2021 08:01:31 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBA52669F2; Thu, 18 Mar 2021 08:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054713; 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=tyLUn6LR3cf9IMjgUJlLRoJ6L7vhJIG9kpN5TKrxl04=; b=IbH6i7kz1OuUxEsTfDalXrayy4zWhik1iYSBPl1E1CE3c8MW4MFEl6ZByy4iYqaFMrGEfX XD1OcGueikYTXCcZV6aWsECAxVuA/pWfb7anih8azJbwrS6eCME4zFY13j0xoI3AIiPcTm e6UHIhzXJTEXAuCQjGBkgWE4Q+hOxAI= X-MC-Unique: v4cA2TuVOnGTcwSZF7jZoA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainDiskSourceNVMeParse Date: Thu, 18 Mar 2021 09:00:47 +0100 Message-Id: <20210318080117.70255-9-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 55920e7a7d..e3e38ae30d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8428,7 +8428,7 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node, g_autoptr(virStorageSourceNVMeDef) nvme =3D NULL; g_autofree char *type =3D NULL; g_autofree char *namespc =3D NULL; - g_autofree char *managed =3D NULL; + virTristateBool managed =3D VIR_TRISTATE_BOOL_ABSENT; xmlNodePtr address; =20 nvme =3D g_new0(virStorageSourceNVMeDef, 1); @@ -8459,14 +8459,9 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node, return -1; } =20 - if ((managed =3D virXMLPropString(node, "managed"))) { - if ((nvme->managed =3D virTristateBoolTypeFromString(managed)) <= =3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("malformed managed value '%s'"), - managed); - return -1; - } - } + if (virXMLPropYesNo(node, "managed", &managed) < 0) + return -1; + nvme->managed =3D managed; =20 if (!(address =3D virXPathNode("./address", ctxt))) { virReportError(VIR_ERR_XML_ERROR, "%s", --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054507; cv=none; d=zohomail.com; s=zohoarc; b=fwNlVX2pwJf6qXY4UoijGQPq1KLc2fQA6a8EGPfzHDYitrsIGIZ+SPegkXhbp9eHMo8ZtVomHlvuth2xWg0mKgcMOXSP7e5ZCUlJLKxNVuaR+gGvsN02PwJdV5pLFIGgH1mLV7IJ2XLqzcn7r1jyfqcfgbccyvQNijTcmWXdiek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054507; 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=BGm07Xbs6RocYrHkrtVNHtdNJvoeM2/JC9zUcu2mVno=; b=DHVR+O4RqnkUy0DwowaW5FmJNns7GVk9sJ0X8LfmhcUmw/IuHVjDDLDzS9Mjqm82qEsZZ+BZDlh/aOhSd9hKjsd63JRAfx9FnkFUxfHcILUQ7AJcPeckgPLY3Y81vbmjZvbV9meFibOLJHkRyWMGiSz5mcDqsFzIZ1NnW6Zwezk= 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 1616054507238553.7403826494126; Thu, 18 Mar 2021 01:01:47 -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-331-aM6PyDqDNkqv4k-BW_Xumw-1; Thu, 18 Mar 2021 04:01:43 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F0D78814337; Thu, 18 Mar 2021 08:01:36 +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 C9C36669F2; Thu, 18 Mar 2021 08:01:36 +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 88D904A7CB; Thu, 18 Mar 2021 08:01:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81WZL028197 for ; Thu, 18 Mar 2021 04:01:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id D1856669F2; Thu, 18 Mar 2021 08:01:32 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BE8866FFF; Thu, 18 Mar 2021 08:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054506; 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=BGm07Xbs6RocYrHkrtVNHtdNJvoeM2/JC9zUcu2mVno=; b=iuW+phCCMqjtF0djsmU+hsiQNTMNWwS9U9YX7EVHlHvND1THkKHAx9SpJ1J1rJ3bs7wJ/d Tkgf0nrpEE3Q6EhSZPHVF3bqlRIQ7UtPNYWAgwGZ5rAOx60S9AyLVEQw+8MEjc3gLzfSLS ++TFhnvB+qCDXPE+Mfd5Zh9HagTAcPQ= X-MC-Unique: aM6PyDqDNkqv4k-BW_Xumw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainDiskDefDriverParseXML Date: Thu, 18 Mar 2021 09:00:48 +0100 Message-Id: <20210318080117.70255-10-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e3e38ae30d..8dbf371e81 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9126,6 +9126,9 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr de= f, xmlXPathContextPtr ctxt) { g_autofree char *tmp =3D NULL; + virTristateSwitch ioeventfd =3D VIR_TRISTATE_SWITCH_ABSENT; + virTristateSwitch event_idx =3D VIR_TRISTATE_SWITCH_ABSENT; + virTristateSwitch copy_on_read =3D VIR_TRISTATE_SWITCH_ABSENT; VIR_XPATH_NODE_AUTORESTORE(ctxt) =20 ctxt->node =3D cur; @@ -9165,29 +9168,17 @@ 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); + if (virXMLPropOnOff(cur, "ioeventfd", &ioeventfd) < 0) return -1; - } - VIR_FREE(tmp); + def->ioeventfd =3D ioeventfd; =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); + if (virXMLPropOnOff(cur, "event_idx", &event_idx) < 0) return -1; - } - VIR_FREE(tmp); + def->event_idx =3D event_idx; =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); + if (virXMLPropOnOff(cur, "copy_on_read", ©_on_read) < 0) return -1; - } - VIR_FREE(tmp); + def->copy_on_read =3D copy_on_read; =20 if ((tmp =3D virXMLPropString(cur, "discard")) && (def->discard =3D virDomainDiskDiscardTypeFromString(tmp)) <=3D 0)= { --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054535; cv=none; d=zohomail.com; s=zohoarc; b=DBII/FlhSH2Hbsb3ZnX5smPrXyOTDGrYTeMozCGe0XJijAEGsoncGyhjDisCw7pryksguLdxUQELLr04zG6DcLynY6d8XoVm5R1nDL9Wgp3lNfFWGR02n3m7RurZP/ZYPtihP9IKLk3t7HtOBXGNG80X+0jqqb5yxZx0VfBUtKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054535; 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=JQm6tuPt67V3joAoo9miXaRk5msrt8hJHze8TuzsM9E=; b=I4lhdaZ3xkpi11E4vhjSmrUfMNdB5jqDiuW1/y58U6zYGL5hYovVD66vXtjp3O71zpaiLmlmRu9pHEmxLRcdcy7/KizwSLHMLhq7dNe5ktpj4fM5wYIouHaDnJW3KpB8mmK5+446pNz0GwEyp1ST+K0vK5SQXUSgVctMseBRon8= 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 1616054535745218.21196481942548; Thu, 18 Mar 2021 01:02: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-514-y2anbVIrOb6TvvNJgkNJvQ-1; Thu, 18 Mar 2021 04:01:45 -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 743DC18C89E1; Thu, 18 Mar 2021 08:01:40 +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 4AD027086A; Thu, 18 Mar 2021 08:01:40 +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 0A33B4A7CD; Thu, 18 Mar 2021 08:01:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81XqV028210 for ; Thu, 18 Mar 2021 04:01:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id E5BF2669F2; Thu, 18 Mar 2021 08:01:33 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 354A76ACE0; Thu, 18 Mar 2021 08:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054534; 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=JQm6tuPt67V3joAoo9miXaRk5msrt8hJHze8TuzsM9E=; b=GVZjFBl2pl3xF0koMsOVGmElGsLFRxiRSrHq8TtVOzYfF7ko2TG+LwgeCckuzChREuGlsb rfNjEQXtwKMtcPjLq9F2LC2hlIx55iib2yOvQ4VidFb9CpbRmLDJ7YpXQQnI3LQcLqLT7r iUqspBsKzbwKOn9qKQoDT9EDuri4GWY= X-MC-Unique: y2anbVIrOb6TvvNJgkNJvQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 10/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainActualNetDefParseXML Date: Thu, 18 Mar 2021 09:00:49 +0100 Message-Id: <20210318080117.70255-11-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8dbf371e81..b8dfc77cfc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10474,8 +10474,8 @@ virDomainActualNetDefParseXML(xmlNodePtr node, g_autofree char *type =3D NULL; g_autofree char *mode =3D NULL; g_autofree char *addrtype =3D NULL; - g_autofree char *trustGuestRxFilters =3D NULL; g_autofree char *macTableManager =3D NULL; + virTristateBool trustGuestRxFilters =3D VIR_TRISTATE_BOOL_ABSENT; =20 actual =3D g_new0(virDomainActualNetDef, 1); =20 @@ -10502,15 +10502,9 @@ 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); + if (virXMLPropYesNo(node, "trustGuestRxFilters", &trustGuestRxFilters)= < 0) goto error; - } + actual->trustGuestRxFilters =3D trustGuestRxFilters; =20 virtPortNode =3D virXPathNode("./virtualport", ctxt); if (virtPortNode) { --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054532; cv=none; d=zohomail.com; s=zohoarc; b=DS3BUeNuJaqx4Ur/2bUQB9Em3j7GYx2MxNxp0g/ihEULZqKNvlzZJq79MpQlje6271ZUqxvpq1cKdPQOmU0fErKDKISC22BVDj+AdSetl3Uuc0/8hrKQ3nWWhDF86sYzPauKZ9RQvNQ502jrSD0wUB7Hi8CTPSkOxzbDuLZyhcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054532; 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=ZA+h2mIYirNwa3GksKBhF/9tu22M/TT3UFTFoF2gXM8=; b=Z7Ea/TXUJmDX75Uxy6hYwzmpeWfLOSdBLszSkezY5mUGJBQMuF9Xti6VHJylv8RoRHzyHaL4Jt3qvp1hE/XK8TlP9S+6B0JEfHpdjDlvvjVh8HJUDQe9OJci9866OGjxFXx9NdBG5cxsjpugAVjs5M7iRhA32s4qiw/4mgr8cWc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054532647806.7536496575591; Thu, 18 Mar 2021 01:02:12 -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-500-GVC4jTZgMfSRTHKBZOroXw-1; Thu, 18 Mar 2021 04:02:04 -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 DD5BD10866A3; Thu, 18 Mar 2021 08:01: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 B820F7086D; Thu, 18 Mar 2021 08:01: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 5B9E718045CA; Thu, 18 Mar 2021 08:01:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81YZj028222 for ; Thu, 18 Mar 2021 04:01:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id EDD1166A05; Thu, 18 Mar 2021 08:01:34 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41DA062951; Thu, 18 Mar 2021 08:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054526; 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=ZA+h2mIYirNwa3GksKBhF/9tu22M/TT3UFTFoF2gXM8=; b=SVnOaFTZV++XDp7N1q4QbhZzoA8U63PVv4VDco3nyxLjAmSxuOsxCAIkFTX19t0KfhBS2M ec7hVumPWTmd/mHbuxqiGs8cNhclZt/NZ52Lk3juyxfV8D8K8O8f5dzMS9BjrtaalK7+/L rhLyOvnBtbx2C45k1GimLqeAPjR77l8= X-MC-Unique: GVC4jTZgMfSRTHKBZOroXw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 11/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainChrSourceReconnectDefParseXML Date: Thu, 18 Mar 2021 09:00:50 +0100 Message-Id: <20210318080117.70255-12-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b8dfc77cfc..52e1668010 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10658,7 +10658,6 @@ virDomainChrSourceReconnectDefParseXML(virDomainChr= SourceReconnectDefPtr def, xmlNodePtr node, xmlXPathContextPtr ctxt) { - int tmpVal; VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr cur; g_autofree char *tmp =3D NULL; @@ -10666,16 +10665,8 @@ virDomainChrSourceReconnectDefParseXML(virDomainCh= rSourceReconnectDefPtr def, ctxt->node =3D node; =20 if ((cur =3D virXPathNode("./reconnect", ctxt))) { - if ((tmp =3D virXMLPropString(cur, "enabled"))) { - if ((tmpVal =3D virTristateBoolTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid reconnect enabled value: '%s'"), - tmp); - return -1; - } - def->enabled =3D tmpVal; - VIR_FREE(tmp); - } + if (virXMLPropYesNo(cur, "enabled", &def->enabled) < 0) + return -1; =20 if (def->enabled =3D=3D VIR_TRISTATE_BOOL_YES) { if ((tmp =3D virXMLPropString(cur, "timeout"))) { --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054534; cv=none; d=zohomail.com; s=zohoarc; b=QsjIhrIspQFK+03G6hPJhtp0NYBER2dgtKO2J2br8CkW0Q7dCb37iBhrLLliHA5pfbgaJIlXuCcvjC4XmDyv4lmD4BwzYgfrKsDpnXoQHdZ0orhyqKCvoi+DDZ4biVUbGBuzaOzYsADHJxMteIQHbaM8+oikPtTEHqeu1JKLwmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054534; 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=XhYjf4Gr66zRg21wucUoU/OEpm9Jn4fCRmlTgN1wJdg=; b=jae1KZFZJlUzvnU3jSoYgS3tYUS0jkdGUaGlf3frIJ8lXo08KhgtO+xiKxz0QSwmMT954MUHa8LtDUuCF/UZiDBhPw0Dz2eA5X8X9X+Z1+j6wBmhnzbbgpPxoOYUH+DCAM2fi/DMVApIre+ZNoie/2n79eIIXKE6ONsTZaXHaS8= 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 1616054534785203.570409987149; Thu, 18 Mar 2021 01:02: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-138-OTSoxcuaMbiOzaDue0yAgw-1; Thu, 18 Mar 2021 04:02:09 -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 98E58107B7CC; Thu, 18 Mar 2021 08:02: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 6CE9D70911; Thu, 18 Mar 2021 08:02: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 2873B4A713; Thu, 18 Mar 2021 08:02:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81aEf028230 for ; Thu, 18 Mar 2021 04:01:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0B5A562951; Thu, 18 Mar 2021 08:01:36 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 521E766A16; Thu, 18 Mar 2021 08:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054531; 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=XhYjf4Gr66zRg21wucUoU/OEpm9Jn4fCRmlTgN1wJdg=; b=JxOwbF7jV+U3j9sUI2fzcgLmuDnUycGgp8zM7qZvZc8B0hox4FTmtK+GdFmKSioXY4EuSI ZWxfKse7fxMr4b7TgdkM0w8Djau/a/9CNOthTXa9R9CvYcRpVLQCSkDlVeOapENxzChcuG K5lhIJqQjQiNa6Ul1ezJDZ6VpLDjbrU= X-MC-Unique: OTSoxcuaMbiOzaDue0yAgw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 12/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainNetDefParseXML Date: Thu, 18 Mar 2021 09:00:51 +0100 Message-Id: <20210318080117.70255-13-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 166 +++++++++-------------------------------- 1 file changed, 37 insertions(+), 129 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 52e1668010..54c647bfd5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10759,7 +10759,6 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, g_autofree char *queues =3D NULL; g_autofree char *rx_queue_size =3D NULL; g_autofree char *tx_queue_size =3D NULL; - g_autofree char *str =3D NULL; g_autofree char *filter =3D NULL; g_autofree char *internal =3D NULL; g_autofree char *mode =3D NULL; @@ -10769,8 +10768,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, g_autofree char *vhostuser_mode =3D NULL; g_autofree char *vhostuser_path =3D NULL; g_autofree char *vhostuser_type =3D NULL; - g_autofree char *trustGuestRxFilters =3D NULL; g_autofree char *vhost_path =3D NULL; + virTristateBool trustGuestRxFilters =3D VIR_TRISTATE_BOOL_ABSENT; const char *prefix =3D xmlopt ? xmlopt->config.netPrefix : NULL; =20 if (!(def =3D virDomainNetDefNew(xmlopt))) @@ -10789,15 +10788,9 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlo= pt, 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); + if (virXMLPropYesNo(node, "trustGuestRxFilters", &trustGuestRxFilters)= < 0) goto error; - } + def->trustGuestRxFilters =3D trustGuestRxFilters; =20 cur =3D node->children; while (cur !=3D NULL) { @@ -11367,128 +11360,43 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xm= lopt, } =20 if ((tmpNode =3D virXPathNode("./driver/host", ctxt))) { - if ((str =3D virXMLPropString(tmpNode, "csum"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown host csum mode '%s'"), - str); - goto error; - } - def->driver.virtio.host.csum =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "gso"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown host gso mode '%s'"), - str); - goto error; - } - def->driver.virtio.host.gso =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "tso4"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown host tso4 mode '%s'"), - str); - goto error; - } - def->driver.virtio.host.tso4 =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "tso6"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown host tso6 mode '%s'"), - str); - goto error; - } - def->driver.virtio.host.tso6 =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "ecn"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown host ecn mode '%s'"), - str); - goto error; - } - def->driver.virtio.host.ecn =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "ufo"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown host ufo mode '%s'"), - str); - goto error; - } - def->driver.virtio.host.ufo =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "mrg_rxbuf"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown host mrg_rxbuf mode '%s'"), - str); - goto error; - } - def->driver.virtio.host.mrg_rxbuf =3D val; - } - VIR_FREE(str); + if (virXMLPropOnOff(tmpNode, "csum", &def->driver.virtio.host.= csum) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "gso", &def->driver.virtio.host.g= so) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "tso4", &def->driver.virtio.host.= tso4) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "tso6", &def->driver.virtio.host.= tso6) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "ecn", &def->driver.virtio.host.e= cn) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "ufo", &def->driver.virtio.host.u= fo) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "mrg_rxbuf", &def->driver.virtio.= host.mrg_rxbuf) < 0) + goto error; } =20 if ((tmpNode =3D virXPathNode("./driver/guest", ctxt))) { - if ((str =3D virXMLPropString(tmpNode, "csum"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown guest csum mode '%s'"), - str); - goto error; - } - def->driver.virtio.guest.csum =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "tso4"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown guest tso4 mode '%s'"), - str); - goto error; - } - def->driver.virtio.guest.tso4 =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "tso6"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown guest tso6 mode '%s'"), - str); - goto error; - } - def->driver.virtio.guest.tso6 =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "ecn"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown guest ecn mode '%s'"), - str); - goto error; - } - def->driver.virtio.guest.ecn =3D val; - } - VIR_FREE(str); - if ((str =3D virXMLPropString(tmpNode, "ufo"))) { - if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown guest ufo mode '%s'"), - str); - goto error; - } - def->driver.virtio.guest.ufo =3D val; - } + if (virXMLPropOnOff(tmpNode, "csum", &def->driver.virtio.guest= .csum) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "tso4", &def->driver.virtio.guest= .tso4) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "tso6", &def->driver.virtio.guest= .tso6) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "ecn", &def->driver.virtio.guest.= ecn) < 0) + goto error; + + if (virXMLPropOnOff(tmpNode, "ufo", &def->driver.virtio.guest.= ufo) < 0) + goto error; } def->backend.vhost =3D g_steal_pointer(&vhost_path); } --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054513; cv=none; d=zohomail.com; s=zohoarc; b=TxMUTzN5DOKa/ZR607FC+EAkKHwVYSxfUDflgNK6c3A35zrdz/FInr703ikTExPEziqbtnvjp/PCimJ+4/6QaT24izeCkd6BGrjtYUmRMbVTs/vYEAdNjyIUN1FV7SavFpUz5k9XF4/h7OVrzY+zL0rfD8dwjcCPZgPfE1JryDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054513; 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=Y0b8b3D9KAMbYHRYC2AHEGQX+Yjl1ADkNAQK8UBHYZ4=; b=Ix2wC+tknkFu1lEaYgX0gUSxr+e4jQSOMh4SoEK8bNAg/e1xayt3FgUpc8nlR5HjPI3PSj0lXcoybPaUm7qCvi/cQOXgXVdc6IjIWc9TIxPZkdiltgVI72oR/GU096pFqhhs/KF9X4i9Qu4lTrsojbF9ehLoFhf8Y7LXRSxGlKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054513794850.0217299398963; Thu, 18 Mar 2021 01:01:53 -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-532-4Th4VVg3NRacU5L2UPzb1Q-1; Thu, 18 Mar 2021 04:01:50 -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 08DCA81630; Thu, 18 Mar 2021 08:01:45 +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 9D9D21037E8C; Thu, 18 Mar 2021 08:01:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 365424A70A; Thu, 18 Mar 2021 08:01:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81bP5028243 for ; Thu, 18 Mar 2021 04:01:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1CBF666A05; Thu, 18 Mar 2021 08:01:37 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EEB866FFF; Thu, 18 Mar 2021 08:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054512; 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=Y0b8b3D9KAMbYHRYC2AHEGQX+Yjl1ADkNAQK8UBHYZ4=; b=QsUUuZAlNhQVIZHrXQSVxvItzOvhZbZhHPMI/oHuejCV6gBsmbmq9a3tbtjdbvxNB9OLtV B/tmBrxvdW0LVWt6j5YyD1ympAnFzM6QLuOnU3TjwhcQhYSIsL/03AAql9uHr09onjSDJa +ufV9C9DqeMcVxjhbpQdTF3jJJYOuF4= X-MC-Unique: 4Th4VVg3NRacU5L2UPzb1Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 13/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainChrSourceDefParseTCP Date: Thu, 18 Mar 2021 09:00:52 +0100 Message-Id: <20210318080117.70255-14-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 54c647bfd5..1cec2edde7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11724,23 +11724,18 @@ virDomainChrSourceDefParseTCP(virDomainChrSourceD= efPtr def, int mode; int tmpVal; g_autofree char *tmp =3D NULL; + virTristateBool haveTLS =3D VIR_TRISTATE_BOOL_ABSENT; =20 if ((mode =3D virDomainChrSourceDefParseMode(source)) < 0) return -1; =20 + if (virXMLPropYesNo(source, "tls", &haveTLS) < 0) + return -1; + def->data.tcp.listen =3D mode =3D=3D VIR_DOMAIN_CHR_SOURCE_MODE_BIND; def->data.tcp.host =3D virXMLPropString(source, "host"); def->data.tcp.service =3D virXMLPropString(source, "service"); - - if ((tmp =3D virXMLPropString(source, "tls"))) { - if ((def->data.tcp.haveTLS =3D virTristateBoolTypeFromString(tmp))= <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown chardev 'tls' setting '%s'"), - tmp); - return -1; - } - VIR_FREE(tmp); - } + def->data.tcp.haveTLS =3D haveTLS; =20 if ((flags & VIR_DOMAIN_DEF_PARSE_STATUS) && (tmp =3D virXMLPropString(source, "tlsFromConfig"))) { --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054586; cv=none; d=zohomail.com; s=zohoarc; b=KLHMg0UJ4zQehXv+d3tXRe+HFcUkNWanHzFP+5zaStu7x73nrj0ABeeA0GfpcELdZTEqAYTcM8YFItRNXQOjXpZDRmCZrZ4J/fZ5McF/jsyeNgIBEW6Qg6JOLyVCY+pUpnxNVeUwG/+Kp5kKp4/RLAqKBgufCyzpiZtHnO9CtIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054586; 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=uqLBj1IbVjxrPatZNLb+on3Be7U4bcMqHPBDeKd12p8=; b=Yvfy4niJ9o8dnhoXHU403hv2C5+r6UZCaNqTuqC1rg1bjIMIYVfoZEQ+1u+HsJKoIHoeara9rDWk5tgaLu9Z7sFhbS7DiATI7lgvk5kzGJBJvXE7GyVZPbtSuIB8feTYLxfiWHoNvILjH0SqcQy4bH+Cad3g32kvxjCENLGUY+o= 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 1616054586981867.4315713125479; Thu, 18 Mar 2021 01:03: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-437-gPW5lSuIMMa_T48kG7RxUQ-1; Thu, 18 Mar 2021 04:02:14 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 866C6107B7C4; Thu, 18 Mar 2021 08:02:07 +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 147E76E6FE; Thu, 18 Mar 2021 08:02:07 +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 BAD0D180213A; Thu, 18 Mar 2021 08:02:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81cIa028255 for ; Thu, 18 Mar 2021 04:01:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2DC38669F2; Thu, 18 Mar 2021 08:01:38 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7029262951; Thu, 18 Mar 2021 08:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054586; 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=uqLBj1IbVjxrPatZNLb+on3Be7U4bcMqHPBDeKd12p8=; b=TYsTLYuEFERFXYqUFsF/bsS09q3sVXy6WBPH/XNWlVAwTNHcMoTWpJhG6JsCLE3DNknV7F JEobhDfcZhhAALzZttuaNKfi4SgXLy5BsGHUFZ/HNOD9v88R/khcOT58FsAqYgw0/aZAaC yx/Z+kSXGiVLdJDFRyIUOl0XHxVKP7A= X-MC-Unique: gPW5lSuIMMa_T48kG7RxUQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 14/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainChrSourceDefParseFile Date: Thu, 18 Mar 2021 09:00:53 +0100 Message-Id: <20210318080117.70255-15-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.11 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1cec2edde7..d9330f9ee7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11808,17 +11808,13 @@ static int virDomainChrSourceDefParseFile(virDomainChrSourceDefPtr def, xmlNodePtr source) { - g_autofree char *append =3D NULL; - - def->data.file.path =3D virXMLPropString(source, "path"); + virTristateSwitch append =3D VIR_TRISTATE_SWITCH_ABSENT; =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); + if (virXMLPropOnOff(source, "append", &append) < 0) return -1; - } + + def->data.file.path =3D virXMLPropString(source, "path"); + def->data.file.append =3D append; =20 return 0; } --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054517; cv=none; d=zohomail.com; s=zohoarc; b=NGwMr2wDHUfFCxt6PqLrB2DIDvJr4bfhGGPae3MZnABpR1OWp+rhYqxt0a3I9Fd409iDfnt8I86Q73OMKDBffDV89MSAfbGx3LGJvjb1n4VHMeUH4egmDBTc4m59AmC7UOiTzr/W5cWGOfvBLpsqC1wFHU2Asb8aQuIEpN5JKBs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054517; 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=L3gmPtddfM8SCq1CH4aFMDioFxpXiK6EiV0MW5Ar97s=; b=Z4i3l3yFrYrGHXt15rLTwV/xEtIZkvBtMhRmWn1JYMjRAg82gwdxiubVXwsH5T7d0GNQq3zneHjC6ldHtv/IaqxQtPVl9q03WdKZFoVuwNoRCaGpe+L5tklp/2XxIXz3PSfbb6l+b7iHfaj6kwtX5l7MfYs9wVuZ9l7kzx5bBxU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054517070890.1810811933783; Thu, 18 Mar 2021 01:01:57 -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-540-OjIIb2AtMvWkeRvTVgU9zg-1; Thu, 18 Mar 2021 04:01:51 -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 8117210509F7; Thu, 18 Mar 2021 08:01:46 +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 4EA461037E82; Thu, 18 Mar 2021 08:01:46 +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 B1237180B452; Thu, 18 Mar 2021 08:01:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81jUj028285 for ; Thu, 18 Mar 2021 04:01:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 46B6362951; Thu, 18 Mar 2021 08:01:45 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85EF069320; Thu, 18 Mar 2021 08:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054514; 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=L3gmPtddfM8SCq1CH4aFMDioFxpXiK6EiV0MW5Ar97s=; b=bmIxShTbkeCpQBxbffmREgAtFJ+M9SJ+FSbobcpHgymvVAjkA/HmvNQBe3FdtQXdYkB0Sl pGEqWC/pUvO3G2Z98ZZlFlAb2V1pk2+Ko6dxKGJ9XRgQd32L1x+IegIEC5XU0OqZY3hD// pSS0l3qtcbZQq5FWsYdPK9h6O0D+WB8= X-MC-Unique: OjIIb2AtMvWkeRvTVgU9zg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 15/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainChrSourceDefParseLog Date: Thu, 18 Mar 2021 09:00:54 +0100 Message-Id: <20210318080117.70255-16-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d9330f9ee7..b4928a94c2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11845,17 +11845,13 @@ static int virDomainChrSourceDefParseLog(virDomainChrSourceDefPtr def, xmlNodePtr log) { - g_autofree char *append =3D NULL; + virTristateSwitch logappend =3D VIR_TRISTATE_SWITCH_ABSENT; =20 - def->logfile =3D virXMLPropString(log, "file"); - - if ((append =3D virXMLPropString(log, "append")) && - (def->logappend =3D virTristateSwitchTypeFromString(append)) <=3D = 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid append attribute value '%s'"), - append); + if (virXMLPropOnOff(log, "append", &logappend) < 0) return -1; - } + + def->logfile =3D virXMLPropString(log, "file"); + def->logappend =3D logappend; =20 return 0; } --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054520; cv=none; d=zohomail.com; s=zohoarc; b=M4qmXL8RcUIBweo29OhZdsjj8isSqRtv6w7JhejmEKMs0Bohv7546SmM58gfUX9o+b1v0xTazQhHK/qqeUbad2Ha9XB6jPukivWd5gZ3wz8RbK1Fh4mkYG+fXblYbOR5ThsDtupwn8gZFSe54BD6GzFZFnBLqUnCJIzfMhF7Rsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054520; 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=mOF2so2PD4qFHxpnjITZkmzdfn1qXRnzNBlFgNRBSjQ=; b=g08vng3MTf1M2DJUmHR7oz9+x32cqhoAX8NlH5jZmfbgw916bSHO/dJKn6L9misM3zQbyrQLW5NLPyiwFpnhFf94ZCWSNjxQ18OFxQ7xzlFT2N0SY6zKiqcf5eebN1VGQeTnOKAAWZwS8Wh2QiM0sRpEaRTfYZQp2edcgNIGtgY= 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 1616054520620296.7422605489693; Thu, 18 Mar 2021 01:02:00 -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-48-yHervd1hMrOpkAC04XzkDg-1; Thu, 18 Mar 2021 04:01:55 -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 EF860107ACCD; Thu, 18 Mar 2021 08:01:49 +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 C4C8029ACA; Thu, 18 Mar 2021 08:01: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 7FF234A70D; Thu, 18 Mar 2021 08:01:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81mjo028337 for ; Thu, 18 Mar 2021 04:01:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 26B0E6268F; Thu, 18 Mar 2021 08:01:48 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4C5D62951; Thu, 18 Mar 2021 08:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054517; 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=mOF2so2PD4qFHxpnjITZkmzdfn1qXRnzNBlFgNRBSjQ=; b=BiRzjqM1fe3S/OqDwAiqp6myEVwbO5yDOWJPt+yRnDyEBa931s8oOVlZ61zcPjDefYaEoi ZwrbXgcEgk2X3oIFvtI3V1eMfq2o5AwF2Y+0DH9k5AHKoMHfiF0MnUUJ8hZkdFr7WDaYzW FJhoS0EzXQi4dt6+fOvg4kgO1JeEyTk= X-MC-Unique: yHervd1hMrOpkAC04XzkDg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 16/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainGraphicsDefParseXMLVNC Date: Thu, 18 Mar 2021 09:00:55 +0100 Message-Id: <20210318080117.70255-17-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b4928a94c2..756a35f33b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13077,7 +13077,6 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDe= fPtr def, g_autofree char *websocketGenerated =3D virXMLPropString(node, "websoc= ketGenerated"); g_autofree char *sharePolicy =3D virXMLPropString(node, "sharePolicy"); g_autofree char *autoport =3D virXMLPropString(node, "autoport"); - g_autofree char *powerControl =3D virXMLPropString(node, "powerControl= "); xmlNodePtr audioNode; VIR_XPATH_NODE_AUTORESTORE(ctxt) =20 @@ -13136,15 +13135,8 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsD= efPtr def, } } =20 - if (powerControl) { - int powerControlVal =3D virTristateBoolTypeFromString(powerControl= ); - if (powerControlVal < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse vnc power control '%s'"), power= Control); - return -1; - } - def->data.vnc.powerControl =3D powerControlVal; - } + if ((virXMLPropYesNo(node, "powerControl", &def->data.vnc.powerControl= )) < 0) + return -1; =20 def->data.vnc.keymap =3D virXMLPropString(node, "keymap"); =20 --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054587; cv=none; d=zohomail.com; s=zohoarc; b=j4COh1vyWMdKP4nufCJQXLfoZ+iSd5gnGXVFu+SNQIeTY0V1tYXWJGoYs9+e5ptBCppJ7He6wqXqLjN43RDPMFyO2MF2tAQAayWR+nsrbx0s6DXyKL4xhQuVc2bzoJLb7ZZq1M4Y2uasN+lGdjoIVSq2zVEMrg5+unG/N0iiGsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054587; 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=WA/XFNzGvDrMjYUDStrXha3hULgul7OL63gtGcF+fPY=; b=a/SPiI39YGSkpB+EYek7Bv7z92oWeP47ZiBqvsV1hPezi66B/cvP1v4/ru36HrHDq/F5yi1UOHjIUNmFzV1YmZ0WgZdbc2ZqoNt4BcMroTRWDZ/hibIrVSq9EDAI36lyd6xXIi6pRDGdIQmXAHO7Wsekdyd7o4TXiwaTOqXvk2k= 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 1616054587553693.3917933738708; Thu, 18 Mar 2021 01:03:07 -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-517-ahav4zgcMzmyNyZ07AuIxQ-1; Thu, 18 Mar 2021 04:02:02 -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 776A718C8C1B; Thu, 18 Mar 2021 08:01:52 +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 4450D83BFB; Thu, 18 Mar 2021 08:01:52 +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 ECBD3180B450; Thu, 18 Mar 2021 08:01:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81nIN028350 for ; Thu, 18 Mar 2021 04:01:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 210736362B; Thu, 18 Mar 2021 08:01:49 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 673E66268F; Thu, 18 Mar 2021 08:01:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054584; 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=WA/XFNzGvDrMjYUDStrXha3hULgul7OL63gtGcF+fPY=; b=DwneBn2k74K9uZdXHnGbUgNtjlXGtQbx9NWuDn+4K6GWk8pdNDKf9D73f2wNOi5ENjTt8w uzm0zR+bWIUiZ0GgL24RfmZUBoe+ymxPlj0UKsPWTpGTFrXbTWN/gLyGRpR8GhSqNfKhi7 h0mHqqPare8Ny1JH9kUFsCCNnIoe4xU= X-MC-Unique: ahav4zgcMzmyNyZ07AuIxQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 17/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainGraphicsDefParseXMLSDL Date: Thu, 18 Mar 2021 09:00:56 +0100 Message-Id: <20210318080117.70255-18-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 756a35f33b..011745e73a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13172,10 +13172,8 @@ virDomainGraphicsDefParseXMLSDL(virDomainGraphicsD= efPtr def, xmlXPathContextPtr ctxt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - int enableVal; xmlNodePtr glNode; g_autofree char *fullscreen =3D virXMLPropString(node, "fullscreen"); - g_autofree char *enable =3D NULL; =20 ctxt->node =3D node; =20 @@ -13194,20 +13192,14 @@ virDomainGraphicsDefParseXMLSDL(virDomainGraphics= DefPtr def, =20 glNode =3D virXPathNode("./gl", ctxt); if (glNode) { - enable =3D virXMLPropString(glNode, "enable"); - if (!enable) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("sdl gl element missing enable")); + if (virXMLPropYesNo(glNode, "enable", &def->data.sdl.gl) < 0) return -1; - } =20 - enableVal =3D virTristateBoolTypeFromString(enable); - if (enableVal < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown enable value '%s'"), enable); + if (def->data.sdl.gl =3D=3D VIR_TRISTATE_BOOL_ABSENT) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("sdl gl element missing enable")); return -1; } - def->data.sdl.gl =3D enableVal; } =20 return 0; --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054539; cv=none; d=zohomail.com; s=zohoarc; b=Blw7JKlgyMgL7o7hVnO+udJ5RcbMq0HxMgwdxnaoqyq2I/VKneym9qgSt7lydzlJWZ6QzL7hKjKyDd8ZcK/QFVjq2yiSwbJpnby3qcGJksOiXGrdFVtoPebQ7ff4UZvR8abSGNp7Wg3k3QxUE7d6AuecElSNmZb21/uWdhT2mZQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054539; 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=GbgtHvrpZRspP0+uj22JYwgMlhGekJHlvRTYo2Hyf4c=; b=CjzckpBqItmnkodkDP4YN8SkZiGS5w2F0rLC6/J9JLKc8tbWMbJvd1pQrbLL+Gsw1vgP8cATmesnYhbo/nwWQzVgZaaZTBWotNMWNWceJcCbKMbgnGX0QfNzzlr6VQP9teThXpQy2HXrJny7g1T23OodZ+xA8+5loFw+FbseMdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054539597533.635495703339; Thu, 18 Mar 2021 01:02:19 -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-460-Hfs0JcDtMDeYv0NQNtivbA-1; Thu, 18 Mar 2021 04:02:16 -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 2B7F0190A7A1; Thu, 18 Mar 2021 08:02:11 +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 E81941F427; Thu, 18 Mar 2021 08:02: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 9E99A4A71A; Thu, 18 Mar 2021 08:02:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81oUf028367 for ; Thu, 18 Mar 2021 04:01:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E5C063634; Thu, 18 Mar 2021 08:01:50 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 748586362B; Thu, 18 Mar 2021 08:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054538; 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=GbgtHvrpZRspP0+uj22JYwgMlhGekJHlvRTYo2Hyf4c=; b=InY4oYLM55LbrZusb0GrigwukQJlyjy3edy3Jjs1Bw2ZE23JJiImd+nepA6nkBpl+XU9G+ whp1+7xxssw1ybLPoC9WiN6KcyrHE75KkQjz5E5HlMxLMI6P6gCBgTDpr3azLXo9bM2QKG BKcHY8eTucEo494LNLMYGxD4DlY12fI= X-MC-Unique: Hfs0JcDtMDeYv0NQNtivbA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 18/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainGraphicsDefParseXMLSpice Date: Thu, 18 Mar 2021 09:00:57 +0100 Message-Id: <20210318080117.70255-19-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 66 +++++++++++------------------------------- 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 011745e73a..360528ef1e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13429,23 +13429,18 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphi= csDefPtr def, =20 def->data.spice.zlib =3D compressionVal; } else if (virXMLNodeNameEqual(cur, "playback")) { - int compressionVal; - g_autofree char *compression =3D virXMLPropString(cur, "co= mpression"); + virTristateSwitch compression =3D VIR_TRISTATE_SWITCH_ABSE= NT; =20 - if (!compression) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("spice playback missing compression")= ); + if (virXMLPropOnOff(cur, "compression", &compression) < 0) return -1; - } =20 - if ((compressionVal =3D - virTristateSwitchTypeFromString(compression)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("unknown spice playback compression")= ); + if (compression =3D=3D VIR_TRISTATE_SWITCH_ABSENT) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("spice playback missing compression")= ); return -1; } =20 - def->data.spice.playback =3D compressionVal; + def->data.spice.playback =3D compression; } else if (virXMLNodeNameEqual(cur, "streaming")) { int modeVal; g_autofree char *mode =3D virXMLPropString(cur, "mode"); @@ -13464,62 +13459,35 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphi= csDefPtr def, =20 def->data.spice.streaming =3D modeVal; } else if (virXMLNodeNameEqual(cur, "clipboard")) { - int copypasteVal; - g_autofree char *copypaste =3D virXMLPropString(cur, "copy= paste"); + if (virXMLPropYesNo(cur, "copypaste", &def->data.spice.cop= ypaste) < 0) + return -1; =20 - if (!copypaste) { + if (def->data.spice.copypaste =3D=3D VIR_TRISTATE_BOOL_ABS= ENT) { virReportError(VIR_ERR_XML_ERROR, "%s", _("spice clipboard missing copypaste")); return -1; } - - if ((copypasteVal =3D - virTristateBoolTypeFromString(copypaste)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown copypaste value '%s'"), copy= paste); - return -1; - } - - def->data.spice.copypaste =3D copypasteVal; } else if (virXMLNodeNameEqual(cur, "filetransfer")) { - int enableVal; - g_autofree char *enable =3D virXMLPropString(cur, "enable"= ); + if (virXMLPropYesNo(cur, "enable", &def->data.spice.filetr= ansfer) < 0) + return -1; =20 - if (!enable) { + if (def->data.spice.filetransfer =3D=3D VIR_TRISTATE_BOOL_= ABSENT) { virReportError(VIR_ERR_XML_ERROR, "%s", _("spice filetransfer missing enable")); return -1; } + } else if (virXMLNodeNameEqual(cur, "gl")) { + def->data.spice.rendernode =3D virXMLPropString(cur, + "rendernode"= ); =20 - if ((enableVal =3D - virTristateBoolTypeFromString(enable)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown enable value '%s'"), enable); + if (virXMLPropYesNo(cur, "enable", &def->data.spice.gl) < = 0) return -1; - } - - def->data.spice.filetransfer =3D enableVal; - } else if (virXMLNodeNameEqual(cur, "gl")) { - int enableVal; - g_autofree char *enable =3D virXMLPropString(cur, "enable"= ); - g_autofree char *rendernode =3D virXMLPropString(cur, "ren= dernode"); =20 - if (!enable) { + if (def->data.spice.gl =3D=3D VIR_TRISTATE_BOOL_ABSENT) { virReportError(VIR_ERR_XML_ERROR, "%s", _("spice gl element missing enable")); return -1; } - - if ((enableVal =3D - virTristateBoolTypeFromString(enable)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown enable value '%s'"), enable); - return -1; - } - - def->data.spice.gl =3D enableVal; - def->data.spice.rendernode =3D g_steal_pointer(&rendernode= ); - } else if (virXMLNodeNameEqual(cur, "mouse")) { int modeVal; g_autofree char *mode =3D virXMLPropString(cur, "mode"); --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054528; cv=none; d=zohomail.com; s=zohoarc; b=AKdSlPDFOo3EVFvYrkL2WcVz2vh3V8f3Cw7x6gwbQ4ztlrThvbGf6Me1jmg4GqJtNJWi5hr9lyKrHHLTrvZvkgN4j0+rM/Q+lpF+USIOH/8wOLvsYB33+IB0I7Lxd0VeWdJS7nrpWui1MuonrgDFNZJqVKEpPHT/zZkbFWHIRF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054528; 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=bG9cFPrOIHF5IOPhBsM4FuMIQ63knhV3K5frrCgltlw=; b=dNsglWgQQyEmLTn/RCO1DL9Z0jEN/ADSKi95UjLEVvXzFVRvtiGj2jPaKlGZl7PagEP5ZLuGLhb+Fy5srfF33PZpCI3Eg9s/ckO8TG0eN7kqrJlRh/ky92b7dfR86V3ULcM79n3bB2hlScQmX7pl9O0fF/DFq6O6t6BDd/mvvsc= 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 1616054528442871.5266425115288; Thu, 18 Mar 2021 01:02:08 -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-73-1nkYKD2eNFiRxdaigBErzA-1; Thu, 18 Mar 2021 04:02: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 3000010866AA; Thu, 18 Mar 2021 08:01:57 +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 0447577520; Thu, 18 Mar 2021 08:01:57 +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 A85114A708; Thu, 18 Mar 2021 08:01:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81sWT028410 for ; Thu, 18 Mar 2021 04:01:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 93AE0669F2; Thu, 18 Mar 2021 08:01:54 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id D67AC6268F; Thu, 18 Mar 2021 08:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054525; 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=bG9cFPrOIHF5IOPhBsM4FuMIQ63knhV3K5frrCgltlw=; b=GXVyt8pxdFOqMrkNTVtiAjBbQ/f6koV+zlvWYEpvehw6Vy5X1Y1i3PKrZTzM0/bI3ipep9 wJDOZyuqWIZnvka40WCdiQ3ECIt5RYjlHP6mDh2VT1MEhUx5c2sOxTRXp+WIBUeOPD9Ohv ZFhEGVAfzRYhsKgHAAWZ+DqJeY9NoC8= X-MC-Unique: 1nkYKD2eNFiRxdaigBErzA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 19/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainAudioCommonParse Date: Thu, 18 Mar 2021 09:00:58 +0100 Message-Id: <20210318080117.70255-20-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 360528ef1e..4e7f5031e7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13772,8 +13772,6 @@ virDomainAudioCommonParse(virDomainAudioIOCommonPtr= def, xmlNodePtr node, xmlXPathContextPtr ctxt) { - g_autofree char *mixingEngine =3D virXMLPropString(node, "mixingEngine= "); - g_autofree char *fixedSettings =3D virXMLPropString(node, "fixedSettin= gs"); g_autofree char *voices =3D virXMLPropString(node, "voices"); g_autofree char *bufferLength =3D virXMLPropString(node, "bufferLength= "); xmlNodePtr settings; @@ -13782,21 +13780,11 @@ virDomainAudioCommonParse(virDomainAudioIOCommonP= tr def, ctxt->node =3D node; settings =3D virXPathNode("./settings", ctxt); =20 - if (mixingEngine && - ((def->mixingEngine =3D - virTristateBoolTypeFromString(mixingEngine)) <=3D 0)) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown 'mixingEngine' value '%s'"), mixingEngin= e); + if (virXMLPropYesNo(node, "mixingEngine", &def->mixingEngine) < 0) return -1; - } =20 - if (fixedSettings && - ((def->fixedSettings =3D - virTristateBoolTypeFromString(fixedSettings)) <=3D 0)) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown 'fixedSettings' value '%s'"), fixedSetti= ngs); + if (virXMLPropYesNo(node, "fixedSettings", &def->fixedSettings) < 0) return -1; - } =20 if (def->fixedSettings =3D=3D VIR_TRISTATE_BOOL_YES && def->mixingEngine !=3D VIR_TRISTATE_BOOL_YES) { --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054530; cv=none; d=zohomail.com; s=zohoarc; b=E2afesFLQTZzA2AGBDiZHz26wN2bsUu99iari6KAIEc6ztGy0v5FX8tz/9gS++iJP9NgajnHtHNJ/TGHxokUUW7MWbUPQNe/qrGETy16sM4pS5DnGKjBTatrhs3irH62h2eSg2aBY55sbFL5fZwtplzbbD+1HGbO9WJGfja5FEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054530; 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=2SvaR3XvieC4YZd+bxgBTHcGVa4X45sqZFmrhip6wVw=; b=hR0ivAU2tEmS/8ohqieRn4DCy10Bni9xpfS/4+ETnkfGonp8lAXtE9Kzj6uhoouPlwYPn6DC06HsoHLe4TF6KkLqeDyCHBYwGe9weEnAzdLZuz3JqztqA7nMuVFS+P1dF0TjhfqYnB4H5PZ0mPlspY8bcntYk735fiA2yk322kU= 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 1616054530427131.47802531351738; Thu, 18 Mar 2021 01:02:10 -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-256-Qy_s-PF_NpmbO18wRehv4w-1; Thu, 18 Mar 2021 04:02:04 -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 74BE9814314; Thu, 18 Mar 2021 08:01:58 +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 4ACBF1F410; Thu, 18 Mar 2021 08:01: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 0D2F84A710; Thu, 18 Mar 2021 08:01:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81t3p028426 for ; Thu, 18 Mar 2021 04:01:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id A2F396362B; Thu, 18 Mar 2021 08:01:55 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id E54A263634; Thu, 18 Mar 2021 08:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054528; 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=2SvaR3XvieC4YZd+bxgBTHcGVa4X45sqZFmrhip6wVw=; b=h9eS7gTAv1xoVwXIE9yrmpl9no99QJArCXMwvJT6VYNv7Y6lOicFUAwf/Ch6K7MOU4/8nl px1okKgXCM+WarE4NK4HdURCXFPYFqcHy1vXeaSgyhFnFYbOeiwnxsxV+ZlO++GpmBWZAX mAL7KJNI1LzcQ2MihyN/PMrIPoheHeo= X-MC-Unique: Qy_s-PF_NpmbO18wRehv4w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 20/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainAudioJackParse Date: Thu, 18 Mar 2021 09:00:59 +0100 Message-Id: <20210318080117.70255-21-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4e7f5031e7..b9ee1e2de7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13878,19 +13878,12 @@ static int virDomainAudioJackParse(virDomainAudioIOJackPtr def, xmlNodePtr node) { - g_autofree char *exactName =3D virXMLPropString(node, "exactName"); - def->serverName =3D virXMLPropString(node, "serverName"); def->clientName =3D virXMLPropString(node, "clientName"); def->connectPorts =3D virXMLPropString(node, "connectPorts"); =20 - if (exactName && - ((def->exactName =3D - virTristateBoolTypeFromString(exactName)) <=3D 0)) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown 'exactName' value '%s'"), exactName); + if (virXMLPropYesNo(node, "exactName", &def->exactName) < 0) return -1; - } =20 return 0; } --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054543; cv=none; d=zohomail.com; s=zohoarc; b=Rb+ZlpJYYHhv/5UX+d/zm6yS8gUV2TFy6UepbHOxpYzA2lZwIGITV2Oklqvw6z7ZNAnC9RcqVEc6zAfrZqX2L55rY/kIpSxlSj5UXGf1cJORVOuX6R/iTiJLZtjrbaeE0SsKB549RqvzVfOV3mPtVB6CP4N+0G+lLrI/L4P4LAQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054543; 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=WRTSst18NS0Y08U5R64wEt32v8zRM3pM1Wo3nyPIqJk=; b=RTpx8N9rgHl7VqM+oymTcLjvQFTXs3ONJBnArhIJt4aQYB29TxcaiN5uSRF1zxcb+ufrlkfnt+9H/lHLCpM1afcEkSJsMYuu2fUm4j/4NupEXPkcUkoLZ0adM3JZdVe1vMTRaSanUZvEgdxsSSI/kxgM7aIv+hBZccWCqzaLd5c= 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 1616054543730431.9854196151854; Thu, 18 Mar 2021 01:02:23 -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-327-dguNy0wSP7qoS-iMfVhHxQ-1; Thu, 18 Mar 2021 04:02:09 -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 2C292835BDD; Thu, 18 Mar 2021 08:02: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 F31AF708E2; Thu, 18 Mar 2021 08:02: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 935781802137; Thu, 18 Mar 2021 08:02:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81u1u028450 for ; Thu, 18 Mar 2021 04:01:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id B40346362B; Thu, 18 Mar 2021 08:01:56 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0330C63634; Thu, 18 Mar 2021 08:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054531; 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=WRTSst18NS0Y08U5R64wEt32v8zRM3pM1Wo3nyPIqJk=; b=ThzoZgAeHImRwkjHW0v+jSWhhx2jezP2g5IJ2XK1KmoMWQ0mCAZxINnfgddtFowKteGGWC ALNfEiDeEZzJx78lh7+WLiEVyEMV3815OTbNa6NrOlqKx8P6Q2OSvLqqtQUg5HL/bsY+bR W6UgdEsuQ4RFA+ZkguLY0nwnuSi234s= X-MC-Unique: dguNy0wSP7qoS-iMfVhHxQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 21/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainAudioOSSParse Date: Thu, 18 Mar 2021 09:01:00 +0100 Message-Id: <20210318080117.70255-22-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b9ee1e2de7..6559c3d2f8 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13893,18 +13893,12 @@ static int virDomainAudioOSSParse(virDomainAudioIOOSSPtr def, xmlNodePtr node) { - g_autofree char *tryPoll =3D virXMLPropString(node, "tryPoll"); g_autofree char *bufferCount =3D virXMLPropString(node, "bufferCount"); =20 def->dev =3D virXMLPropString(node, "dev"); =20 - if (tryPoll && - ((def->tryPoll =3D - virTristateBoolTypeFromString(tryPoll)) <=3D 0)) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown 'tryPoll' value '%s'"), tryPoll); + if (virXMLPropYesNo(node, "tryPoll", &def->tryPoll) < 0) return -1; - } =20 if (bufferCount && virStrToLong_ui(bufferCount, NULL, 10, --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054650; cv=none; d=zohomail.com; s=zohoarc; b=Oi1UWbd1Yx8jMbkUZ/xMjLCSYXAvxRpxvB0zVl6WkAxl3k9EZBGJJ+BaJVQ3m0pMgJlFQsMPWQy5yNnRWvHBSRkLx7sqty90u64APMcTiKr95KeGQT/ofdYOJoExNsA/gZMLTV9cC1VmpFBGH4rosMOuzxp0+SZJ7V4Pcc77fg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054650; 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=U/ruRJY7RFa5wrjlbgwsm9KMhZS9PaX5+qw5n1JiJ6s=; b=SeBD0B4/fobiW7K1I8gIvpgJyhi8wkXo18PkIm93QLMw2Mu7G/zpqR0c0gugzcNO4f5VnMdDpIA5Gzc7DxenFY9Lo45mKWt8WzmjD+N7xBGVVC3PQ9Ss4ZEQfcC+o7VfRkfjVeaVdufLgLZg91oIDQUIn4UBHkNAvL9XqJDrozM= 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 1616054650786780.9908044379099; Thu, 18 Mar 2021 01:04:10 -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-220-o1SCSQhGPiSZrS8s775_vQ-1; Thu, 18 Mar 2021 04:02:11 -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 0DCAA10866A3; Thu, 18 Mar 2021 08:02:06 +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 D6F7067892; Thu, 18 Mar 2021 08:02: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 9A8724A705; Thu, 18 Mar 2021 08:02:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81vUB028458 for ; Thu, 18 Mar 2021 04:01:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id C1C1A6362B; Thu, 18 Mar 2021 08:01:57 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16CC96268F; Thu, 18 Mar 2021 08:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054649; 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=U/ruRJY7RFa5wrjlbgwsm9KMhZS9PaX5+qw5n1JiJ6s=; b=ZzHxF23x7/mqZeJkstCOPDWDGHAsjl+eqc7V7NxVqQIbozJqhjSvhPLEfPBjkuCLbew5al Sbb22XextMo1NhQLEozHljX1vh5EeZvwMIUBuS0HSL75SkYo/xDCQECLacxZ/USEMyR6l3 wFedF2zUwcrnYgYHmS0mVMx7MVNAmSc= X-MC-Unique: o1SCSQhGPiSZrS8s775_vQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 22/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainAudioDefParseXML Date: Thu, 18 Mar 2021 09:01:01 +0100 Message-Id: <20210318080117.70255-23-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6559c3d2f8..fe35a3960e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14025,23 +14025,13 @@ virDomainAudioDefParseXML(virDomainXMLOptionPtr x= mlopt G_GNUC_UNUSED, break; =20 case VIR_DOMAIN_AUDIO_TYPE_OSS: { - g_autofree char *tryMMap =3D virXMLPropString(node, "tryMMap"); - g_autofree char *exclusive =3D virXMLPropString(node, "exclusive"); g_autofree char *dspPolicy =3D virXMLPropString(node, "dspPolicy"); =20 - if (tryMMap && ((def->backend.oss.tryMMap =3D - virTristateBoolTypeFromString(tryMMap)) <=3D 0)) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown 'tryMMap' value '%s'"), tryMMap); + if (virXMLPropYesNo(node, "tryMMap", &def->backend.oss.tryMMap) < = 0) goto error; - } =20 - if (exclusive && ((def->backend.oss.exclusive =3D - virTristateBoolTypeFromString(exclusive)) <=3D = 0)) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown 'exclusive' value '%s'"), exclusive); + if (virXMLPropYesNo(node, "exclusive", &def->backend.oss.exclusive= ) < 0) goto error; - } =20 if (dspPolicy) { if (virStrToLong_i(dspPolicy, NULL, 10, --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054704; cv=none; d=zohomail.com; s=zohoarc; b=A2eK3+kafPppsZaiHw1SU6tegoyX4yu7Sziz9k8k6hZ62NLlJJA1IAtGdw7+XVlby12yV8NlU1j5rlXZCVZd02aS0VkUwxZqaZdE6TatpknKu6FAxSLaEvP5AvsNiRJI03yajRvvlRaewmFsF/2FziD6mgR1r2cXzeB6G78y/4U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054704; 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=O/GVynGPRduzS5h0mWHDrmq39spWx2mGsyDZyRlzRgI=; b=a/PqM8Rv6k/nBrILZ0bN912G7J6XVUOpheOunAtXskGvks2YU10zJBkaY2AUiBbRWahC/zzNwHDmFfEfSkH0gKO73WeJ9+CEh1tWpqwF/j4fG9z6KERg/lwiOeyQsUeaX6kq12SZ2RfydlxR03Y+Lsxx9OeaRE3A7qM5HuQKCLg= 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 1616054704231237.89232027265177; Thu, 18 Mar 2021 01:05:04 -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-31-_RNBoE_HNTikFjUSiQe39g-1; Thu, 18 Mar 2021 04:02:17 -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 D6912839A58; Thu, 18 Mar 2021 08:02:09 +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 B375F610F0; Thu, 18 Mar 2021 08:02: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 72836180213D; Thu, 18 Mar 2021 08:02:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81woj028486 for ; Thu, 18 Mar 2021 04:01:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id D52E76362B; Thu, 18 Mar 2021 08:01:58 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E427669F2; Thu, 18 Mar 2021 08:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054703; 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=O/GVynGPRduzS5h0mWHDrmq39spWx2mGsyDZyRlzRgI=; b=KhWaiBEtwVX3Fzj0ZY6EGIRzNJKQ6dv19Jrf7NFwNz0sJWqMnt25qengWlIZhm5hmo59Y4 mRYQwA9qu5G5V1pMigvPrAfr8D84KmQKNZTDNJqaqhQKJCNPstZtuqF8k9YPQ6p+zfLO+M cdey5ykyZkOvh2F3PmGlaCyVRWI/07I= X-MC-Unique: _RNBoE_HNTikFjUSiQe39g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 23/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainMemballoonDefParseXML Date: Thu, 18 Mar 2021 09:01:02 +0100 Message-Id: <20210318080117.70255-24-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fe35a3960e..0c4f7ab879 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14264,8 +14264,8 @@ virDomainMemballoonDefParseXML(virDomainXMLOptionPt= r xmlopt, VIR_XPATH_NODE_AUTORESTORE(ctxt) unsigned int period =3D 0; g_autofree char *model =3D NULL; - g_autofree char *freepage_reporting =3D NULL; - g_autofree char *deflate =3D NULL; + virTristateSwitch autodeflate =3D VIR_TRISTATE_SWITCH_ABSENT; + virTristateSwitch free_page_reporting =3D VIR_TRISTATE_SWITCH_ABSENT; =20 def =3D g_new0(virDomainMemballoonDef, 1); =20 @@ -14282,19 +14282,13 @@ 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); + if (virXMLPropOnOff(node, "autodeflate", &autodeflate) < 0) goto error; - } + def->autodeflate =3D autodeflate; =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); + if (virXMLPropOnOff(node, "freePageReporting", &free_page_reporting) <= 0) goto error; - } + def->free_page_reporting =3D free_page_reporting; =20 ctxt->node =3D node; if (virXPathUInt("string(./stats/@period)", ctxt, &period) < -1) { --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054723; cv=none; d=zohomail.com; s=zohoarc; b=hLR0WNP7NxoBiqPLqr1xmQIHCklhVc5R2F3i/OzafCGPOuUlm/PI/jzsT5r5tOB97v/sDcvjbyDrLSQdN3WGOMv2l+bNXhzi6D64FG8rvGpvVyqM741951L12uRJWSIriwrdS+CAs/JaJq1R7OfLexEUhBhm3e4ZF05aiTwd2nY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054723; 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=lo3/L3MuXYKtFy1daurNA7G3AI+wFiUFOlSUTESIKFw=; b=XPpvH9OPgFjK7AB1pmg/bA7te4KqG4jmmhoi3fylWJrLmM5ff9tw7L3sTdlJuCsvmN3UxKoW6zO70i/7Sys0Ve8AXzvGEJpAvdLhkjQsXYJwlcKVWHyRKvZla9BmbY56eY4rhRlB/lXMzH+9omTGGmpzfoA1DESLYV0AWnP2H+g= 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 1616054723674511.4244491557662; Thu, 18 Mar 2021 01:05:23 -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-516-kgrpSPUCP2m1vUDYdWfRGQ-1; Thu, 18 Mar 2021 04:02:20 -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 461DB10866AD; Thu, 18 Mar 2021 08:02:15 +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 1BC9E10027A5; Thu, 18 Mar 2021 08:02:15 +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 CAC6C1802140; Thu, 18 Mar 2021 08:02:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I81xIq028517 for ; Thu, 18 Mar 2021 04:01:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id E7BDA6362B; Thu, 18 Mar 2021 08:01:59 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32B0B6268F; Thu, 18 Mar 2021 08:01:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054722; 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=lo3/L3MuXYKtFy1daurNA7G3AI+wFiUFOlSUTESIKFw=; b=PkKeV8g9Md2IFOa+vQW+V+xgsvSnt+dzUvxG5Slp1KvVH6IMj7KVLg3o3xPeAV/B0zk/ad 9f2qMn8/YwCj8Bk/EzovfbRHuDLJyqIXK6LoHjcGewv0AC5/IWC31vcVkRzZDlmoaCurwF P8oJRpVT6zMG+UJ0te/6GZukPsHLN7U= X-MC-Unique: kgrpSPUCP2m1vUDYdWfRGQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 24/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainShmemDefParseXML Date: Thu, 18 Mar 2021 09:01:03 +0100 Message-Id: <20210318080117.70255-25-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0c4f7ab879..a1aefdf0bf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14413,17 +14413,8 @@ virDomainShmemDefParseXML(virDomainXMLOptionPtr xm= lopt, } VIR_FREE(tmp); =20 - if ((tmp =3D virXMLPropString(msi, "ioeventfd"))) { - int val; - - if ((val =3D virTristateSwitchTypeFromString(tmp)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid msi ioeventfd setting for shmem:= '%s'"), - tmp); - goto cleanup; - } - def->msi.ioeventfd =3D val; - } + if (virXMLPropOnOff(msi, "ioeventfd", &def->msi.ioeventfd) < 0) + goto cleanup; } =20 /* msi option is only relevant with a server */ --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054595; cv=none; d=zohomail.com; s=zohoarc; b=PvAk8yiLxCcVeTGYmaf9neokoRUQLwafnmv7SVZCyxpub2WOuWB1GtIbviKFwG4aycaVcmuA/vWpM9zGn85qzW2TxVi2gX1rQAm1MDHySxauwGiyqCowxcQEgsuQ0iyf1LGgVKppoj+6zRY1CR6HcqywROfLN00qpSAHP8qVNVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054595; 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=pOB2c3V6Qvsltq5BIXbfVEt2sa5yUx6imlbKqY4HkMs=; b=hbj2iXUjzUp2OByQ8oK5SrpBb+AHeDkVYre2WXwVUj4IASEubab9TSk69f4aWByLhLpI3QDwzYrkBvnMQ2vER9Ktww0cw49eFmGx6L/BwPCPRhhOb2wzjEUXQfRQ7MOdI63PU/rCfeNb68llmeF7IsHA2PHKBVJIBowx/FEQCps= 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 1616054595120442.45689966246357; Thu, 18 Mar 2021 01:03: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-588-1TGVdKQjMNadD2vDZpWLQw-1; Thu, 18 Mar 2021 04:02:23 -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 C242F190A7B6; Thu, 18 Mar 2021 08:02:18 +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 9A6C129AC3; Thu, 18 Mar 2021 08:02:18 +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 50F131802143; Thu, 18 Mar 2021 08:02:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I826CH028719 for ; Thu, 18 Mar 2021 04:02:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 105CE69321; Thu, 18 Mar 2021 08:02:06 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56BDA66FFF; Thu, 18 Mar 2021 08:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054583; 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=pOB2c3V6Qvsltq5BIXbfVEt2sa5yUx6imlbKqY4HkMs=; b=M31y7CNtTPZa0u6W7YFdRFRHscjSobkMkT2gaZV7J9vik4U5TBowmfJOXQ+XBlAmpN02M1 JyWQOhwlpEkLuV2R0BPUIw/2Bz4fTrGgP3WQo8bikgt23+YyVnwVsxEZPVyaJDyT9T7VL8 NFN+dHV6h1s6OL2dhJ+jqvuVm8vbkvk= X-MC-Unique: 1TGVdKQjMNadD2vDZpWLQw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 25/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainPerfEventDefParseXML Date: Thu, 18 Mar 2021 09:01:04 +0100 Message-Id: <20210318080117.70255-26-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a1aefdf0bf..c020bf9124 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15496,7 +15496,7 @@ virDomainPerfEventDefParseXML(virDomainPerfDefPtr p= erf, { int event; g_autofree char *name =3D NULL; - g_autofree char *enabled =3D NULL; + virTristateBool enabled =3D VIR_TRISTATE_BOOL_ABSENT; =20 if (!(name =3D virXMLPropString(node, "name"))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing perf event name= ")); @@ -15515,16 +15515,12 @@ virDomainPerfEventDefParseXML(virDomainPerfDefPtr= perf, return -1; } =20 - if (!(enabled =3D virXMLPropString(node, "enabled"))) { - virReportError(VIR_ERR_XML_ERROR, - _("missing state of perf event '%s'"), name); + if (virXMLPropYesNo(node, "enabled", &enabled) < 0) return -1; - } =20 - if ((perf->events[event] =3D virTristateBoolTypeFromString(enabled)) <= 0) { + if ((perf->events[event] =3D enabled) =3D=3D VIR_TRISTATE_BOOL_ABSENT)= { virReportError(VIR_ERR_XML_ERROR, - _("invalid state '%s' of perf event '%s'"), - enabled, name); + _("missing state of perf event '%s'"), name); return -1; } =20 --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054552; cv=none; d=zohomail.com; s=zohoarc; b=n2sLe7+u+RHyva0HiSFrp3YVLTJZeIXskL+LXocbK8R4MfeAIZc+EI38EOBkM/TVYWyue1qeHqK47LBGds92a1LwU81lY+hkjo1mnQYnk1uWOTNhH1yRFcDk35gKGHEN3feJU6pHHhgWQZxLXN+uklDGX3DJyw6gZpuZrY5P5Wc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054552; 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=yu3vyjE+M8cQ4m/Hamr70/hIcevBVXOnLfTMiyt8quw=; b=NJL7dxqmEmdSdiCUPdWvTvxASQTK4KeQ28nOo2BlgsvdzSrz5AnBYB6N7tS1P6fB6IsdGGpFIAUlCNTJ0Jqvh8hM7AxA7RHYkCdAt4vigFXql5BHMTVWXjNr2anAU9RM4n/zO+gs5L1FrTmpDi3gF5kYRprlXP+Z8A1E1Ez96A8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054552639570.8179519901166; Thu, 18 Mar 2021 01:02:32 -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-272-wF6CEHC7O36je2OCNOD0Xg-1; Thu, 18 Mar 2021 04:02:29 -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 C296210866C0; Thu, 18 Mar 2021 08:02:23 +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 9A9F35D9D3; Thu, 18 Mar 2021 08:02:23 +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 477E6180B451; Thu, 18 Mar 2021 08:02:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I82LTb028938 for ; Thu, 18 Mar 2021 04:02:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id A4D8E66A05; Thu, 18 Mar 2021 08:02:21 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEC016362B; Thu, 18 Mar 2021 08:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054551; 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=yu3vyjE+M8cQ4m/Hamr70/hIcevBVXOnLfTMiyt8quw=; b=RIPXEX6GWW2IBC/D4vYDI3AVT0GTBjgckcJ+mr+5STXNeNDcGuvlPMTiRmqfP3nQm7HjfC snqRtXQ62Nh0E+JWKjD7ZGpOnsWmEZwr4RYlDXFTznWE+nW2XqrA6Tcj/CA6uEAOkK7DKg G4xv/6z7UdGw/HRC6WlNY1f6w1AlpLQ= X-MC-Unique: wF6CEHC7O36je2OCNOD0Xg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 26/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainMemoryDefParseXML Date: Thu, 18 Mar 2021 09:01:05 +0100 Message-Id: <20210318080117.70255-27-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c020bf9124..d4ca60f98c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15764,16 +15764,8 @@ virDomainMemoryDefParseXML(virDomainXMLOptionPtr x= mlopt, } VIR_FREE(tmp); =20 - if ((tmp =3D virXMLPropString(memdevNode, "discard"))) { - if ((val =3D virTristateBoolTypeFromString(tmp)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid discard value '%s'"), tmp); - goto error; - } - - def->discard =3D val; - } - VIR_FREE(tmp); + if (virXMLPropYesNo(memdevNode, "discard", &def->discard) < 0) + goto error; =20 /* Extract NVDIMM UUID. */ if (def->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054559; cv=none; d=zohomail.com; s=zohoarc; b=EPHTXDsCc+lO7HN5YfqUjCSFZ8aVqT1z5UHPiZT63qSgkUqeEvIrkgdpB8E/A7lk57lumqRNrgI0mCmVlJSzBV4jDHdNbrU7cw/b4UBfz8eUxbUZxlRViW/SP+3ZO6E5R1krcv8YiRXi8GUS/4q58Grhcv0xO+ns74ESQI+IKdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054559; 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=O7tjevouiQ6nxr5CbThiM/ONJ2weTFUvUDhuFXw9pbY=; b=C0Bc66jCDlQMyKYEZkUsNdYWhsd0yOTH4VsiAu/BT7T1ZbZrGaRFUNGDmpIFoHkoYbbJc0x5qdmrM4mX85fBoV7cdnjRX22FLrkgQFaFAuY7S3DSC05//VoKIOEjF3UvPd8Jc/A+SVzKQF/B4AOgMBxl0wM12ERwj4KbURWVvIk= 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 1616054557901161.3522446738251; Thu, 18 Mar 2021 01:02:37 -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-231-xJ9UxjKhMCCVA1bmnx8PWQ-1; Thu, 18 Mar 2021 04:02:33 -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 94D14107ACCA; Thu, 18 Mar 2021 08:02:27 +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 721CF7092D; Thu, 18 Mar 2021 08:02:27 +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 3221B50039; Thu, 18 Mar 2021 08:02:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I82PC1028999 for ; Thu, 18 Mar 2021 04:02:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id CEEFE6268F; Thu, 18 Mar 2021 08:02:25 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B9BE6362B; Thu, 18 Mar 2021 08:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054556; 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=O7tjevouiQ6nxr5CbThiM/ONJ2weTFUvUDhuFXw9pbY=; b=GP6GLNfvkWpWBKo60diUA/w+9jJPKBORRb8WUz49vqOTnHDZM+OXtueD1fCcj0ZLJLVcTa yFTJludKNkMM5T7J3TAafP5P6aWIzhY8m8vNkoSy/49hwT4W8heFVPtZLPF0QgQaciLbNI wIKmK+XPMdiWW1qiukCTqC3d2czkKas= X-MC-Unique: xJ9UxjKhMCCVA1bmnx8PWQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 27/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainIOMMUDefParseXML Date: Thu, 18 Mar 2021 09:01:06 +0100 Message-Id: <20210318080117.70255-28-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d4ca60f98c..2969cf0d88 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15835,40 +15835,17 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, iommu->model =3D val; =20 if ((driver =3D virXPathNode("./driver", ctxt))) { - VIR_FREE(tmp); - if ((tmp =3D virXMLPropString(driver, "intremap"))) { - if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_XML_ERROR, _("unknown intremap valu= e: %s"), tmp); - return NULL; - } - iommu->intremap =3D val; - } + if (virXMLPropOnOff(driver, "intremap", &iommu->intremap) < 0) + return NULL; =20 - VIR_FREE(tmp); - if ((tmp =3D virXMLPropString(driver, "caching_mode"))) { - if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_XML_ERROR, _("unknown caching_mode = value: %s"), tmp); - return NULL; - } - iommu->caching_mode =3D val; - } - VIR_FREE(tmp); - if ((tmp =3D virXMLPropString(driver, "iotlb"))) { - if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_XML_ERROR, _("unknown iotlb value: = %s"), tmp); - return NULL; - } - iommu->iotlb =3D val; - } + if (virXMLPropOnOff(driver, "caching_mode", &iommu->caching_mode) = < 0) + return NULL; =20 - VIR_FREE(tmp); - if ((tmp =3D virXMLPropString(driver, "eim"))) { - if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_XML_ERROR, _("unknown eim value: %s= "), tmp); - return NULL; - } - iommu->eim =3D val; - } + if (virXMLPropOnOff(driver, "iotlb", &iommu->iotlb) < 0) + return NULL; + + if (virXMLPropOnOff(driver, "eim", &iommu->eim) < 0) + return NULL; =20 VIR_FREE(tmp); if ((tmp =3D virXMLPropString(driver, "aw_bits"))) { --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054559; cv=none; d=zohomail.com; s=zohoarc; b=Wx20CTBMkhzwT3WhIg/jocNvdbrOXY/qXAhA6/gckTdR8lCIZ6Wl9vOWrbkjuFBM9iIelXUOUmDpWSOCghul3P4MrvjtsgNTfW0ZWOkx6wmOvPTMOmX1OGCTH3vFKBQXzliX4Ptr1PHAEQL+/X/TMuuyFvFrKgm1E7y3OqttOHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054559; 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=GS7O2syX4WvVXIYA8jE3nyu3tFmTP/sxHU91ZvuTGBA=; b=TO1q/nh44P0RRqvVtyLnYMjTWhYo/bys2Jf9FxKUStxkMJtMj2FlC4HWjKh0/q2rHS6fiaLZaez6daNbcdAh8e5u8ty4YtMJ7WJZBpaQTDuo7iF6YJc120ux5rbnL/1btItWfx5m4A2MfHX9v0WZJCqEixRgOM1ob8Pq0fAsVzw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 161605455931413.126737379911901; Thu, 18 Mar 2021 01:02:39 -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-342-zDaiFfj1Pvej-EdWs9nblg-1; Thu, 18 Mar 2021 04:02:35 -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 0D98910866AA; Thu, 18 Mar 2021 08:02:31 +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 D4DEC70951; Thu, 18 Mar 2021 08:02:30 +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 891E0180C5C6; Thu, 18 Mar 2021 08:02:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I82Q73029021 for ; Thu, 18 Mar 2021 04:02:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id E73646362B; Thu, 18 Mar 2021 08:02:26 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30CCB669F2; Thu, 18 Mar 2021 08:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054557; 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=GS7O2syX4WvVXIYA8jE3nyu3tFmTP/sxHU91ZvuTGBA=; b=IQb2fZ7c9i4ozGpbz7slj9nxlzIcEl8bZUT22iHx8S02CiS0/fcg+slDnDIcijCNQ6RSML 0QSGK18GcYYlHJycXBlv+O7MGBkFD8t0SRd4sZsti2W6MvrzVcB2h1RNCF6/Z6/daslzYO qFXvA7jC5dYA+85psEL20TKfayqdsSQ= X-MC-Unique: zDaiFfj1Pvej-EdWs9nblg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 28/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainVsockDefParseXML Date: Thu, 18 Mar 2021 09:01:07 +0100 Message-Id: <20210318080117.70255-29-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2969cf0d88..39f171ba74 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15900,17 +15900,8 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xm= lopt, } } =20 - VIR_FREE(tmp); - if ((tmp =3D virXMLPropString(cid, "auto"))) { - val =3D virTristateBoolTypeFromString(tmp); - if (val <=3D 0) { - virReportError(VIR_ERR_XML_DETAIL, - _("'auto' attribute can be 'yes' or 'no': %= s"), - tmp); - return NULL; - } - vsock->auto_cid =3D val; - } + if (virXMLPropYesNo(cid, "auto", &vsock->auto_cid) < 0) + return NULL; } =20 if (virDomainDeviceInfoParseXML(xmlopt, node, &vsock->info, flags) < 0) --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054713; cv=none; d=zohomail.com; s=zohoarc; b=VDVzJ6xkFjjAy0QnjxiiD2hjsa6M8xlanMbWQO3QYT9SFJ+lIpZyDi5JPRB7vqtkDmkCtcmtkcCSy54yHdJK5vww0x+Xq6RKUf/5kqWuPl1ASm4Eu7MPtEzQi5jP/ICXrTNR15Za64//zELw+rnz1VDHmwcNE8h5qNH/hIh+jlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054713; 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=bpdWMYs6adJqgK0x6eZs/Wi53tELkwBp63hL1bus4ww=; b=ZAWJJsFQ5l3tGbF/UryZCegTCIzM/gBYPMJAP/oepx5FoCWM9HuR7d4YR0Z0Blxb74WsiURsTVqtWp55lCN0+6z9eg7bd7JYa9TsFQxA+ocFEQVFYHbdaPBXiBZKf4KoOo+jkA83SQxmNGqBzo8cjGDVp1/pz74mc5IoCNjd4mw= 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 1616054713364556.1756343719709; Thu, 18 Mar 2021 01:05: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-510-l7U3ERvxPjmV1A_7p6uz2w-1; Thu, 18 Mar 2021 04:02:40 -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 A1A2385EE8B; Thu, 18 Mar 2021 08:02:35 +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 5197B60C13; Thu, 18 Mar 2021 08:02:35 +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 051895003C; Thu, 18 Mar 2021 08:02:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I82Ud3029056 for ; Thu, 18 Mar 2021 04:02:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id E74366362B; Thu, 18 Mar 2021 08:02:30 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 370C169320; Thu, 18 Mar 2021 08:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054712; 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=bpdWMYs6adJqgK0x6eZs/Wi53tELkwBp63hL1bus4ww=; b=BoNA5DGwniTIOEUQnEkTymH8460N6VPyzYDeH4n7KhRBO8n9YNYxlgntMiUYxfsLSXNSRV rYOx5Kzq0MiuqwaqFxoRuijvgbV4pdVDVC8G9ghgpSrnXUxuxdOP/KKLO/B07BW3PrMCbO A7DMiUcpbnqmIFgSBdRQvX1KOnloGhY= X-MC-Unique: l7U3ERvxPjmV1A_7p6uz2w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 29/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainFeaturesDefParse Date: Thu, 18 Mar 2021 09:01:08 +0100 Message-Id: <20210318080117.70255-30-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 138 ++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 90 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 39f171ba74..4f020714bc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18292,6 +18292,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, =20 for (i =3D 0; i < n; i++) { g_autofree char *tmp =3D NULL; + virTristateSwitch triSwitch =3D VIR_TRISTATE_SWITCH_ABSENT; int val =3D virDomainFeatureTypeFromString((const char *)nodes[i]-= >name); if (val < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -18301,16 +18302,9 @@ virDomainFeaturesDefParse(virDomainDefPtr def, =20 switch ((virDomainFeature) val) { case VIR_DOMAIN_FEATURE_APIC: - if ((tmp =3D virXPathString("string(./features/apic/@eoi)", ct= xt))) { - int eoi; - if ((eoi =3D virTristateSwitchTypeFromString(tmp)) <=3D 0)= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown value for attribute eoi: '%s= '"), - tmp); - return -1; - } - def->apic_eoi =3D eoi; - } + if (virXMLPropOnOff(nodes[i], "eoi", &triSwitch) < 0) + return -1; + def->apic_eoi =3D triSwitch; G_GNUC_FALLTHROUGH; case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_PAE: @@ -18342,16 +18336,10 @@ virDomainFeaturesDefParse(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_SMM: - if ((tmp =3D virXMLPropString(nodes[i], "state"))) { - if ((def->features[val] =3D virTristateSwitchTypeFromStrin= g(tmp)) =3D=3D -1) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown state attribute '%s' of feat= ure '%s'"), - tmp, virDomainFeatureTypeToString(val)); - return -1; - } - } else { + if (virXMLPropOnOff(nodes[i], "state", &triSwitch) < 0) + return -1; + if ((def->features[val] =3D triSwitch) =3D=3D VIR_TRISTATE_SWI= TCH_ABSENT) def->features[val] =3D VIR_TRISTATE_SWITCH_ON; - } break; =20 case VIR_DOMAIN_FEATURE_GIC: @@ -18459,15 +18447,11 @@ virDomainFeaturesDefParse(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: - if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("missing state attribute '%s' of feature = '%s'"), - tmp, virDomainFeatureTypeToString(val)); + if (virXMLPropOnOff(nodes[i], "state", &triSwitch) < 0) return -1; - } - if ((def->features[val] =3D virTristateSwitchTypeFromString(tm= p)) < 0) { + if ((def->features[val] =3D triSwitch) =3D=3D VIR_TRISTATE_SWI= TCH_ABSENT) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown state attribute '%s' of feature = '%s'"), + _("missing state attribute '%s' of feature = '%s'"), tmp, virDomainFeatureTypeToString(val)); return -1; } @@ -18482,13 +18466,12 @@ virDomainFeaturesDefParse(virDomainDefPtr def, =20 if (def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D=3D VIR_TRISTATE_SWITC= H_ON) { int feature; - int value; + virTristateSwitch state =3D VIR_TRISTATE_SWITCH_ABSENT; xmlNodePtr node =3D ctxt->node; if ((n =3D virXPathNodeSet("./features/hyperv/*", ctxt, &nodes)) <= 0) return -1; =20 for (i =3D 0; i < n; i++) { - g_autofree char *tmp =3D NULL; feature =3D virDomainHypervTypeFromString((const char *)nodes[= i]->name); if (feature < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -18499,7 +18482,10 @@ virDomainFeaturesDefParse(virDomainDefPtr def, =20 ctxt->node =3D nodes[i]; =20 - if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { + if (virXMLPropOnOff(nodes[i], "state", &state) < 0) + return -1; + + if (state =3D=3D VIR_TRISTATE_SWITCH_ABSENT) { virReportError(VIR_ERR_XML_ERROR, _("missing 'state' attribute for " "HyperV Enlightenment feature '%s'"), @@ -18507,15 +18493,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - if ((value =3D virTristateSwitchTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid value of state argument " - "for HyperV Enlightenment feature '%s'"), - nodes[i]->name); - return -1; - } - - def->hyperv_features[feature] =3D value; + def->hyperv_features[feature] =3D state; =20 switch ((virDomainHyperv) feature) { case VIR_DOMAIN_HYPERV_RELAXED: @@ -18533,7 +18511,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, break; =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: - if (value !=3D VIR_TRISTATE_SWITCH_ON) + if (state !=3D VIR_TRISTATE_SWITCH_ON) break; =20 if (virXPathUInt("string(./@retries)", ctxt, @@ -18552,7 +18530,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, break; =20 case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (value !=3D VIR_TRISTATE_SWITCH_ON) + if (state !=3D VIR_TRISTATE_SWITCH_ON) break; =20 if (!(def->hyperv_vendor_id =3D virXMLPropString(nodes[i], @@ -18589,13 +18567,12 @@ virDomainFeaturesDefParse(virDomainDefPtr def, } =20 if (def->hyperv_features[VIR_DOMAIN_HYPERV_STIMER] =3D=3D VIR_TRISTATE= _SWITCH_ON) { - int value; + virTristateSwitch state =3D VIR_TRISTATE_SWITCH_ABSENT; + if ((n =3D virXPathNodeSet("./features/hyperv/stimer/*", ctxt, &no= des)) < 0) return -1; =20 for (i =3D 0; i < n; i++) { - g_autofree char *tmp =3D NULL; - if (STRNEQ((const char *)nodes[i]->name, "direct")) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unsupported Hyper-V stimer feature: %s"), @@ -18603,33 +18580,28 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { + if (virXMLPropOnOff(nodes[i], "state", &state) < 0) + return -1; + def->hyperv_stimer_direct =3D state; + + if (state =3D=3D VIR_TRISTATE_SWITCH_ABSENT) { virReportError(VIR_ERR_XML_ERROR, _("missing 'state' attribute for " "Hyper-V stimer '%s' feature"), "direct"); return -1; } - - if ((value =3D virTristateSwitchTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid value of state argument " - "for Hyper-V stimer '%s' feature"), "dire= ct"); - return -1; - } - - def->hyperv_stimer_direct =3D value; } VIR_FREE(nodes); } =20 if (def->features[VIR_DOMAIN_FEATURE_KVM] =3D=3D VIR_TRISTATE_SWITCH_O= N) { int feature; - int value; + if ((n =3D virXPathNodeSet("./features/kvm/*", ctxt, &nodes)) < 0) return -1; =20 for (i =3D 0; i < n; i++) { - g_autofree char *tmp =3D NULL; + virTristateSwitch state =3D VIR_TRISTATE_SWITCH_ABSENT; =20 feature =3D virDomainKVMTypeFromString((const char *)nodes[i]-= >name); if (feature < 0) { @@ -18643,7 +18615,11 @@ virDomainFeaturesDefParse(virDomainDefPtr def, case VIR_DOMAIN_KVM_HIDDEN: case VIR_DOMAIN_KVM_DEDICATED: case VIR_DOMAIN_KVM_POLLCONTROL: - if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { + if (virXMLPropOnOff(nodes[i], "state", &state) < 0) + return -1; + def->kvm_features[feature] =3D state; + + if (state =3D=3D VIR_TRISTATE_SWITCH_ABSENT) { virReportError(VIR_ERR_XML_ERROR, _("missing 'state' attribute for " "KVM feature '%s'"), @@ -18651,15 +18627,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - if ((value =3D virTristateSwitchTypeFromString(tmp)) <= 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid value of state argument " - "for KVM feature '%s'"), - nodes[i]->name); - return -1; - } - - def->kvm_features[feature] =3D value; break; =20 /* coverity[dead_error_begin] */ @@ -18672,14 +18639,13 @@ virDomainFeaturesDefParse(virDomainDefPtr def, =20 if (def->features[VIR_DOMAIN_FEATURE_XEN] =3D=3D VIR_TRISTATE_SWITCH_O= N) { int feature; - int value; g_autofree char *ptval =3D NULL; - g_autofree char *tmp =3D NULL; =20 if ((n =3D virXPathNodeSet("./features/xen/*", ctxt, &nodes)) < 0) return -1; =20 for (i =3D 0; i < n; i++) { + virTristateSwitch state =3D VIR_TRISTATE_SWITCH_ABSENT; feature =3D virDomainXenTypeFromString((const char *)nodes[i]-= >name); if (feature < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -18688,7 +18654,12 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { + if (virXMLPropOnOff(nodes[i], "state", &state) < 0) + return -1; + + def->xen_features[feature] =3D state; + + if (state =3D=3D VIR_TRISTATE_SWITCH_ABSENT) { virReportError(VIR_ERR_XML_ERROR, _("missing 'state' attribute for " "Xen feature '%s'"), @@ -18696,22 +18667,12 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - if ((value =3D virTristateSwitchTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid value of state argument " - "for Xen feature '%s'"), - nodes[i]->name); - return -1; - } - - def->xen_features[feature] =3D value; - switch ((virDomainXen) feature) { case VIR_DOMAIN_XEN_E820_HOST: break; =20 case VIR_DOMAIN_XEN_PASSTHROUGH: - if (value !=3D VIR_TRISTATE_SWITCH_ON) + if (state !=3D VIR_TRISTATE_SWITCH_ON) break; =20 if ((ptval =3D virXMLPropString(nodes[i], "mode"))) { @@ -18781,7 +18742,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; =20 for (i =3D 0; i < n; i++) { - g_autofree char *tmp =3D NULL; + virTristateSwitch state =3D VIR_TRISTATE_SWITCH_ABSENT; int val =3D virDomainProcessCapsFeatureTypeFromString((const char = *)nodes[i]->name); if (val < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -18789,16 +18750,13 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - if ((tmp =3D virXMLPropString(nodes[i], "state"))) { - if ((def->caps_features[val] =3D virTristateSwitchTypeFromStri= ng(tmp)) =3D=3D -1) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown state attribute '%s' of feature = capability '%s'"), - tmp, virDomainProcessCapsFeatureTypeToStrin= g(val)); - return -1; - } - } else { - def->caps_features[val] =3D VIR_TRISTATE_SWITCH_ON; - } + if (virXMLPropOnOff(nodes[i], "state", &state) < 0) + return -1; + + if (state =3D=3D VIR_TRISTATE_SWITCH_ABSENT) + state =3D VIR_TRISTATE_SWITCH_ON; + + def->caps_features[val] =3D state; } VIR_FREE(nodes); return 0; --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054767; cv=none; d=zohomail.com; s=zohoarc; b=ZVXbsaff6MCBS06m1gUcGLo8AuCPhDaVgdpeEVEdvwluHrb2WghBbyDNlrTO5PdxUzz9/vXlXHLXsQEsVkuDtMY8gHKlNz6T16qopeSUG1eVuDpE7RhYsomSSHSUWVK6UWBd6LxF8E4YaKIGr4r0lkwaj/P2BhnXa4044nGKmws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054767; 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=Mh/1HFpIEv/3yYwDyYyKq7D/05c/twFRbJfOMDsKMHg=; b=B+M/AAu+LLc3hv60NemKUQHKdd+emmY6N7nB9nKz/PwbmEJa3OPf6tDZzoKAXYrrkniC35MSMfqTTaAr/Lsb6C+5t9MdHfx7v42mWmhdR7lNgbs9inqbvZXSSKIDLEzdbjnBNZlvVuMMkb1sf2soAadd2H3Zga4RPs3TJNH4Tsw= 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 1616054766164895.4268519894093; Thu, 18 Mar 2021 01:06: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-263-tELeOhhEPiWkZMW3owmDbw-1; Thu, 18 Mar 2021 04:02:41 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 827C791250; Thu, 18 Mar 2021 08:02:35 +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 5B3F9710A3; Thu, 18 Mar 2021 08:02:35 +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 1CA595003D; Thu, 18 Mar 2021 08:02:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I82WVk029070 for ; Thu, 18 Mar 2021 04:02:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 039C866A16; Thu, 18 Mar 2021 08:02:32 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46C1A6268F; Thu, 18 Mar 2021 08:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054763; 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=Mh/1HFpIEv/3yYwDyYyKq7D/05c/twFRbJfOMDsKMHg=; b=h+UkDWcgFoTGL74bghNJ+u4WXL/n3USORXBFPVQxHjYoPPDjhElBAGEKie9BWb7v8lyIWS Tb0/jCIC01pesHSWUaLdj/WoU68Or4Z8I6AhzVnIiYrGDaw/6mEbJVkPBI6nQd8yf49sK2 XOV5fOFlhq0BLDkmoE4YyvZZOtNYhRQ= X-MC-Unique: tELeOhhEPiWkZMW3owmDbw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 30/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainLoaderDefParseXML Date: Thu, 18 Mar 2021 09:01:09 +0100 Message-Id: <20210318080117.70255-31-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.11 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4f020714bc..9b4c083801 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18806,14 +18806,15 @@ virDomainLoaderDefParseXML(xmlNodePtr node, virDomainLoaderDefPtr loader, bool fwAutoSelect) { - g_autofree char *readonly_str =3D NULL; - g_autofree char *secure_str =3D NULL; g_autofree char *type_str =3D NULL; - - secure_str =3D virXMLPropString(node, "secure"); + virTristateBool readonly =3D VIR_TRISTATE_BOOL_ABSENT; + virTristateBool secure =3D VIR_TRISTATE_BOOL_ABSENT; =20 if (!fwAutoSelect) { - readonly_str =3D virXMLPropString(node, "readonly"); + if (virXMLPropYesNo(node, "readonly", &readonly) < 0) + return -1; + loader->readonly =3D readonly; + type_str =3D virXMLPropString(node, "type"); if (!(loader->path =3D virXMLNodeContentString(node))) return -1; @@ -18822,19 +18823,9 @@ 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); + if (virXMLPropYesNo(node, "secure", &secure) < 0) return -1; - } - - if (secure_str && - (loader->secure =3D virTristateBoolTypeFromString(secure_str)) <= =3D 0) { - virReportError(VIR_ERR_XML_DETAIL, - _("unknown secure value: %s"), secure_str); - return -1; - } + loader->secure =3D secure; =20 if (type_str) { int type; --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054570; cv=none; d=zohomail.com; s=zohoarc; b=bsha3oVBQA2zmMjy4AHNftgaPP2qZU4MS2XGqCBMTU73T0Cs3XJvCuVncTb3lw/hUmzxcqcjB2N9GTQfPs3h3YjLuEDIMntOwvQUcJ4E5XZQ9Sfbho/b0SSOOYS5nhERak3zgoRh47xvQkpTctIsuSdYxA5HH3Wf9CMm0KmwzM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054570; 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=IIinfGn1345nwe1ovbVgGiByQTDWhPEWmDffdPyBktg=; b=IS8mCugiPnwD6wkXTr6D6gRXiuwVeU1uEO94K1MZTp4VgillPXLPhiiuKvcyKtnnNZ99XmcZnuAGpcrutkbOfxcKKcX/Tf9vMWKJ6U2UQGTHwGCVqEejQ/3DhdkIfzrmPVuOfVfluB5gHfg52VQpMP6usknplw8yGVuAllv2cmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054570917291.3653051197996; Thu, 18 Mar 2021 01:02:50 -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-480-gdfv2ovSPeumjV2m0UtQcw-1; Thu, 18 Mar 2021 04:02:45 -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 2361C8015BD; Thu, 18 Mar 2021 08:02:40 +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 EDF275E1A4; Thu, 18 Mar 2021 08:02:39 +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 ADA141802137; Thu, 18 Mar 2021 08:02:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I82cEi029106 for ; Thu, 18 Mar 2021 04:02:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id AA61769322; Thu, 18 Mar 2021 08:02:38 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id E047166A16; Thu, 18 Mar 2021 08:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054567; 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=IIinfGn1345nwe1ovbVgGiByQTDWhPEWmDffdPyBktg=; b=YGf94a26hVvYmK9a0ZvOWAPFzIM1vF7fc5esQPHH6LOJkmeIuPXt5U8oMqpoHbEUBtAHTR CLJ5pg7jZ3zz7bE04TEawc53FdGtARaMCTnwzSYXBJX0EuoSzVc271mrLbusSP3n3OnwPC uQ9/Q58NhIhzVH2UAzS/4igTHiOMq8Q= X-MC-Unique: gdfv2ovSPeumjV2m0UtQcw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 31/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainVcpuParse Date: Thu, 18 Mar 2021 09:01:10 +0100 Message-Id: <20210318080117.70255-32-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9b4c083801..66d3080744 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19096,7 +19096,7 @@ virDomainVcpuParse(virDomainDefPtr def, =20 for (i =3D 0; i < n; i++) { virDomainVcpuDefPtr vcpu; - int state; + virTristateBool state =3D VIR_TRISTATE_BOOL_ABSENT; unsigned int id; unsigned int order; =20 @@ -19118,31 +19118,18 @@ virDomainVcpuParse(virDomainDefPtr def, =20 vcpu =3D virDomainDefGetVcpu(def, id); =20 - if (!(tmp =3D virXMLPropString(nodes[i], "enabled"))) { + if (virXMLPropYesNo(nodes[i], "enabled", &state) < 0) + return -1; + if (state =3D=3D VIR_TRISTATE_BOOL_ABSENT) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing vcpu enabled state")); return -1; } =20 - if ((state =3D virTristateBoolTypeFromString(tmp)) < 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid vcpu 'enabled' value '%s'"), tmp= ); - return -1; - } - VIR_FREE(tmp); - vcpu->online =3D state =3D=3D VIR_TRISTATE_BOOL_YES; =20 - if ((tmp =3D virXMLPropString(nodes[i], "hotpluggable"))) { - int hotpluggable; - if ((hotpluggable =3D virTristateBoolTypeFromString(tmp)) = < 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid vcpu 'hotpluggable' value '%= s'"), tmp); - return -1; - } - vcpu->hotpluggable =3D hotpluggable; - VIR_FREE(tmp); - } + if (virXMLPropYesNo(nodes[i], "hotpluggable", &vcpu->hotplugga= ble) < 0) + return -1; =20 if ((tmp =3D virXMLPropString(nodes[i], "order"))) { if (virStrToLong_uip(tmp, NULL, 10, &order) < 0) { --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054605; cv=none; d=zohomail.com; s=zohoarc; b=YmMstPwgFXrxmwM0i1aRL2nSZU536Q4Z67VKzFbAq6p3cLycaNl8x1gkTNDRUIYneWyENjzXhGXET0iWjmxCveaRPH+qrei92FFDFgZgLIQX5fCytNJ79V5gZKjM2Br2Aevy4/2jeYrip++l3VMJaIuIIF0kzXsdDXK7t6kEV2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054605; 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=kY+t/dpLtS1qaqgMNiVC4TuPHP7epyGGwhndX5kRJXU=; b=mf+R1AnMFHwvAK2TzmKJjpUVpvhRjjiE0C4tMvszm7uB35KHwXWUFYWbw9/QMvr/a2VtKo1QX41sH0U3r0q9Nwszao7AC8M9h7AN7ifFbHLpaxADLPgjh9Hj81e7wt15JN0+BTYhkBZRFRf3ONU7ISZMD2RJsxKbf+f3b5Bvqe4= 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 1616054605489240.6923355519632; Thu, 18 Mar 2021 01:03:25 -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-553-K04c9SpPMWOHSSbpjsni9Q-1; Thu, 18 Mar 2021 04:03:05 -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 C726783DD20; Thu, 18 Mar 2021 08:02:49 +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 9F44C5E1A4; Thu, 18 Mar 2021 08:02: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 3B19550042; Thu, 18 Mar 2021 08:02:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I82mVa029175 for ; Thu, 18 Mar 2021 04:02:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 38A1066A16; Thu, 18 Mar 2021 08:02:48 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E3BB69324; Thu, 18 Mar 2021 08:02:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054590; 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=kY+t/dpLtS1qaqgMNiVC4TuPHP7epyGGwhndX5kRJXU=; b=DD6jE3dQuQni/F9UdgrNudDectPDeR6VHmHJpBC0416Fse8qJUaRH6RNRusDBczc61YOsH DYYd99R7NO/kPgYuXNuPcWfmwbz/7Oyu166twycdsbdnl1Kg++Qv/L2jOO2gwnCPikrM9R S0XTpHustwKWFyCduoJImAPP/0oc2L4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054602; 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=kY+t/dpLtS1qaqgMNiVC4TuPHP7epyGGwhndX5kRJXU=; b=X5QvomxQVyoTiLWzF7vkzM0udIOuEGkDRa4SgD3p91lbTe+wEKEyRQOmoCQ9eJXaO91EML Xfu0yt4amYGCRyIumUlilM0rTYXi1RlEOpanDmDgbbmTiyhckW3RJ8xcd3JEafYIYUAAjq L7d1izV3JFPwIfGB+T3OvWGxWLt1Qa8= X-MC-Unique: K04c9SpPMWOHSSbpjsni9Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 32/38] backup_conf: Use virXMLProp(OnOff|YesNo) in virDomainBackupDiskDefParseXML Date: Thu, 18 Mar 2021 09:01:11 +0100 Message-Id: <20210318080117.70255-33-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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) (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/backup_conf.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index ba58b2e322..8560f3bf2e 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -106,7 +106,6 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node, g_autofree char *type =3D NULL; g_autofree char *format =3D NULL; g_autofree char *idx =3D NULL; - g_autofree char *backup =3D NULL; g_autofree char *state =3D NULL; g_autofree char *backupmode =3D NULL; int tmp; @@ -125,17 +124,10 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node, return -1; } =20 - def->backup =3D VIR_TRISTATE_BOOL_YES; - - if ((backup =3D virXMLPropString(node, "backup"))) { - if ((tmp =3D virTristateBoolTypeFromString(backup)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid disk 'backup' state '%s'"), backup); - return -1; - } - - def->backup =3D tmp; - } + if (virXMLPropYesNo(node, "backup", &def->backup) < 0) + return -1; + if (def->backup =3D=3D VIR_TRISTATE_BOOL_ABSENT) + def->backup =3D VIR_TRISTATE_BOOL_YES; =20 /* don't parse anything else if backup is disabled */ if (def->backup =3D=3D VIR_TRISTATE_BOOL_NO) --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054635; cv=none; d=zohomail.com; s=zohoarc; b=jxAFHepGHAhY3EYuI4mT4Ob03rem/Hn6CSnSknE65bp2kIhtS9l9Fuq13o69G6vwk4NkbQkpxXWn9tDdZ8aUOxUEvVew9ja/lEPQfGGlL8sMXZVu49TT03ImLa0dgG2c7PNH9B4yGDxZGM5N5Gv/wLwjbqWFasenmWbnPrOkvUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054635; 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=+dWvXBdLOXpl7p+8UaOf84sJPfMi/R/R8VOuXMF5C34=; b=n4kD00QZc0LkiaQltnqrWNZ9wcZQ5Jnc1MG8sUBF+OBrcqM4tIcqkaupcpd+NlZcOzmO27RUCEIubx7ODodGo+q2eoc6ED4Phlr8FNFIrobWaq/vBiUbTBbGjiXcPZzLVs/mfSxwYLF/TOF0Z3ZBXrHHbwhDre4S2lExVgB5Tp4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1616054635268759.107182703414; Thu, 18 Mar 2021 01:03:55 -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-532-v-3enFHwNmafMfstEd_2dw-1; Thu, 18 Mar 2021 04:03:03 -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 4AEF7190A7AC; Thu, 18 Mar 2021 08:02: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 27984610F0; Thu, 18 Mar 2021 08:02: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 CFF241802146; Thu, 18 Mar 2021 08:02:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I82u1A029210 for ; Thu, 18 Mar 2021 04:02:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 82E6566A16; Thu, 18 Mar 2021 08:02:56 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id E430969320; Thu, 18 Mar 2021 08:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054585; 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=+dWvXBdLOXpl7p+8UaOf84sJPfMi/R/R8VOuXMF5C34=; b=TkoRzeCFYHr/u4YUeF/SK0sPVECj92zsBHs5gxbMGVLk/FWnRPaOu2hpUHpxprbIH4u3sT 6LUD20ZnVPioRyZLzvZhg8egPii65Kj8W4F18fCZaBqgux1km+BR37vvU35AJINlOFPOqe EgXil3yjZOHL7M3/CrUV5u1UIqx48h4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054634; 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=+dWvXBdLOXpl7p+8UaOf84sJPfMi/R/R8VOuXMF5C34=; b=FR1165BWN2QZ0q7Qavr1kt6FAgKBGk3Kal4vV6vys5RDv0MM8jCQPZSBuLLyWQlLOG3wAZ o7HUspq4fKB8c9fpSTDhyQnPJPl6QSY+CXTDiGNh0tfFBl/U0D5wKC4J5p3QGZ9KXRojYa +8uPYzhJvbXTiSPrk8XLnDs3R4NRG5g= X-MC-Unique: v-3enFHwNmafMfstEd_2dw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 33/38] backup_conf: Use virXMLProp(OnOff|YesNo) in virDomainBackupDefParse Date: Thu, 18 Mar 2021 09:01:12 +0100 Message-Id: <20210318080117.70255-34-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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) (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/backup_conf.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index 8560f3bf2e..3a1863d2c3 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -234,8 +234,6 @@ virDomainBackupDefParse(xmlXPathContextPtr ctxt, def->incremental =3D virXPathString("string(./incremental)", ctxt); =20 if ((node =3D virXPathNode("./server", ctxt))) { - g_autofree char *tls =3D NULL; - if (def->type !=3D VIR_DOMAIN_BACKUP_TYPE_PULL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("use of requires pull mode backup")); @@ -261,18 +259,8 @@ virDomainBackupDefParse(xmlXPathContextPtr ctxt, return NULL; } =20 - if ((tls =3D virXMLPropString(node, "tls"))) { - int tmp; - - if ((tmp =3D virTristateBoolTypeFromString(tls)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown value '%s' of 'tls' attribute"),\ - tls); - return NULL; - } - - def->tls =3D tmp; - } + if (virXMLPropYesNo(node, "tls", &def->tls) < 0) + return NULL; } =20 if ((n =3D virXPathNodeSet("./disks/*", ctxt, &nodes)) < 0) --=20 2.26.2 From nobody Thu May 9 04:53:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1616054599; cv=none; d=zohomail.com; s=zohoarc; b=Oka1GxXFKMI4EMm9g2mxdNy8/2f2T6iwTq4T271GQhizdzqe1U+lr2A2uy5dL+GQSSXy2zvdcn1PHbRdkf4bnzhmoiqxfLWsTiJxQljYNXlq+5Y7SBjiO5QX/UQD+6atGKtIY3ns96H0v0tJCXaX8BiZYZQofxB+X+Bj7xv86WU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054599; 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=C9MNgAxRUFsLoCgNVFLr7p4sXV+v13O+vAeBQl1rvs8=; b=LXfxKMNkTYgkX+b5wSEAYdDmt7W8TYjRbGG6Cyvu/ZOvD5+RgTKWa3B1V/W6nVHklx/Jlh+pgitx+Og/Ib6TMB8WyuSC2rGdqjGPd4Qd6NxhDsclMGUxraeEO7zcVKbtJMrdoBfdOI0ro0pgBC2CIWoGEtG28TxATMjYsIwsCmA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 161605459949084.11471898489697; Thu, 18 Mar 2021 01:03:19 -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-352-CCfhVdoAPhePlcX2Ck7QBA-1; Thu, 18 Mar 2021 04:03:16 -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 27D2783DD20; Thu, 18 Mar 2021 08:03:11 +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 F3EA3610F0; Thu, 18 Mar 2021 08:03: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 AF91550044; Thu, 18 Mar 2021 08:03:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I839fe029305 for ; Thu, 18 Mar 2021 04:03:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id CBAC969321; Thu, 18 Mar 2021 08:03:09 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2332B66A16; Thu, 18 Mar 2021 08:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054598; 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=C9MNgAxRUFsLoCgNVFLr7p4sXV+v13O+vAeBQl1rvs8=; b=NqAJ8mMnrnFLq34P01r+CkmNcnN/nwgbAZ35uHBfiN86/ZjdxsYhAlJ/wIiL6F0EA/LdFX 4qxWNx6DOsBD4G5jypsgNlPx/DaReAPEgo75EbaHp1Oeu00vh/oe5hK2/tcqrtXZ9JH39N 8tMs3ZGA2E7Yoz74HVUADy2UYrxxiag= X-MC-Unique: CCfhVdoAPhePlcX2Ck7QBA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 34/38] device_conf: Use virXMLProp(OnOff|YesNo) in virPCIDeviceAddressParseXML Date: Thu, 18 Mar 2021 09:01:13 +0100 Message-Id: <20210318080117.70255-35-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/device_conf.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 714ac50762..ee248648bd 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -214,7 +214,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, g_autofree char *bus =3D virXMLPropString(node, "bus"); g_autofree char *slot =3D virXMLPropString(node, "slot"); g_autofree char *function =3D virXMLPropString(node, "function"); - g_autofree char *multi =3D virXMLPropString(node, "multifunction"); + virTristateSwitch multifunction =3D VIR_TRISTATE_SWITCH_ABSENT; =20 memset(addr, 0, sizeof(*addr)); =20 @@ -246,14 +246,10 @@ 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); + if (virXMLPropOnOff(node, "multifunction", &multifunction) < 0) return -1; + addr->multi =3D multifunction; =20 - } if (!virPCIDeviceAddressIsEmpty(addr) && !virPCIDeviceAddressIsValid(a= ddr, true)) return -1; =20 --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054647; cv=none; d=zohomail.com; s=zohoarc; b=RvFqXMBuxd3PGTL3HblM1+NiG3pMWRh4gDCmZP9g8c4xiOfhb3Fk3JFJOlXHiGgDSrETFV37A81zFpuNy58nynLX0G6bh83zN/4pWvC5TmlYK7GnW71Uw7wucWyqScOjyXCOAmLS+xYc2TrsDWP9e1cfWsqZ9Rdykst2kgd2t+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054647; 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=i2WqmXue3Wbh+e0JaxH2ujwon649FraO5tTthieladM=; b=CAOhh0oDII6LBuMmB8RONW933aR5KSNCmcoJ4o62VMZ9urvMwYK4w8DEc5viZuhTvxaMgaJPj+ViTm9Nm0Qk4mcEM3RpFtkNlZ6Z5ZixsefH6hTyfCEy0yywmWv7Kh6QV8EkA0L6ziDXMTez1O7nxZQ59ng+ZjVejgyl5kKq7b8= 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 161605464720992.52459597321536; Thu, 18 Mar 2021 01:04:07 -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-101-RGo-kOm2MpedREwKwIRlaA-1; Thu, 18 Mar 2021 04:03:25 -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 D412483DD23; Thu, 18 Mar 2021 08:03:18 +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 A3A321F423; Thu, 18 Mar 2021 08:03:18 +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 60D631802136; Thu, 18 Mar 2021 08:03:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I83GBO029416 for ; Thu, 18 Mar 2021 04:03:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id E503E66A16; Thu, 18 Mar 2021 08:03:16 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA0E669322; Thu, 18 Mar 2021 08:03:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054646; 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=i2WqmXue3Wbh+e0JaxH2ujwon649FraO5tTthieladM=; b=NomGZ6r9Sf3UoYVJagj5Pel4r/HA5bsyMsD44ZdxT6U+tkmOGEg2dGAniY/ENLe4Tysbv/ KYmYsVb3mZX7yftIFN6m9fpUL0ptedf7a7ISm8itO3STIsP8lVhdXnia3gtNJ60NTqIn/f vsxVyWJHgYXEL0dW7Eu7Fu8vfBjWBJ4= X-MC-Unique: RGo-kOm2MpedREwKwIRlaA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 35/38] network_conf: Use virXMLProp(OnOff|YesNo) in virNetworkForwardNatDefParseXML Date: Thu, 18 Mar 2021 09:01:14 +0100 Message-Id: <20210318080117.70255-36-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/network_conf.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 4cf4aa4840..93972a544a 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -1321,7 +1321,6 @@ virNetworkForwardNatDefParseXML(const char *networkNa= me, g_autofree xmlNodePtr *natPortNodes =3D NULL; g_autofree char *addrStart =3D NULL; g_autofree char *addrEnd =3D NULL; - g_autofree char *ipv6 =3D NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) =20 ctxt->node =3D node; @@ -1333,18 +1332,8 @@ virNetworkForwardNatDefParseXML(const char *networkN= ame, return -1; } =20 - ipv6 =3D virXMLPropString(node, "ipv6"); - if (ipv6) { - int natIPv6; - if ((natIPv6 =3D virTristateBoolTypeFromString(ipv6)) <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("Invalid ipv6 setting '%s' " - "in network '%s' NAT"), - ipv6, networkName); - return -1; - } - def->natIPv6 =3D natIPv6; - } + if (virXMLPropYesNo(node, "ipv6", &def->natIPv6) < 0) + return -1; =20 /* addresses for SNAT */ nNatAddrs =3D virXPathNodeSet("./address", ctxt, &natAddrNodes); --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054639; cv=none; d=zohomail.com; s=zohoarc; b=Q3QzftlQ2kfzZS6Jy2nxuokXbTHg1JWtiSli7pR0AkLeWNQNnScFuDHcBzzPWUH1zxMoaZTle2VeB2Y4btjCY3UHNmSRKCSZdvb62qv+h9ufOS7uBxdLNaDXvTi1+IjYzw6mLTW4yszgG/+egXW952dM9qrlaD3+E5CuPk8GXnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054639; 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=h4RhvHrtFt4+0MLC/u7qjUkGO9x0x7FA2x5Awxqa5l4=; b=OrtNHbNg8RTsW3XqCpXJRWpn2FDJCHxgapyeZglJj+N0nzpx+Bzy4QUdLHWnyWG6EcBKxlX0PfqhVLtAl0goWFxa/L84Sv2FeFr69JDdLE2wiOldTiAitSnHjGsnX1aXu2olapFU2Z8FuJOyCot2EKbpq0hyOlvDdWSqNbyMK+M= 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 1616054639195812.5754547206151; Thu, 18 Mar 2021 01:03: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-385-G7yw2t02NPmEsA3JLRrxSw-1; Thu, 18 Mar 2021 04:03:55 -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 8150ECC625; Thu, 18 Mar 2021 08:03: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 322985D9CA; Thu, 18 Mar 2021 08:03: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 E2D331809C83; Thu, 18 Mar 2021 08:03:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I83m1d029528 for ; Thu, 18 Mar 2021 04:03:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2F45D66A16; Thu, 18 Mar 2021 08:03:48 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D1C369322; Thu, 18 Mar 2021 08:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054638; 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=h4RhvHrtFt4+0MLC/u7qjUkGO9x0x7FA2x5Awxqa5l4=; b=ce6n3TD53IGAff+LOydJ+Uwf8cDhfDzh+egEjdLShgDi3eeeE0WES54RESV/bNc8iVrARO 215AI/WDBADdYM8daVTnAw6v1Bo/ENbHlXHwgWDt/J6tWRrf/2E+5JPulWcKM26Y7UPGB7 0CZohR8Xtw/4pafLxtbDmeCObw95xU4= X-MC-Unique: G7yw2t02NPmEsA3JLRrxSw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 36/38] numa_conf: Use virXMLProp(OnOff|YesNo) in virDomainNumaDefParseXML Date: Thu, 18 Mar 2021 09:01:15 +0100 Message-Id: <20210318080117.70255-37-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/numa_conf.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 64b93fd7d1..d16a44c955 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -1079,17 +1079,8 @@ virDomainNumaDefParseXML(virDomainNumaPtr def, VIR_FREE(tmp); } =20 - if ((tmp =3D virXMLPropString(nodes[i], "discard"))) { - if ((rc =3D virTristateBoolTypeFromString(tmp)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Invalid 'discard' attribute value '%s'"), - tmp); - goto cleanup; - } - - def->mem_nodes[cur_cell].discard =3D rc; - VIR_FREE(tmp); - } + if (virXMLPropYesNo(nodes[i], "discard", &def->mem_nodes[cur_cell]= .discard) < 0) + goto cleanup; =20 /* Parse NUMA distances info */ if (virDomainNumaDefNodeDistanceParseXML(def, ctxt, cur_cell) < 0) --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054653; cv=none; d=zohomail.com; s=zohoarc; b=A39jyiEP4N5ofq4AiZMitAuVUCfl8Jz9nv7pmzrjIlHRQy1enWZxtBw1LnddtAgSuByuIBcv5ydOSVTE9ruitJRYXUB7hiMRNcOZa0r1LxTo5vhrwhuppcrUv74ZIxuKrJmvgffi8PjCKmnKUO+v90Ye48cnIPXnSh6dcaD4KSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054653; 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=lKGXZ9VMCZEhyNITN+kFF6I0l/VsXQ/aCTMP1jmKKLE=; b=kk5eNgCVsKrzhL7WxJXItBz+2DUFyDl+bGQKB3GSKeSFKEfy6p4edKxMlCIEaZNIrCWI1sdiKQfmgWQFEzBCjUA8iBycYTar0G6eVxtltgrknnzaegdsmgKSxJlqbftvq+QF10yOVzJKunpCduPT0JbCtFgY2HugEdYVZCO89Es= 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 1616054653106882.1917570491044; Thu, 18 Mar 2021 01:04: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-483-h4YdKxPROQa5YpAJK7Qczg-1; Thu, 18 Mar 2021 04:04:09 -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 8ACA7104F958; Thu, 18 Mar 2021 08:04:02 +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 5D1821F41E; Thu, 18 Mar 2021 08:04: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 0CFC24BB7C; Thu, 18 Mar 2021 08:04:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I840Vd029546 for ; Thu, 18 Mar 2021 04:04:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id DD5E263634; Thu, 18 Mar 2021 08:04:00 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C3D266A16; Thu, 18 Mar 2021 08:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054652; 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=lKGXZ9VMCZEhyNITN+kFF6I0l/VsXQ/aCTMP1jmKKLE=; b=HNd3q+3ztSdmC9T0VTHv2v7/2xOn8KTiCDWCJsKtpefO1xJazg4P+lvJN5K9mVtKNZ4o8O yllwgNyh+4UC546JWvWFcPYbV4CsnTb1tw1S61qSpUoOIe8G4ipV+gkaARGRzyYT4LSN4W RdLu0DDBKrk9taKNYHZ7HJzxbzlbuPY= X-MC-Unique: h4YdKxPROQa5YpAJK7Qczg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 37/38] storage_adapter_conf: Use virXMLProp(OnOff|YesNo) in virStorageAdapterParseXMLFCHost Date: Thu, 18 Mar 2021 09:01:16 +0100 Message-Id: <20210318080117.70255-38-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/storage_adapter_conf.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_con= f.c index 77ecb8d5f2..96e6c733d0 100644 --- a/src/conf/storage_adapter_conf.c +++ b/src/conf/storage_adapter_conf.c @@ -64,26 +64,19 @@ static int virStorageAdapterParseXMLFCHost(xmlNodePtr node, virStorageAdapterFCHostPtr fchost) { - char *managed =3D NULL; + virTristateBool managed =3D VIR_TRISTATE_BOOL_ABSENT; =20 - fchost->parent =3D virXMLPropString(node, "parent"); - if ((managed =3D virXMLPropString(node, "managed"))) { - if ((fchost->managed =3D virTristateBoolTypeFromString(managed)) <= 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown fc_host managed setting '%s'"), - managed); - VIR_FREE(managed); - return -1; - } - } + if (virXMLPropYesNo(node, "managed", &managed) < 0) + return -1; =20 + fchost->parent =3D virXMLPropString(node, "parent"); + fchost->managed =3D managed; fchost->parent_wwnn =3D virXMLPropString(node, "parent_wwnn"); fchost->parent_wwpn =3D virXMLPropString(node, "parent_wwpn"); fchost->parent_fabric_wwn =3D virXMLPropString(node, "parent_fabric_ww= n"); fchost->wwpn =3D virXMLPropString(node, "wwpn"); fchost->wwnn =3D virXMLPropString(node, "wwnn"); =20 - VIR_FREE(managed); return 0; } =20 --=20 2.26.2 From nobody Thu May 9 04:53:59 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=1616054765; cv=none; d=zohomail.com; s=zohoarc; b=WVSg9oAkeAm48rrBtijg7tACIvTQ0K0fWJeh5UOZ6qgbtEm/uLJUBO6Ne6lgqL0sZMr0CP9n3v4ojU3KYBGdOv97oMa/eZXsa2FI4QmZCHTTypCutOe7afFRy1+MTldv7Fb+uTBP7oQwWknCue/qvrUV5TjrX636JH1HjVCc+vY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616054765; 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=tWeL5frMsga10VSiJjVWCd59WH4U6t2QakNLRm8Pa4I=; b=geAQF/BcOxweNNuQ58fM8exLutDIODyasXVqCumc6RhnVk4j2rJzben3N6Yq41M6HTa5Q4R+LNONPjbnvNVdSGav0eFXs3BLKrfeISwb3onnho00v4FUGT5sPFpMdCTBt0haqtFHS69NhchYmXn8TZz1FsUokEp+BU4gbAyjFl0= 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 1616054765051283.24957964984435; Thu, 18 Mar 2021 01:06:05 -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-382-JnxLT-hYO8aC7V0YlsprjQ-1; Thu, 18 Mar 2021 04:04: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 50E351922963; Thu, 18 Mar 2021 08:04:10 +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 25AEB19C45; Thu, 18 Mar 2021 08:04: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 D9CA24BB7C; Thu, 18 Mar 2021 08:04:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I84853029612 for ; Thu, 18 Mar 2021 04:04:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1CF9B6268F; Thu, 18 Mar 2021 08:04:08 +0000 (UTC) Received: from work.redhat.com (ovpn-112-180.ams2.redhat.com [10.36.112.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64CC56A8E4; Thu, 18 Mar 2021 08:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616054764; 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=tWeL5frMsga10VSiJjVWCd59WH4U6t2QakNLRm8Pa4I=; b=XPIZBqhnYVsDZbZI/9oUs+hHRtF4vWiNWirakoxyFodQCWqZmKR8MEVN14Kfl5gLT1Aozp oZXuSlCVln6xRz4gtNz6gwhDIMGsa8A3ZSPWEhPpygFnf3zfhrkAGGHYHMlahVa6mgKS9K aIjzEK2TPZYhgZwnt97nWoiBekHgxp8= X-MC-Unique: JnxLT-hYO8aC7V0YlsprjQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 38/38] storage_conf: Use virXMLProp(OnOff|YesNo) in virStoragePoolDefParseSource Date: Thu, 18 Mar 2021 09:01:17 +0100 Message-Id: <20210318080117.70255-39-twiederh@redhat.com> In-Reply-To: <20210318080117.70255-1-twiederh@redhat.com> References: <20210318080117.70255-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Reviewed-by: Michal Privoznik --- src/conf/storage_conf.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 2e07c81f8a..7dc528b103 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -605,7 +605,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, goto cleanup; =20 for (i =3D 0; i < nsource; i++) { - g_autofree char *partsep =3D NULL; + virTristateBool partsep =3D VIR_TRISTATE_BOOL_ABSENT; virStoragePoolSourceDevice dev =3D { .path =3D NULL }; dev.path =3D virXMLPropString(nodeset[i], "path"); =20 @@ -615,17 +615,11 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, goto cleanup; } =20 - partsep =3D virXMLPropString(nodeset[i], "part_separator"); - if (partsep) { - dev.part_separator =3D virTristateBoolTypeFromString(partsep); - if (dev.part_separator <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid part_separator setting '%s'"), - partsep); - virStoragePoolSourceDeviceClear(&dev); - goto cleanup; - } + if (virXMLPropYesNo(nodeset[i], "part_separator", &partsep) < 0) { + virStoragePoolSourceDeviceClear(&dev); + goto cleanup; } + dev.part_separator =3D partsep; =20 if (VIR_APPEND_ELEMENT(source->devices, source->ndevice, dev) < 0)= { virStoragePoolSourceDeviceClear(&dev); --=20 2.26.2