From nobody Sun Feb 8 14:22:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1553681265995310.81620539847347; Wed, 27 Mar 2019 03:07:45 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id C78CD308CF84; Wed, 27 Mar 2019 10:07:44 +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 9FBB05DC1A; Wed, 27 Mar 2019 10:07: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 5826F41F3E; Wed, 27 Mar 2019 10:07:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2RA7c9k022335 for ; Wed, 27 Mar 2019 06:07:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9E0211001E6E; Wed, 27 Mar 2019 10:07:38 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-59.phx2.redhat.com [10.3.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C57D1001E67; Wed, 27 Mar 2019 10:07:38 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Wed, 27 Mar 2019 05:07:13 -0500 Message-Id: <20190327100734.10225-3-eblake@redhat.com> In-Reply-To: <20190327100734.10225-1-eblake@redhat.com> References: <20190327100734.10225-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: nsoffer@redhat.com Subject: [libvirt] [PATCH v7 02/23] snapshot: Allow NULL to virDomainSnapshotObjGetDef 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 27 Mar 2019 10:07:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Doing so can simplify some callers. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrang=C3=A9 --- src/conf/virdomainsnapshotobjlist.h | 2 +- src/conf/snapshot_conf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/virdomainsnapshotobjlist.h b/src/conf/virdomainsnapsh= otobjlist.h index b83f7a4ba9..12b574b4ff 100644 --- a/src/conf/virdomainsnapshotobjlist.h +++ b/src/conf/virdomainsnapshotobjlist.h @@ -87,7 +87,7 @@ int virDomainListSnapshots(virDomainSnapshotObjListPtr sn= apshots, static inline virDomainSnapshotDefPtr virDomainSnapshotObjGetDef(virDomainMomentObjPtr obj) { - return (virDomainSnapshotDefPtr) obj->def; + return obj ? (virDomainSnapshotDefPtr) obj->def : NULL; } #endif /* LIBVIRT_VIRDOMAINSNAPSHOTOBJLIST_H */ diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 4ce120451e..8e4f3d9410 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -967,7 +967,7 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, } other =3D virDomainSnapshotFindByName(vm->snapshots, def->common.name); - otherdef =3D other ? virDomainSnapshotObjGetDef(other) : NULL; + otherdef =3D virDomainSnapshotObjGetDef(other); check_if_stolen =3D other && otherdef->common.dom; if (virDomainSnapshotRedefineValidate(def, domain->uuid, other, xmlopt, flags) < 0) { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list