From nobody Sun May 5 06:20:23 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=1614846949; cv=none; d=zohomail.com; s=zohoarc; b=kttaBx6AiTq77ubmWaLFVyf2IvvsNYaKa8rqgPvmCVRO6AGR1IHypjulzPpOrOpKAPcj9APpPSoNyTHPftrlNOpsdFCp6UDZUIPbFuRm3HD51Qnfy2KhbyS6HqO+xNjoBvOAkKVT6jIUGyiGEtV+AM3XF2GFwMwvZmBF2ieZqSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614846949; 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=tGeCv+h0jGE89bUEVZ90MgLBG7zVhjnVnYoFjN13g0A=; b=hrT6g+AgES08SdEI7VNg1QOz3BNPggpxNxzRvq75mTq6wyrnkzp/Khox8VuhO3dqwlruWh+hPkKN7FDLTp2SAV1YLk31BC1R6u+Gem0MaVHO9IWUPCsy8v2zdwKXdMEUggAj3jziXnBKIeSVzvJ//dJ7srVgaBpyEEuGeL+Mptw= 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 1614846949391894.98780024448; Thu, 4 Mar 2021 00:35:49 -0800 (PST) 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-368-yXsh5ePTPuWDY9pxzNkasg-1; Thu, 04 Mar 2021 03:35:46 -0500 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 05F3F1005D4A; Thu, 4 Mar 2021 08:35:41 +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 CE44B1378E; Thu, 4 Mar 2021 08:35: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 817B957DC3; Thu, 4 Mar 2021 08:35:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1248ZbKr001422 for ; Thu, 4 Mar 2021 03:35:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id AD7C4226E9; Thu, 4 Mar 2021 08:35:37 +0000 (UTC) Received: from work.redhat.com (ovpn-112-142.ams2.redhat.com [10.36.112.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8046614F5; Thu, 4 Mar 2021 08:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614846948; 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=tGeCv+h0jGE89bUEVZ90MgLBG7zVhjnVnYoFjN13g0A=; b=Sofqz8f5YjquGRWgXL01QNSQMR8d7jjRqtdjkg7UvJ5j3KcZ6IN0dqXexcTMmxyz1XlvuV RNdRYLbQ0LJDaACFaon2W7q0dUIp+0shOc/yp81va5vJdfW4NZautW9qng4+iD1YP4YKYO nvXSNe2G2SqvxU4TCNGMr2JIb7fgv3c= X-MC-Unique: yXsh5ePTPuWDY9pxzNkasg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] domain_conf: Reduce scope of tmp in virDomainFeaturesDefParse Date: Thu, 4 Mar 2021 09:35:27 +0100 Message-Id: <20210304083531.9690-2-twiederh@redhat.com> In-Reply-To: <20210304083531.9690-1-twiederh@redhat.com> References: <20210304083531.9690-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Variables using `g_autofree` should not be manually VIR_FREE'd and reused. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f194909b13..1d0ef17318 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18156,7 +18156,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes =3D NULL; - g_autofree char *tmp =3D NULL; xmlNodePtr node =3D NULL; int gic_version; size_t i; @@ -18166,6 +18165,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; =20 for (i =3D 0; i < n; i++) { + g_autofree char *tmp =3D NULL; int val =3D virDomainFeatureTypeFromString((const char *)nodes[i]-= >name); if (val < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -18184,7 +18184,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } def->apic_eoi =3D eoi; - VIR_FREE(tmp); } G_GNUC_FALLTHROUGH; case VIR_DOMAIN_FEATURE_ACPI: @@ -18206,7 +18205,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, tmp, virDomainFeatureTypeToString(val)); return -1; } - VIR_FREE(tmp); } else { def->features[val] =3D VIR_TRISTATE_SWITCH_ABSENT; } @@ -18225,7 +18223,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, tmp, virDomainFeatureTypeToString(val)); return -1; } - VIR_FREE(tmp); } else { def->features[val] =3D VIR_TRISTATE_SWITCH_ON; } @@ -18240,7 +18237,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } def->gic_version =3D gic_version; - VIR_FREE(tmp); } def->features[val] =3D VIR_TRISTATE_SWITCH_ON; break; @@ -18256,7 +18252,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } def->features[val] =3D value; - VIR_FREE(tmp); } break; =20 @@ -18271,7 +18266,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } def->hpt_resizing =3D (virDomainHPTResizing) value; - VIR_FREE(tmp); } =20 if (virParseScaledValue("./features/hpt/maxpagesize", @@ -18305,7 +18299,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } def->features[val] =3D value; - VIR_FREE(tmp); } break; =20 @@ -18320,7 +18313,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } def->features[val] =3D value; - VIR_FREE(tmp); } break; =20 @@ -18335,7 +18327,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } def->features[val] =3D value; - VIR_FREE(tmp); } break; =20 @@ -18354,7 +18345,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, tmp, virDomainFeatureTypeToString(val)); return -1; } - VIR_FREE(tmp); break; =20 /* coverity[dead_error_begin] */ @@ -18372,6 +18362,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, 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, @@ -18398,7 +18389,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - VIR_FREE(tmp); def->hyperv_features[feature] =3D value; =20 switch ((virDomainHyperv) feature) { @@ -18477,6 +18467,8 @@ virDomainFeaturesDefParse(virDomainDefPtr def, 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"), @@ -18498,7 +18490,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - VIR_FREE(tmp); def->hyperv_stimer_direct =3D value; } VIR_FREE(nodes); @@ -18511,6 +18502,8 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; =20 for (i =3D 0; i < n; i++) { + g_autofree char *tmp =3D NULL; + feature =3D virDomainKVMTypeFromString((const char *)nodes[i]-= >name); if (feature < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -18539,7 +18532,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - VIR_FREE(tmp); def->kvm_features[feature] =3D value; break; =20 @@ -18555,6 +18547,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, 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; @@ -18584,7 +18577,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, return -1; } =20 - VIR_FREE(tmp); def->xen_features[feature] =3D value; =20 switch ((virDomainXen) feature) { @@ -18638,6 +18630,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, } =20 if (def->features[VIR_DOMAIN_FEATURE_MSRS] =3D=3D VIR_TRISTATE_SWITCH_= ON) { + g_autofree char *tmp =3D NULL; if ((node =3D virXPathNode("./features/msrs", ctxt)) =3D=3D NULL) return -1; =20 @@ -18654,13 +18647,13 @@ virDomainFeaturesDefParse(virDomainDefPtr def, tmp); return -1; } - VIR_FREE(tmp); } =20 if ((n =3D virXPathNodeSet("./features/capabilities/*", ctxt, &nodes))= < 0) return -1; =20 for (i =3D 0; i < n; i++) { + g_autofree char *tmp =3D NULL; int val =3D virDomainProcessCapsFeatureTypeFromString((const char = *)nodes[i]->name); if (val < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -18675,7 +18668,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, tmp, virDomainProcessCapsFeatureTypeToStrin= g(val)); return -1; } - VIR_FREE(tmp); } else { def->caps_features[val] =3D VIR_TRISTATE_SWITCH_ON; } --=20 2.26.2 From nobody Sun May 5 06:20:23 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=1614846957; cv=none; d=zohomail.com; s=zohoarc; b=KV9t++/WU5MZCDARDunzmwFIsmH88XFMTGfpp0oKae18lx6Lv7o1LLBJoPQQkESfVtRbjEYC0L7fYg925tsmeYhlBkP9pu296yOg0kJieuVH+Vl3/NBgxrd6zVYz6MVxxHEKvlBrLF/9c3xAFzV95iI0YmLT1ZgUx+0hLOpUE3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614846957; 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=UirRiX+/AWiR9Waa9icN20JJVdYulVplF34W+0l2svE=; b=Sf3DmQXGNi98Tt66oOUWUacQPDRqhrOzvJ8EJbzDL4aAjx6/9ILpi/V8aExzC6Etnsy0ploGioGIc4Wk8+LdIiJaSfYreIHxI8oIAXdiZdN1AbuMXjbIqF0zwSu6KYpExN00UltalVXWCGGeKaz5L9lxExGG/BpGbdvA1xOaT0Q= 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 1614846957230872.6300227479403; Thu, 4 Mar 2021 00:35:57 -0800 (PST) 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-194-ZPZmySpgNnmK0J7syiT6jQ-1; Thu, 04 Mar 2021 03:35:53 -0500 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 311791084D6B; Thu, 4 Mar 2021 08:35:48 +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 0E7216F7E7; Thu, 4 Mar 2021 08:35:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C506D1809C8C; Thu, 4 Mar 2021 08:35:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1248Zcvv001428 for ; Thu, 4 Mar 2021 03:35:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id B7BB6226E9; Thu, 4 Mar 2021 08:35:38 +0000 (UTC) Received: from work.redhat.com (ovpn-112-142.ams2.redhat.com [10.36.112.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BA0B614F5; Thu, 4 Mar 2021 08:35:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614846956; 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=UirRiX+/AWiR9Waa9icN20JJVdYulVplF34W+0l2svE=; b=ggj1HnjJ9WUNt0AGh+ui/uSjgSZ1td0rFgtPdCnsS1wZTmbgu/9zmCZ+uiskfWd5td+JfK H3oqcc9i5hbn/lsnRNZ8lcX+6JMLskYrBg2Rw1i2UavgLttP1XfCNHB2GXIMjy/AVWQwnw /HTE9VlOOYlak+oNajSanf+R6WS98vE= X-MC-Unique: ZPZmySpgNnmK0J7syiT6jQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 2/5] domain_conf: Reduce scope of gic_version in virDomainFeaturesDefParse Date: Thu, 4 Mar 2021 09:35:28 +0100 Message-Id: <20210304083531.9690-3-twiederh@redhat.com> In-Reply-To: <20210304083531.9690-1-twiederh@redhat.com> References: <20210304083531.9690-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1d0ef17318..f73814f3c7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18157,7 +18157,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, { g_autofree xmlNodePtr *nodes =3D NULL; xmlNodePtr node =3D NULL; - int gic_version; size_t i; int n; =20 @@ -18230,7 +18229,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, =20 case VIR_DOMAIN_FEATURE_GIC: if ((tmp =3D virXMLPropString(nodes[i], "version"))) { - gic_version =3D virGICVersionTypeFromString(tmp); + int gic_version =3D virGICVersionTypeFromString(tmp); if (gic_version < 0 || gic_version =3D=3D VIR_GIC_VERSION_= NONE) { virReportError(VIR_ERR_XML_ERROR, _("malformed gic version: %s"), tmp); --=20 2.26.2 From nobody Sun May 5 06:20:23 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=1614846959; cv=none; d=zohomail.com; s=zohoarc; b=exsH/MSjZ6wxoGUicWYirRIcvhZuy1diQS7wSgD3lTwPUzXmmKPNCgRKf8038x5MvpfJWTrxjXpgRdTyJDi8vaJiz2/3/aZoT4xrH2d/0xom2ayIl99QQyXinOUwnoNM0v3ldEuwlPBLBnBOJmg3FogB3PmRRl3dXP1GDDJQizk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614846959; 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=lNkTHzRNImbdgNcEch7RxOmwSBrULDHLiGFctZjn+7o=; b=BobufkeQHDhk27gfy+DOkHFaLj1TESUDgRoeogEfSxipYvM0kYT5gxtQl+vYFKPmGCkGKUyUw9iI5UyE/7jjew9Z4x2pbA1yPuZhp9IC4GSfY49uwb7fpOCfGes1ZXX1XdZTVLlCU44mqvu3fo9mh1Tcs5mMiPyhlyO/027MOXg= 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 1614846959850188.71328119735324; Thu, 4 Mar 2021 00:35:59 -0800 (PST) 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-G2JWQtuPMU6NGJKTsBvORg-1; Thu, 04 Mar 2021 03:35:56 -0500 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 7C4631005D51; Thu, 4 Mar 2021 08:35: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 567C212BF3; Thu, 4 Mar 2021 08:35: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 17EA218077CC; Thu, 4 Mar 2021 08:35:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1248Zda1001439 for ; Thu, 4 Mar 2021 03:35:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id C587F226FB; Thu, 4 Mar 2021 08:35:39 +0000 (UTC) Received: from work.redhat.com (ovpn-112-142.ams2.redhat.com [10.36.112.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15910226E9; Thu, 4 Mar 2021 08:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614846958; 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=lNkTHzRNImbdgNcEch7RxOmwSBrULDHLiGFctZjn+7o=; b=cmkWbi2pFDLTN8B6uay1JjEGT+uI4Y4iYKSkwET4PWTTZRrqZ1Pa7OM3oA0YqmsVXQkMc5 R7yEyhRu7XwZcWL/JRWrntcKYTxnSoJzzyRsZ8YOXT/E47sO5qZanSS0GFATuE47vfxEyJ ExKISB+0rsUDGPAtos8I5k+WSB94ghc= X-MC-Unique: G2JWQtuPMU6NGJKTsBvORg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 3/5] domain_conf: Reduce scope of node in virDomainFeaturesDefParse Date: Thu, 4 Mar 2021 09:35:29 +0100 Message-Id: <20210304083531.9690-4-twiederh@redhat.com> In-Reply-To: <20210304083531.9690-1-twiederh@redhat.com> References: <20210304083531.9690-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f73814f3c7..4bc82b69fc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18156,7 +18156,6 @@ virDomainFeaturesDefParse(virDomainDefPtr def, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes =3D NULL; - xmlNodePtr node =3D NULL; size_t i; int n; =20 @@ -18356,7 +18355,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, if (def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D=3D VIR_TRISTATE_SWITC= H_ON) { int feature; int value; - node =3D ctxt->node; + xmlNodePtr node =3D ctxt->node; if ((n =3D virXPathNodeSet("./features/hyperv/*", ctxt, &nodes)) <= 0) return -1; =20 @@ -18630,6 +18629,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, =20 if (def->features[VIR_DOMAIN_FEATURE_MSRS] =3D=3D VIR_TRISTATE_SWITCH_= ON) { g_autofree char *tmp =3D NULL; + xmlNodePtr node =3D NULL; if ((node =3D virXPathNode("./features/msrs", ctxt)) =3D=3D NULL) return -1; =20 --=20 2.26.2 From nobody Sun May 5 06:20:23 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=1614846966; cv=none; d=zohomail.com; s=zohoarc; b=bd/uuVNqngOdkz0DI5lk8Z4URVFqHkm9WZZywYnWeihhUAvh24V76BXzmLycgiuk/6GPrve2MvxcEkWZBOXCviSekKpBIEXSHMtiz6dCokP6WSTgbI14vb07BuNo9Tz0RMpZmdBPA+mkTuGAUBs09+LmHPcf/R1AuhXjk8xZxWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614846966; 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=Vc29CjQbr5qnQjN5GAe9Rt8+2G5fE8S/BqpveBukfY0=; b=QcZmNQdkCaNfAOiAZ3PVtnA3MM4+nx6ZfikAi9MTX0W/IGK7f3oSvLD99bkfRd5s0dYnPckkgeVrO0xuBfxMZVAuGnw6QWyy/a9Hi1AwnpOmRZEO7D9ZvkY3rgAfJW+mtaVvwGgvOAo9wnrxQ0vnP9Tagi5rY5zP6R+DRv0HxdI= 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 1614846966442454.7295730893936; Thu, 4 Mar 2021 00:36:06 -0800 (PST) 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-450-N5jCfqIYPECtZnkX0BRHiQ-1; Thu, 04 Mar 2021 03:35:59 -0500 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 82473814302; Thu, 4 Mar 2021 08:35:54 +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 5A7B82B0BA; Thu, 4 Mar 2021 08:35:54 +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 1E10457DC3; Thu, 4 Mar 2021 08:35:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1248ZeFZ001449 for ; Thu, 4 Mar 2021 03:35:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id D0ABA614FB; Thu, 4 Mar 2021 08:35:40 +0000 (UTC) Received: from work.redhat.com (ovpn-112-142.ams2.redhat.com [10.36.112.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23524614F5; Thu, 4 Mar 2021 08:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614846965; 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=Vc29CjQbr5qnQjN5GAe9Rt8+2G5fE8S/BqpveBukfY0=; b=DnwoH5cruXBHKhul7Hs8ufhNcTPoaE9j//wtUYfJSmZue9vLbJGmHZ74KxcfYDb4RqYtlW 8SLdqh43Auk3nN9xlRgNSjL0mXWkKzUixlDPRBdeV/5mLoHQzyF0QqlVJhPRE5MlBKSQLP hHhj1hPPNL9pcFl5o/OILz0pxQOsO8Q= X-MC-Unique: N5jCfqIYPECtZnkX0BRHiQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 4/5] domain_conf: Add missing break in switch Date: Thu, 4 Mar 2021 09:35:30 +0100 Message-Id: <20210304083531.9690-5-twiederh@redhat.com> In-Reply-To: <20210304083531.9690-1-twiederh@redhat.com> References: <20210304083531.9690-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4bc82b69fc..48fd078b90 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18449,6 +18449,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, _("HyperV vendor_id value is invalid")); return -1; } + break; =20 /* coverity[dead_error_begin] */ case VIR_DOMAIN_HYPERV_LAST: --=20 2.26.2 From nobody Sun May 5 06:20:23 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=1614847024; cv=none; d=zohomail.com; s=zohoarc; b=jr0PX9F4T51BB7wghZbwxkNcMTIlwv5OdaNnF+U+MM+jDcp7/48v4CDVH7UKG2+Kzfh5sHmKXGieUmnCmBj7liXM3PsnUAJvyTvujmuC/Lwk5n13O2VB6rlHJUZ6MPo5hDe0Sh9zuF0crlDI8HR1semfKPIp9jhVmnMX8bGBG1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614847024; 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=5l2KdOWtXawoSQDodbHT5HjWxxKQQngctBsWjY1bbSE=; b=H8NpJq5l38Wtu7Pf5ni7E4RgUFU1xeE2+YABgBLR6lSv238ZhxcNTXMByi82w2o6bH68q6dFUgAVYtB+HxGqo48lQqqCw3MQ3Srwn3lBUgZofIJvHytJFAleCAUPDmmB/spzLa3k466mFvmERM1uC3hf087MZMt8i/tNk7nTCyY= 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 1614847024058280.59808701240365; Thu, 4 Mar 2021 00:37:04 -0800 (PST) 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-201-9--HBvrKPXejJiozdEgchA-1; Thu, 04 Mar 2021 03:35:53 -0500 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 6386B1005D4A; Thu, 4 Mar 2021 08:35:47 +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 3D3CF5D720; Thu, 4 Mar 2021 08:35: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 F2BE457DC5; Thu, 4 Mar 2021 08:35:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1248Zf3n001459 for ; Thu, 4 Mar 2021 03:35:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id DC483226E9; Thu, 4 Mar 2021 08:35:41 +0000 (UTC) Received: from work.redhat.com (ovpn-112-142.ams2.redhat.com [10.36.112.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E48D614F5; Thu, 4 Mar 2021 08:35:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614847022; 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=5l2KdOWtXawoSQDodbHT5HjWxxKQQngctBsWjY1bbSE=; b=QtoWpyeZaEZtuuvbqAB94uNmKkIXvFoS461/kWKuxUik1jo63+/5BeMzEWGbeV05ibIlEZ 78BEnBl2kCf2u/dHOQAz9ZfTKREUWEv/VwugvaD4gfzFsycEZO5QsR9xVqS7eVZfUQRn+h fA5CPUZ8uJi1mPrmr9AhHGPuD03FEXc= X-MC-Unique: 9--HBvrKPXejJiozdEgchA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] domain_conf: Fix check for hyperv stimer Date: Thu, 4 Mar 2021 09:35:31 +0100 Message-Id: <20210304083531.9690-6-twiederh@redhat.com> In-Reply-To: <20210304083531.9690-1-twiederh@redhat.com> References: <20210304083531.9690-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.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" VIR_DOMAIN_HYPERV_STIMER happens to have the same numerical value as VIR_DOMAIN_FEATURE_HYPERV, resulting in the if-block to always being executed when a "" tag is found, whether or not it actually contained a "" tag. This had no ill effects, as virXPathNodeSet() would simply return 0 if that tag does not exist. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 48fd078b90..05b6cb3000 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18460,7 +18460,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def, ctxt->node =3D node; } =20 - if (def->features[VIR_DOMAIN_HYPERV_STIMER] =3D=3D VIR_TRISTATE_SWITCH= _ON) { + if (def->hyperv_features[VIR_DOMAIN_HYPERV_STIMER] =3D=3D VIR_TRISTATE= _SWITCH_ON) { int value; if ((n =3D virXPathNodeSet("./features/hyperv/stimer/*", ctxt, &no= des)) < 0) return -1; --=20 2.26.2