From nobody Sat May 18 18:02:07 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=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 From nobody Sat May 18 18:02:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1606918565; cv=none; d=zohomail.com; s=zohoarc; b=ZO+9RcepEB8Pp68m0NlsG2iQpDdpDiEkStBN1s6LM1v/a54pBL13ZGhn8kg9Ne6jLpJTUMf2yjJVFNL1Tub7OrbeZ1Dv2j/tuj78UN6ZOUE35mbb6eSo7kHgqs/9mPHz/bN3MZt2bMOIR+1vxqKk9/kWZWDQ8GkvyJnvQACyOwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606918565; 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=U9Zst1m2uHx6J3FXNF9dz/zrcdp0Rze4DbZ5MIAwP+U=; b=ajwxxgxkK2duao2VxoD5gMn67bNpIFwyc0Q4xtMVAWTtwNiIo5YCjt/l/YeBJvhaM/GaIAZPLskUZZZJ07b8efJVIVTH0pSfHM1bn5dk8oEkwkdgImx2sgcbT7WfXQEYsithUeKMYBGhnengZs3wkeBYnL4A1a1N5WlqZBwEBTg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1606918565623791.6557652075385; Wed, 2 Dec 2020 06:16:05 -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-533-8D3ftTfyMveF0VjaVlpjlw-1; Wed, 02 Dec 2020 09:14:47 -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 4BD30835B5F; Wed, 2 Dec 2020 14:14: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 2980360C6B; Wed, 2 Dec 2020 14:14:41 +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 E53A750034; Wed, 2 Dec 2020 14:14:40 +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 0B2EDNCF019016 for ; Wed, 2 Dec 2020 09:13:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 452F660C6D; Wed, 2 Dec 2020 14:13:23 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 923AD60BFA for ; Wed, 2 Dec 2020 14:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606918564; 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=U9Zst1m2uHx6J3FXNF9dz/zrcdp0Rze4DbZ5MIAwP+U=; b=LhRCfXcpexEN90m/XdCfzj4HvqlvShV9zT9Bst4Lz00nmbBTAvOsasjQUd2E2ie9t6dksx r3xU2LJTcmS3sjfTn+O+leBhPrWH+rOp/hH3+9sgpqj+gAgiRaU+XhGLkyZVGKUpHN2FGC rQSp7+9vTrjyzMtvV7IFJh87Sx7Hq4Y= X-MC-Unique: 8D3ftTfyMveF0VjaVlpjlw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/5] virDomainCheckpointDefParse: Use 'unsigned int' for flags Date: Wed, 2 Dec 2020 15:13:11 +0100 Message-Id: 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.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" Fix the type for a variable holding flags to the usual 'unsigned int' and change the name to be more appropriate to it's use. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- src/conf/checkpoint_conf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 33b6699be7..8744ac83e1 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -157,12 +157,12 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt, def->parent.parent_name =3D virXPathString("string(./parent/name)"= , ctxt); if ((domainNode =3D virXPathNode("./domain", ctxt))) { - int domainflags =3D VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; + unsigned int domainParseFlags =3D VIR_DOMAIN_DEF_PARSE_INACTIV= E | + VIR_DOMAIN_DEF_PARSE_SKIP_VALI= DATE; def->parent.dom =3D virDomainDefParseNode(ctxt->node->doc, dom= ainNode, xmlopt, parseOpaque, - domainflags); + domainParseFlags); if (!def->parent.dom) return NULL; } else { --=20 2.28.0 From nobody Sat May 18 18:02:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1606918422; cv=none; d=zohomail.com; s=zohoarc; b=GPG3sUuwecV5W4QoqYD/TxrXDzR6+MIB08u+vAOiLjwUZF/a/oGwbzQKNtB0iujXUflDjkem5JYDM0UIpfQ0ULwLbJAaV6iRms0ssJztjEm6hN2LNYbf3rMZ41m1ZF3OdpkakxmNZ0bXqUqohWCEVmrT8lRRWbr6Aoyijv9ir1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606918422; 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=07KqhVpZY9MGJEEx/Lfm6InNNHf8AXPRr6A9sGi0r9k=; b=X/TfY5H7kRFzCA3UVIO65ib/F0Un0TIlM6n5B6lOxKrw2fYl2WzL0QRi3Rl9O3DveDATsUezs4noyrM3ZZvENZYhnFqEQUUO+APspLyEOKUQenvN/ZtoMJFjfAuIGdXrQs72IBK0iocwG7yuy/k4vnxd1PrhLSmSrIBli88E9q4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1606918422776918.5175784842795; Wed, 2 Dec 2020 06:13:42 -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-461-k-nkqkyHPzasHKXsTlsJuA-1; Wed, 02 Dec 2020 09:13:37 -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 EDF8818C43C2; Wed, 2 Dec 2020 14:13:30 +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 C95BA63BA7; Wed, 2 Dec 2020 14:13:30 +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 966544BB7B; Wed, 2 Dec 2020 14:13:30 +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 0B2EDOMF019031 for ; Wed, 2 Dec 2020 09:13:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 59B7B60C17; Wed, 2 Dec 2020 14:13:24 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAE4860BFA for ; Wed, 2 Dec 2020 14:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606918420; 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=07KqhVpZY9MGJEEx/Lfm6InNNHf8AXPRr6A9sGi0r9k=; b=dKgAQ5lDXzO4zpSGsyALXkoAVHrqQgN3G7mWe6i6VvXaN4VxPbgfEHUjK8aInhmCDKxJOv hSRylQZYx8OmvV0qcQ8nIsec52bcl6tUoxqE6ak51aQkK8AT23Lz6Yn/CegMEkyvxu/TFm E6YejaPSB8Ojxc173rvv/1aa0/W2aAA= X-MC-Unique: k-nkqkyHPzasHKXsTlsJuA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/5] virDomainCheckpointRedefineCommit: Don't check ABI of definition in checkpoint Date: Wed, 2 Dec 2020 15:13:12 +0100 Message-Id: <13be9066c158ad10df767b52032b82aaaf60c9ea.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" Checking the definition ABI when redefining checkpoints doesn't make much sense for the following reasons: * the domain definition in the checkpoint is mostly unused (a relic adopted from the snapshot code) * can be very easily overriden by deleting the checkpoint metadata before redefinition Rather than complicating the logic when we'll be taking into account that the domain definition may be missing, let's just remove the check. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- src/conf/checkpoint_conf.c | 7 +------ src/conf/checkpoint_conf.h | 3 +-- src/qemu/qemu_checkpoint.c | 7 +++---- src/test/test_driver.c | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 8744ac83e1..73fdb78e7a 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -545,8 +545,7 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm, virDomainMomentObjPtr virDomainCheckpointRedefineCommit(virDomainObjPtr vm, - virDomainCheckpointDefPtr *defptr, - virDomainXMLOptionPtr xmlopt) + virDomainCheckpointDefPtr *defptr) { virDomainCheckpointDefPtr def =3D *defptr; virDomainMomentObjPtr other =3D NULL; @@ -556,10 +555,6 @@ virDomainCheckpointRedefineCommit(virDomainObjPtr vm, other =3D virDomainCheckpointFindByName(vm->checkpoints, def->parent.n= ame); if (other) { otherdef =3D virDomainCheckpointObjGetDef(other); - if (!virDomainDefCheckABIStability(otherdef->parent.dom, - def->parent.dom, xmlopt)) - return NULL; - /* Drop and rebuild the parent relationship, but keep all * child relations by reusing chk. */ virDomainMomentDropParent(other); diff --git a/src/conf/checkpoint_conf.h b/src/conf/checkpoint_conf.h index 631f863151..4508f61b29 100644 --- a/src/conf/checkpoint_conf.h +++ b/src/conf/checkpoint_conf.h @@ -97,7 +97,6 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm, virDomainMomentObjPtr virDomainCheckpointRedefineCommit(virDomainObjPtr vm, - virDomainCheckpointDefPtr *defptr, - virDomainXMLOptionPtr xmlopt); + virDomainCheckpointDefPtr *defptr); VIR_ENUM_DECL(virDomainCheckpoint); diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index e8d18b2e02..1740cadabf 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -439,8 +439,7 @@ qemuCheckpointRedefineValidateBitmaps(virDomainObjPtr v= m, static virDomainMomentObjPtr -qemuCheckpointRedefine(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuCheckpointRedefine(virDomainObjPtr vm, virDomainCheckpointDefPtr *def, bool *update_current, bool validate_bitmaps) @@ -452,7 +451,7 @@ qemuCheckpointRedefine(virQEMUDriverPtr driver, qemuCheckpointRedefineValidateBitmaps(vm, *def) < 0) return NULL; - return virDomainCheckpointRedefineCommit(vm, def, driver->xmlopt); + return virDomainCheckpointRedefineCommit(vm, def); } @@ -605,7 +604,7 @@ qemuCheckpointCreateXML(virDomainPtr domain, return NULL; if (redefine) { - chk =3D qemuCheckpointRedefine(driver, vm, &def, &update_current, = validate_bitmaps); + chk =3D qemuCheckpointRedefine(vm, &def, &update_current, validate= _bitmaps); } else { chk =3D qemuCheckpointCreate(driver, vm, &def); } diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 136269de3d..29c4c86b1d 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -8991,7 +8991,7 @@ testDomainCheckpointCreateXML(virDomainPtr domain, if (virDomainCheckpointRedefinePrep(vm, def, &update_current) < 0) goto cleanup; - if (!(chk =3D virDomainCheckpointRedefineCommit(vm, &def, privconn= ->xmlopt))) + if (!(chk =3D virDomainCheckpointRedefineCommit(vm, &def))) goto cleanup; } else { if (!(def->parent.dom =3D virDomainDefCopy(vm->def, --=20 2.28.0 From nobody Sat May 18 18:02:07 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=1606918496; cv=none; d=zohomail.com; s=zohoarc; b=MAbszFhqaWsNH0FIgYaWq8J8p8ImGZiSjIi2oM/iogNl+dz0GVLOYUfmGYZAI6uKBBHtLp2nEws4+27hK3awstX/3pHID4NgJVHWLteArPcUA+jcaB8dHOx4OsOpxGCmepHX+cdf3fGkZmVGwGBKKlfN6y09njcU6F77ScOnY7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606918496; 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=1orLwkUnIvIws0wvlHyY3hwI07HXOicEvAb7GGPCCWk=; b=fGRFkg1JqHywjFruX37UBgHEfscstTpWNP3oFPeBAXfWQDkTAZjL6KckKx6UGD5VPWib3l1G3zIfoGOYuCUOBR6xLfnpyNBWI7eFnqvfYN/MT9Ol4JHr26LUrvSntBrL34iVIukQH37xFeDi8w896U6TRJiYnbtgG3dLb+t7FdM= 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 1606918496819539.9355503651849; Wed, 2 Dec 2020 06:14:56 -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-292-hUYWko6qOx2Hlol4DkP99A-1; Wed, 02 Dec 2020 09:14:51 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39A288145FF; Wed, 2 Dec 2020 14:14:44 +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 119AC27C2D; Wed, 2 Dec 2020 14:14: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 C324D1809CAD; Wed, 2 Dec 2020 14:14:43 +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 0B2EDP4H019039 for ; Wed, 2 Dec 2020 09:13:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id B79F360C17; Wed, 2 Dec 2020 14:13:25 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E7F260BFA for ; Wed, 2 Dec 2020 14:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606918494; 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=1orLwkUnIvIws0wvlHyY3hwI07HXOicEvAb7GGPCCWk=; b=E+dRwGgdpiswHfXB6QZ7XO5YL32meuweDYYMhPca99g8TGscieVYbkq9dTLym62ZfDGGcV IwkVGBj3CKHxPSmVMJ2OC/VlORzhyOUumwnOOZyOrqEnvgberUe8ZWdHAf/Q+CfHG9ai0Z mVW55E7uce/egbgJHb54FHl5EWtNBkY= X-MC-Unique: hUYWko6qOx2Hlol4DkP99A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/5] conf: checkpoint: Prepare internals for missing domain definition Date: Wed, 2 Dec 2020 15:13:13 +0100 Message-Id: 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.84 on 10.5.11.23 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" Coniditonalize code which assumes that the domain definition stored in the checkpoint is present. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- src/conf/checkpoint_conf.c | 31 +++++++++++++------------ tests/qemudomaincheckpointxml2xmltest.c | 5 ---- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 73fdb78e7a..2071494d52 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -475,10 +475,10 @@ virDomainCheckpointDefFormatInternal(virBufferPtr buf, virBufferAddLit(buf, "\n"); } - if (!(flags & VIR_DOMAIN_CHECKPOINT_FORMAT_NO_DOMAIN) && - virDomainDefFormatInternal(def->parent.dom, xmlopt, - buf, domainflags) < 0) - return -1; + if (def->parent.dom && !(flags & VIR_DOMAIN_CHECKPOINT_FORMAT_NO_DOMAI= N)) { + if (virDomainDefFormatInternal(def->parent.dom, xmlopt, buf, domai= nflags) < 0) + return -1; + } virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); @@ -510,23 +510,24 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm, virDomainCheckpointDefPtr def, bool *update_current) { - char uuidstr[VIR_UUID_STRING_BUFLEN]; virDomainMomentObjPtr parent =3D NULL; - virUUIDFormat(vm->def->uuid, uuidstr); - if (virDomainCheckpointCheckCycles(vm->checkpoints, def, vm->def->name= ) < 0) return -1; - if (!def->parent.dom || - memcmp(def->parent.dom->uuid, vm->def->uuid, VIR_UUID_BUFLEN)) { - virReportError(VIR_ERR_INVALID_ARG, - _("definition for checkpoint %s must use uuid %s"), - def->parent.name, uuidstr); - return -1; + if (def->parent.dom) { + if (memcmp(def->parent.dom->uuid, vm->def->uuid, VIR_UUID_BUFLEN))= { + char uuidstr[VIR_UUID_STRING_BUFLEN]; + virUUIDFormat(vm->def->uuid, uuidstr); + virReportError(VIR_ERR_INVALID_ARG, + _("definition for checkpoint %s must use uuid %= s"), + def->parent.name, uuidstr); + return -1; + } + + if (virDomainCheckpointAlignDisks(def) < 0) + return -1; } - if (virDomainCheckpointAlignDisks(def) < 0) - return -1; if (def->parent.parent_name && (parent =3D virDomainCheckpointFindByName(vm->checkpoints, diff --git a/tests/qemudomaincheckpointxml2xmltest.c b/tests/qemudomainchec= kpointxml2xmltest.c index a5a5b59205..8b4b75d753 100644 --- a/tests/qemudomaincheckpointxml2xmltest.c +++ b/tests/qemudomaincheckpointxml2xmltest.c @@ -87,11 +87,6 @@ testCompareXMLToXMLFiles(const char *inxml, formatflags |=3D VIR_DOMAIN_CHECKPOINT_FORMAT_SIZE; } - /* Parsing XML does not populate the domain definition; work - * around that by not requesting domain on output */ - if (!def->parent.dom) - formatflags |=3D VIR_DOMAIN_CHECKPOINT_FORMAT_NO_DOMAIN; - if (!(actual =3D virDomainCheckpointDefFormat(def, driver.xmlopt, formatflags))) --=20 2.28.0 From nobody Sat May 18 18:02:07 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=1606918484; cv=none; d=zohomail.com; s=zohoarc; b=QeqJlk3gsTnckzNgIs3r6rmF2e7KXQuyFyqs/JLLB/NY+LvNPjDm8H8sTgqyGP4ZSeH41M/MbVPLQOCBhgL+kTtmkIHFukPdvIDsHwHSMSmajB9KVsbsIRo/nwF8Tfa6SBZVnpehFFEA8kz+IJJvpy89eMdMDVqQPszYnkzIHLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606918484; 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=Ss45rUgTFVOUK6jnvOI1L5gJOTVaqk+QbQhue/GJFzo=; b=eQbLFJT+djAm/O145yLZ3veaKxRBs0iROVZQ3W56i7RlNa+02HCukzdyl8JiAs8qgxESNW50LkAG7FFduuWq+7a2ks1I1EUqICQco5nSILguWhRD/Q0IstkJDZPVFLl7JveySuwDAmt8Deyh2BRzjo+wdQt/x1fVydfYyDXxBF8= 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 1606918484562126.49621002609638; Wed, 2 Dec 2020 06:14: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-30-NrOpRzcUNKCOdsre4Mv_KA-1; Wed, 02 Dec 2020 09:14:39 -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 6D210100C666; Wed, 2 Dec 2020 14:14:28 +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 4B78D19CB0; Wed, 2 Dec 2020 14:14:28 +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 1559E1809CA6; Wed, 2 Dec 2020 14:14:28 +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 0B2EDQdA019060 for ; Wed, 2 Dec 2020 09:13:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id E4A9460C17; Wed, 2 Dec 2020 14:13:26 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D6CD60BFA for ; Wed, 2 Dec 2020 14:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606918482; 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=Ss45rUgTFVOUK6jnvOI1L5gJOTVaqk+QbQhue/GJFzo=; b=V4nYeJoKvKXVlo5qA5FT1mfpXMxuhVBTAstGqC2c+25tPtTn0Bky50DHue8MNFd83uax8c BDY6snm9VLyxAisxp9YjVHNw91xODe/TkzCw4/c/CU4ZAfZuPajUvSUI1PLIw5NOrK2+E6 HuKFuyqgrJpnyFdC4irXgIgrRVGxgU0= X-MC-Unique: NrOpRzcUNKCOdsre4Mv_KA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/5] conf: checkpoint: Don't require when redefining checkpoints Date: Wed, 2 Dec 2020 15:13:14 +0100 Message-Id: <43c6f88a8c2b53c313419fa3fd744f8504bdbe52.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" The domain definition stored with a checkpoint isn't used currently apart from matching disks when creating a new checkpoints. As some users of the incremental backup API want to provide backups in offline mode under their control (obviously while compying with our documentation on how the on-disk state should be handled) and then want to define the checkpoint for live use, supplying a sub-element is overly complex and not actually needed by the code. Relax the restriction when re-defining a checkpoint so that is not necessary and add (alibistic) documentation saying that future actions may not work if it's missing. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- docs/formatcheckpoint.rst | 12 +++++++++--- src/conf/checkpoint_conf.c | 4 ---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/formatcheckpoint.rst b/docs/formatcheckpoint.rst index f159f2a7a3..ff3f1e8c00 100644 --- a/docs/formatcheckpoint.rst +++ b/docs/formatcheckpoint.rst @@ -1,3 +1,5 @@ +.. role:: since + Checkpoint XML format =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -103,12 +105,16 @@ The top-level ``domaincheckpoint`` element may contai= n the following elements: A readonly representation of the inactive `domain configuration `__ at the time the checkpoint was cre= ated. This element may be omitted for output brevity by supplying the - ``VIR_DOMAIN_CHECKPOINT_XML_NO_DOMAIN`` flag, but the resulting XML is = no - longer viable for use with the ``VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE`= ` flag - of ``virDomainCheckpointCreateXML()``. The domain will have + ``VIR_DOMAIN_CHECKPOINT_XML_NO_DOMAIN`` flag. The domain will have security-sensitive information omitted unless the flag ``VIR_DOMAIN_CHECKPOINT_XML_SECURE`` is provided on a read-write connec= tion. + ``virDomainCheckpointCreateXML()`` requires that the ```` is pr= esent + when used with ``VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE``. + :since:`Since 7.0.0` the ```` element can be omitted when redef= ining + a checkpoint, but hypervisors may not support certain operations if it's + missing. + Examples -------- diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 2071494d52..2df5e41495 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -165,10 +165,6 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt, domainParseFlags); if (!def->parent.dom) return NULL; - } else { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing domain in checkpoint redefine")); - return NULL; } } else if (virDomainXMLOptionRunMomentPostParse(xmlopt, &def->parent) = < 0) { return NULL; --=20 2.28.0