From nobody Sun Feb 8 20:17:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1666621033; cv=none; d=zohomail.com; s=zohoarc; b=P8RbwBjgEggx/W4ahIlp+0qNatzcsyzPOY0q94nNfyKU0X+5s4Zb9HmlL9BY4geLy0UuJoHxFedGUqyzD+OpK7uyi8feAVL3yPL1PxL0M5NS8jAHjBpDMTBUk/HH5VMwAlfZJNCq1amxi3UUDBNWcmyHt9gCBCGgmDego6EGg2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666621033; h=Content-Type:Content-Transfer-Encoding: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=DTtPWnDLzn4tfH0D6yuEN/jt2PFJrNJN8zseR7/pxdI=; b=Gjij4pL9xNOkDNofMEJOX68l7ZVURtarTrTDdCEmpXhI2rMjV1u6iiu7VOu/j0yVqYCYueWJPgaYOfaCbC7GzYqIC8Qw2qqqREXwfYhpo0dKGzBl+hixiA82IdzLCqMgdZXbE9WC9w6bv7FKUR5C/4d+BJM+p+4DXdylOzlCLyU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1666621033731590.1009148227593; Mon, 24 Oct 2022 07:17:13 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-83-u4EGVHU4NK6FX5JtGsuOiQ-1; Mon, 24 Oct 2022 10:16:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0FBE93C1486A; Mon, 24 Oct 2022 14:15:44 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF2AD202322E; Mon, 24 Oct 2022 14:15:43 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DA5DA19465B1; Mon, 24 Oct 2022 14:15:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6A0951946597 for ; Mon, 24 Oct 2022 14:15:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5B01640C2089; Mon, 24 Oct 2022 14:15:43 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-27.brq.redhat.com [10.40.208.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id C048640C2064 for ; Mon, 24 Oct 2022 14:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666621032; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DTtPWnDLzn4tfH0D6yuEN/jt2PFJrNJN8zseR7/pxdI=; b=HD541egebcuK3+ahRFw5Z5UWZMvbSSPCw64oMlRTwbi8xn28/Tlfb5a9pWiS4qLrm5uQTF wCP8iMuq8Py1LXYhaOW+MFbEC+LPRm1ID3i4n3PStr/chqjUy8insaX4y6JvVthDL5U275 lPY6SqoImKrpbN4I/xRECFBMWLATUrw= X-MC-Unique: u4EGVHU4NK6FX5JtGsuOiQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 32/43] virDomainTimerDef: Convert 'name' field to proper enum type Date: Mon, 24 Oct 2022 16:14:37 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666621034968100005 Content-Type: text/plain; charset="utf-8" Adjust the type and the corresponding parser to use virXMLPropEnum. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 13 ++----------- src/conf/domain_conf.h | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7c718ce799..aa949766e1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10546,24 +10546,15 @@ virDomainTimerDefParseXML(xmlNodePtr node, VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr catchup; int ret; - g_autofree char *name =3D NULL; g_autofree char *tickpolicy =3D NULL; g_autofree char *track =3D NULL; g_autofree char *mode =3D NULL; ctxt->node =3D node; - name =3D virXMLPropString(node, "name"); - if (name =3D=3D NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing timer name")); + if (virXMLPropEnum(node, "name", virDomainTimerNameTypeFromString, + VIR_XML_PROP_REQUIRED, &def->name) < 0) return NULL; - } - if ((def->name =3D virDomainTimerNameTypeFromString(name)) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown timer name '%s'"), name); - return NULL; - } if (virXMLPropTristateBool(node, "present", VIR_XML_PROP_NONE, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ba411bfa02..de6aefed2d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2472,7 +2472,7 @@ struct _virDomainTimerCatchupDef { }; struct _virDomainTimerDef { - int name; + virDomainTimerNameType name; virTristateBool present; int tickpolicy; /* enum virDomainTimerTickpolicyType */ --=20 2.37.3