From nobody Sat Feb 7 05:14:42 2026 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=1606918489; cv=none; d=zohomail.com; s=zohoarc; b=CZYJkmkRuvJf8r/bQ0jvzSuhVv1cUUA+4W0PW/5WLvhfcE3nDGntJ7obRQcCnYp0JzGAQknuAmgXSdkNsXRS+TOwNOlDKy7LGXKWrgCDQ/wYAgubuqfUVeJ4GBAIL4a0zLvmq2ZJ4j1MMqsqRjr/tS43OyYrAIjCdQmSqIrxZ0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606918489; 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=jj0cw+RgQ/3oQIbf4sWETut+3nrUgw0MTNQrcZuocdQ=; b=Axk6zFGafeYl2xhkMzCSfFI9g1bLhxgiZggALBqilhpzzZFJoAZRKyWdulltaupLoQJjT3p5irIIlVEfODumeuKUgoUOLdjP2/+fqWgH6AUM55jwD+GPchCyzpJ9j0kHQBAM+9Q0icX3MG0XxRRhDm4CWc5O//K5pjOFJFrov+o= 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 1606918489887619.9703996208566; Wed, 2 Dec 2020 06:14: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-578-iTAQxpaBMRqWuZ4pRaZuig-1; Wed, 02 Dec 2020 09:14:45 -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 70BEC1012E86; Wed, 2 Dec 2020 14:14:38 +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 4C52119CBE; Wed, 2 Dec 2020 14:14:38 +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 166D850051; Wed, 2 Dec 2020 14:14:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B2EDM6S019003 for ; Wed, 2 Dec 2020 09:13:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2027760C6D; Wed, 2 Dec 2020 14:13:22 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EC4060BFA for ; Wed, 2 Dec 2020 14:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606918487; 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=jj0cw+RgQ/3oQIbf4sWETut+3nrUgw0MTNQrcZuocdQ=; b=Xo7uPYUbRgL9FzDVSWkBzNbuwJoKdBJRFqO4v8DNaggFbPUjGcqrIFCv1KvBeqA28pMUDh HwgsnMmGJsZQSVXf3hz5Hs7u35gWnACQw61VtyXI9Zrwky/3mt8Qtte5sz91Sn8yM4ho2c vFtEl/y704dhuALhaAh7IBJatP7edYc= X-MC-Unique: iTAQxpaBMRqWuZ4pRaZuig-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/5] virDomainCheckpointDefParse: Don't extract unused domain type Date: Wed, 2 Dec 2020 15:13:10 +0100 Message-Id: <54c370f5e94110efb366d82be51b3f7b0815358e.1606918292.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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" We can extract './domain' directly and let the parser deal with the type. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- src/conf/checkpoint_conf.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index a8d18928de..33b6699be7 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -126,7 +126,6 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt, virDomainCheckpointDefPtr ret =3D NULL; size_t i; int n; - char *tmp; g_autofree xmlNodePtr *nodes =3D NULL; g_autoptr(virDomainCheckpointDef) def =3D NULL; @@ -146,6 +145,8 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt, def->parent.description =3D virXPathString("string(./description)", ct= xt); if (flags & VIR_DOMAIN_CHECKPOINT_PARSE_REDEFINE) { + xmlNodePtr domainNode; + if (virXPathLongLong("string(./creationTime)", ctxt, &def->parent.creationTime) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -155,17 +156,10 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt, def->parent.parent_name =3D virXPathString("string(./parent/name)"= , ctxt); - if ((tmp =3D virXPathString("string(./domain/@type)", ctxt))) { + if ((domainNode =3D virXPathNode("./domain", ctxt))) { int domainflags =3D VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; - xmlNodePtr domainNode =3D virXPathNode("./domain", ctxt); - VIR_FREE(tmp); - if (!domainNode) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing domain in checkpoint")); - return NULL; - } def->parent.dom =3D virDomainDefParseNode(ctxt->node->doc, dom= ainNode, xmlopt, parseOpaque, domainflags); --=20 2.28.0