From nobody Sun May 5 03:23:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1576614633; cv=none; d=zohomail.com; s=zohoarc; b=fkzHgRofsXIq5gXVH4BeIChNzrXepv7/c/6GF1OAv57Tl7mBQRZi+NHJRtgDlSq3wIg8npWKQLFYcKr4lj7pw1MPLDBoSEInuN7oVb9nc/B+dxcsZPXswXK8tttXP0FDgUNSevPv7HzE4dEmDtaOU9GJe8xbNuMRlMXtOnSOEGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576614633; 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=nuHzmCPKfOJuo0T/kn6skyjdq+grqyAhUpkF6vareQg=; b=J7nW6R8y8HyrkJaGz35hHi3bFkQ90ZW0bDaWqBlXqcLLRCRD7inItPxLP2fmhJqPlTSFnYjImxjeh6QH+ig4u62OAwDfzpJ94jT5i7ia427u0smzfxFYlLoRrXdS8dnubQw6TuM9ZH1GJPUpX6Nr1pVogB4ETJEGSnXcnBnUpT8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576614633652687.4689802413408; Tue, 17 Dec 2019 12:30:33 -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-113-b8WvmFfZNG6quB8UKKo_GA-1; Tue, 17 Dec 2019 15:30:30 -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 D0CBE101F4E4; Tue, 17 Dec 2019 20:30:24 +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 A4E9A620BF; Tue, 17 Dec 2019 20:30:24 +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 3D5E118089C8; Tue, 17 Dec 2019 20:30:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBHKUMnk005809 for ; Tue, 17 Dec 2019 15:30:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 06D045D9E2; Tue, 17 Dec 2019 20:30:22 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.com (ovpn-116-68.phx2.redhat.com [10.3.116.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9F115D9E1 for ; Tue, 17 Dec 2019 20:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576614632; 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=nuHzmCPKfOJuo0T/kn6skyjdq+grqyAhUpkF6vareQg=; b=E5KqJwM02o6Avtd8iRRy5Rgj0FsxyNSgtZY0pVTcdhNOV/VYNp6us3aBNfKVRU71PPhu/O DwIXRdSYYeB3Dq2BJ2RiTCeMavg9p+pxg4Wqnt60+syK/ofiDVCnQlPG1AD0cCGZLzGlYJ MLtLy2WvpvBaYRJFpeeIrlVpSzttS/4= From: John Ferlan To: libvir-list@redhat.com Date: Tue, 17 Dec 2019 15:30:02 -0500 Message-Id: <20191217203004.1279575-2-jferlan@redhat.com> In-Reply-To: <20191217203004.1279575-1-jferlan@redhat.com> References: <20191217203004.1279575-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] conf: Fix ATTRIBUTE_NONNULL usages 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 X-MC-Unique: b8WvmFfZNG6quB8UKKo_GA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Recent changes removed the virCapsPtr, but didn't adjust/remove the corresponding ATTRIBUTE_NONNULL resulting in a build failure to build in my Coverity environment. Signed-off-by: John Ferlan Reviewed-by: Michal Privoznik --- src/conf/domain_conf.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 11fafe46b3..e012975fca 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3089,27 +3089,24 @@ unsigned int virDomainDefFormatConvertXMLFlags(unsi= gned int flags); char *virDomainDefFormat(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_NONNULL(3); + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); char *virDomainObjFormat(virDomainObjPtr obj, virDomainXMLOptionPtr xmlopt, unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_NONNULL(3); + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int virDomainDefFormatInternal(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, virBufferPtr buf, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); + ATTRIBUTE_NONNULL(3); int virDomainDefFormatInternalSetRootName(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, virBufferPtr buf, const char *rootname, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) - ATTRIBUTE_NONNULL(5); + ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); =20 int virDomainDiskSourceFormat(virBufferPtr buf, virStorageSourcePtr src, @@ -3286,14 +3283,14 @@ int virDomainDefSave(virDomainDefPtr def, const char *configDir) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); + ATTRIBUTE_NONNULL(3); =20 int virDomainObjSave(virDomainObjPtr obj, virDomainXMLOptionPtr xmlopt, const char *statusDir) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); + ATTRIBUTE_NONNULL(3); =20 typedef void (*virDomainLoadConfigNotify)(virDomainObjPtr dom, int newDomain, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 03:23:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1576614634; cv=none; d=zohomail.com; s=zohoarc; b=DP2GBkGAd2lWukzpAipsvAxuNxisVLsR8TbHygFQENVBni9ml5xoMgNNuOTHNj+AS+0so4a3Eg9gG2yziUrn+JzlGWB3uZqqjvFdLXW7w/+ehg9CdwAtsFLvwAm+7jdf1mgcV0gm3Pu96VwDAaFo2RNt9tUqDcyoOzC3hiFKtFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576614634; 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=JjUxy+/4DMfUQfz9Safm+mKVuAjVe+59XuuulgqiVWk=; b=i0wtVGJ8/WPwHhy8iDCSW+Zk6g7RPpX1rB2CZyWuUNAli6zQq87fvdrPlOAXpCCvv9LfOtLttHdUGIg7BtHnfENYgcn92iYheC+D7gK2ZGRokPJpPJk11Qlxnwxn6TgzQkIfj48/Qbg2RhMbvihhF+1QFf+ZKwF0W1qPZoCCj9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1576614634677893.4293737821479; Tue, 17 Dec 2019 12:30:34 -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-48-2OuC-_n2OFq9EFxNiqJENw-1; Tue, 17 Dec 2019 15:30:31 -0500 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 D118764A87; Tue, 17 Dec 2019 20:30:25 +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 C225F100032E; Tue, 17 Dec 2019 20:30:24 +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 B5760104905; Tue, 17 Dec 2019 20:30:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBHKUMKp005814 for ; Tue, 17 Dec 2019 15:30:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 708795D9E2; Tue, 17 Dec 2019 20:30:22 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.com (ovpn-116-68.phx2.redhat.com [10.3.116.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F45A5D9E1 for ; Tue, 17 Dec 2019 20:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576614633; 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=JjUxy+/4DMfUQfz9Safm+mKVuAjVe+59XuuulgqiVWk=; b=WOGswSQz4Ve50HJbZkPddAy4bvWe/e8S76mkteoFEgDe91hQFTqjvQt3xV2mhPKMzYAPPR eO1Y42wp+lRDKLtZbPrmTJYq/7wFYtvUB6V5DEsenxbq4N0L0Iis8CtGiC1NEGlb/w2Maw EFnW4yCufBd5le2tq7UKpF0fGKu0gcI= From: John Ferlan To: libvir-list@redhat.com Date: Tue, 17 Dec 2019 15:30:03 -0500 Message-Id: <20191217203004.1279575-3-jferlan@redhat.com> In-Reply-To: <20191217203004.1279575-1-jferlan@redhat.com> References: <20191217203004.1279575-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] vbox: Reset @ret after xmlFreeNode 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 X-MC-Unique: 2OuC-_n2OFq9EFxNiqJENw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In the error path, if we xmlFreeNode @ret, then the return ret; a few lines later returns something that's already been free'd and could be reused, so let's reinit it. Found by Coverity Signed-off-by: John Ferlan Reviewed-by: Michal Privoznik --- src/vbox/vbox_snapshot_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 5a0abd6d0e..db6c389a64 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src/vbox/vbox_snapshot_conf.c @@ -352,6 +352,7 @@ virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotCo= nfHardDiskPtr hardDisk) if (result < 0) { xmlUnlinkNode(ret); xmlFreeNode(ret); + ret =3D NULL; } VIR_FREE(uuid); return ret; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 03:23:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1576614644; cv=none; d=zohomail.com; s=zohoarc; b=ERjqdy0NkNJz6HIamEZVcMxWF6ocBNw7G85sPewM/nN00Y4Bm4q4Kdon9pZUI4kB061O/6sZKnFVoiQBJ4wpuRnwhikLtgsjgQ3flFLbclVVRdxMTORDX9NZiIcFuhotfL3BHfkNeMERRUUDN7+yrXV4fWHuUChQPJ0Ao2B+6pw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576614644; 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=q20PUYtT8l2zcXIxLRkHwAbEgjWG/YdbUe04I14HS0o=; b=jY/VhuoVHT49clBXVy0C4wdELNSQXb4ILT3wr0+OKPKspq/G65r/OI+W0vxHtZ0stRLsHwVGX/KSlpRb0+XeODIz2nw78p+1GyxuDg+hnzEQCuBoXS3YhaSqayVRmqfW9PwWKMGRozTK4ParEantvcGIIYOXPzN75gvnbKslA3A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1576614644579214.49819221091707; Tue, 17 Dec 2019 12:30:44 -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-7-KF8hqvlwOWC0hIat7HZlIA-1; Tue, 17 Dec 2019 15:30:40 -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 112B7800D5F; Tue, 17 Dec 2019 20:30:35 +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 E15427D8E0; Tue, 17 Dec 2019 20:30:34 +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 9415E18089CF; Tue, 17 Dec 2019 20:30:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBHKUMEN005819 for ; Tue, 17 Dec 2019 15:30:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id D90445D9E2; Tue, 17 Dec 2019 20:30:22 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.com (ovpn-116-68.phx2.redhat.com [10.3.116.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98AD35D9E1 for ; Tue, 17 Dec 2019 20:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576614643; 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=q20PUYtT8l2zcXIxLRkHwAbEgjWG/YdbUe04I14HS0o=; b=IT+o2trWzEoKvoslA2m9usQLJlU0wA+lr9dIq9TwUslzqY9tumzykV18upZ8K0KQjViuwk 9Yd0UHTISUSOk9qmmmhL0EdlmCTWck/+E5L/r6TmdsIIH1NGKMBsb10gysEbeh6g9pzlVY 5/z1E3BBq/d+Jpq3R8EXVvXMgCgl7qY= From: John Ferlan To: libvir-list@redhat.com Date: Tue, 17 Dec 2019 15:30:04 -0500 Message-Id: <20191217203004.1279575-4-jferlan@redhat.com> In-Reply-To: <20191217203004.1279575-1-jferlan@redhat.com> References: <20191217203004.1279575-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] virsh: Adjust logic checks in virshUpdateDiskXML 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 X-MC-Unique: KF8hqvlwOWC0hIat7HZlIA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Make it clearer that what we're trying to do is find @source and @target_node so that the unattentive or code analysis utility doesn't believe 'source' and 'target' could be found in the same node element. Signed-off-by: John Ferlan Reviewed-by: Michal Privoznik --- tools/virsh-domain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 56137bdd74..9d4cdd26dd 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -12476,10 +12476,9 @@ virshUpdateDiskXML(xmlNodePtr disk_node, if (tmp->type !=3D XML_ELEMENT_NODE) continue; =20 - if (virXMLNodeNameEqual(tmp, "source")) + if (!source && virXMLNodeNameEqual(tmp, "source")) source =3D tmp; - - if (virXMLNodeNameEqual(tmp, "target")) + else if (!target_node && virXMLNodeNameEqual(tmp, "target")) target_node =3D tmp; =20 /* --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list