From nobody Fri May 3 15:28:30 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=1604495124; cv=none; d=zohomail.com; s=zohoarc; b=m2e02fYoW1Zb0groyxBWtpLlwjCySYNs+H5jxmaJeGWH6zu4Rs0eYTJa7Wdk3YbQqDZ9jp9j8W2YffSXSmy726m257CfMiS3LJK1ra80lwObbAKuGdAUW/NMUfhhtzTThNh4ZvdUikAeJWvVdqtar7ifTCXn1TQoaI8nse8Efww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495124; 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=Q8Aj1TDAHolnzz5bXTneGz5spfhRGIcEajZtWCXsirA=; b=ROEZXKXtlMpUK3iW6Cu61xCr11pgMlqbBiNfGWxRRkBZenJUhqzeT8uf3PbY+vsqgLVwDOBGf+aRwS4su3+1hSPTTnjrM0vO0DRCWefGW2nKfKQTpIushSuTaLpmJcFB/6cr/k9BNbXUAbN8taPM40hB0ZdVqPcF85nJgsG54wY= 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 1604495124749688.4210143448836; Wed, 4 Nov 2020 05:05:24 -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-140-wOpgRuCmMgS7pJ5wXHWdGw-1; Wed, 04 Nov 2020 08:05:18 -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 E6479100F963; Wed, 4 Nov 2020 13:05:12 +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 BE19E10589B0; Wed, 4 Nov 2020 13:05:12 +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 869908C7B0; Wed, 4 Nov 2020 13:05:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5AP6002896 for ; Wed, 4 Nov 2020 08:05:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id B8AB01C6; Wed, 4 Nov 2020 13:05:10 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0551E5C640 for ; Wed, 4 Nov 2020 13:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495121; 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=Q8Aj1TDAHolnzz5bXTneGz5spfhRGIcEajZtWCXsirA=; b=JkDNukDZGrQyzwakBe1XV9fzXtaOvVpwQWfvz4hGxdc5+WELn7xqITJDYWy3wgInP5rNqB LPMilPqOHqWHmGsJh4R0VFm6Q6ImGRqtzqASHvlQIay48gg5beA1xbmYwHPb3JR9w2TIlv k6aSDUakjraB2ufIj8pzTXwBixDpjFY= X-MC-Unique: wOpgRuCmMgS7pJ5wXHWdGw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/9] checkpoint: Mention that VIR_DOMAIN_CHECKPOINT_XML_SIZE may require running vm Date: Wed, 4 Nov 2020 14:04:59 +0100 Message-Id: <0a3e2f14c7aec64053f78098430cbb8070559b08.1604495066.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.22 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 qemu implementation requires that the VM associated with the checkpoint is running when checking the size. Mention this possibility with the flag. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/libvirt-domain-checkpoint.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libvirt-domain-checkpoint.c b/src/libvirt-domain-checkpoin= t.c index 8a7b55dcd2..e9af8e4cf0 100644 --- a/src/libvirt-domain-checkpoint.c +++ b/src/libvirt-domain-checkpoint.c @@ -192,7 +192,9 @@ virDomainCheckpointCreateXML(virDomainPtr domain, * attribute that shows an estimate of the current size in bytes that * have been dirtied between the time the checkpoint was created and the * current point in time. Note that updating the size may be expensive and - * data will be inaccurate once guest OS writes to the disk. + * data will be inaccurate once guest OS writes to the disk. Also note that + * hypervisors may require that the domain associated with @checkpoint is + * running when VIR_DOMAIN_CHECKPOINT_XML_SIZE is used. * * Returns a 0 terminated UTF-8 encoded XML instance or NULL in case * of error. The caller must free() the returned value. --=20 2.26.2 From nobody Fri May 3 15:28:30 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=1604495128; cv=none; d=zohomail.com; s=zohoarc; b=W60k0etbSkNotCdn0+OtlnY+maVVYsazyHXIRXyZjuZTrvEJCy4DVX0d0YQIz7WK0qHiVGXDUP88cxPEziRcfcMIoyid/rnqMcspL3rJOEqScon+sFepCXkJChv3hvNvNbAYSt51XnF75PjBBHN8wknWSCKMttPXUADY9YRLUeY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495128; 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=1KIdY+lvHi5TydvEmtIOUksAIPtjRW/FbEv7JIdMhv0=; b=S2tv6T3gjz/uGJaH5qaeDVXnHwtcL2+DQmMdCJlIEfBKbDCGeK2CQ3YBHa2ykeKRJj2icRPijdHo541xlzXaQ156lx9MjY8RvjDjIlEUiaSygSoohzH1/y5qwTrKkHfRFCQw4+CoPaDNsoBr2zXyi/LH7K8gRRzuTsQj9SLwSwo= 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 1604495128264337.60752730554657; Wed, 4 Nov 2020 05:05:28 -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-297-OG2dqX17PjGmf55lxi4-IA-1; Wed, 04 Nov 2020 08:05:22 -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 4EDB95720F; Wed, 4 Nov 2020 13:05:16 +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 E88BF2C31E; Wed, 4 Nov 2020 13:05:15 +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 AAC9E18005A2; Wed, 4 Nov 2020 13:05:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5Bbw002907 for ; Wed, 4 Nov 2020 08:05:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id D31041C6; Wed, 4 Nov 2020 13:05:11 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39B725C641 for ; Wed, 4 Nov 2020 13:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495124; 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=1KIdY+lvHi5TydvEmtIOUksAIPtjRW/FbEv7JIdMhv0=; b=bEpFhTxaYo9WGhkWEhJ5rrmsNGAubhKf68offZbYQsrXdRtxz0EJGHd1FBBf01+aCbAvJ1 tamot1XWi8iBoBJzngLhfGU7fr+BBSss7zA1C8lC1N8qek8pe0tV8ilbhrFwMbRIIIC6HN nWlZiOBce12B55ixkc18lnr0FMwdivU= X-MC-Unique: OG2dqX17PjGmf55lxi4-IA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/9] man: virsh: Mention that '--size' for 'checkpoint-dumpxml' may require running vm Date: Wed, 4 Nov 2020 14:05:00 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.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" Separate the docs for the '--size' flag into it's own paragraph and add a mention that the domain may be required to be running. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/manpages/virsh.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index d34a1c8684..40b7dce093 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -7307,11 +7307,15 @@ checkpoint-dumpxml Output the checkpoint XML for the domain's checkpoint named *checkpoint*. Using *--security-info* will also include security sensitive information. + Using *--size* will add XML indicating the current size in bytes of guest data that has changed since the checkpoint was created (although remember that guest activity between a size check and actually creating a backup can result in the backup needing slightly more -space). Using *--no-domain* will omit the element from the +space). Note that some hypervisors may require that *domain* is running wh= en +*--size* is used. + +Using *--no-domain* will omit the element from the output for a more compact view. --=20 2.26.2 From nobody Fri May 3 15:28:30 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=1604495129; cv=none; d=zohomail.com; s=zohoarc; b=FjqcC8TTbZFvP9b6O17s2boW5ovFuN45Q2V0bxR+D0NXtTneAju0eLtF3gFDpra1rrJF+qMinzNiHbgX1q444F+xobPpPRgdjt8JpE7QqYHXjDb3ZieJhrOZKFc8f9m5xtZAs/WtBuRg9uixut/XZghj7ge2my+gf0mgNqyzJIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495129; 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=9tJnBljPK7/kvy9TQUseCENELBagX0fz+qqTjXornBg=; b=FCNVXo8oPHrhikOcB1GIGGdDY3nskwYd8/QZ8KGeq1OsvIMo2JaD8idFpP3mnQJpRwMgginsxqObhojDKuLnw9NBWk9QGHPotZ6RUagkSbYUW92MIml96g1XY+24xtOR4g6HhkwnbftmzrpMvfLEaMtbcAeWBtq7z+bL7WGW61g= 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 1604495129454641.3703961914966; Wed, 4 Nov 2020 05:05:29 -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-346-iGEEzug2Nom0pCSiXnwaPA-1; Wed, 04 Nov 2020 08:05:22 -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 3019E100F786; Wed, 4 Nov 2020 13:05:15 +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 03AC6757DF; Wed, 4 Nov 2020 13:05:14 +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 AC30D8C7C5; Wed, 4 Nov 2020 13:05:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5Dbj002923 for ; Wed, 4 Nov 2020 08:05:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 187FB1C6; Wed, 4 Nov 2020 13:05:13 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53F565C1D0 for ; Wed, 4 Nov 2020 13:05:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495125; 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=9tJnBljPK7/kvy9TQUseCENELBagX0fz+qqTjXornBg=; b=ffSMJbl4ABQcm2Eg/+nemDEaQq0VCXTHhdCpFKWo7m3lTI1r/5NUbhLqFgaLH8bE66EucL s4IYaDomDPGVrZ8EaHMQEnMBHUGJ4Znrv6uekclNrMuMJgItTNcRz7pLLgRuQBHTEPDJFQ 35duFfIkyPmulhxw3XozEkKoxL0SFv4= X-MC-Unique: iGEEzug2Nom0pCSiXnwaPA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/9] error: Introduce VIR_ERR_CHECKPOINT_INCONSISTENT error code Date: Wed, 4 Nov 2020 14:05:01 +0100 Message-Id: <71a70ac9efbadae4cd0d039a3ee3378494c32732.1604495066.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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" This code will be used to signal cases when the checkpoint is broken either during backup or other operations where a user might want to make decision based on the presence of the checkpoint, such as do a full backup instead of an incremental one. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- include/libvirt/virterror.h | 1 + src/util/virerror.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 0f1c32283d..b96fe250aa 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -332,6 +332,7 @@ typedef enum { VIR_ERR_NETWORK_PORT_EXIST =3D 106, /* the network port already exis= t */ VIR_ERR_NO_NETWORK_PORT =3D 107, /* network port not found */ VIR_ERR_NO_HOSTNAME =3D 108, /* no domain's hostname found */ + VIR_ERR_CHECKPOINT_INCONSISTENT =3D 109, /* checkpoint can't be used */ # ifdef VIR_ENUM_SENTINELS VIR_ERR_NUMBER_LAST diff --git a/src/util/virerror.c b/src/util/virerror.c index 80a7cfe0ed..9e3bad97eb 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1227,6 +1227,10 @@ static const virErrorMsgTuple virErrorMsgStrings[] = =3D { [VIR_ERR_NO_HOSTNAME] =3D { N_("no hostname found"), N_("no hostname found: %s") }, + [VIR_ERR_CHECKPOINT_INCONSISTENT] =3D { + N_("checkpoint inconsistent"), + N_("checkpoint inconsistent: %s") + }, }; G_STATIC_ASSERT(G_N_ELEMENTS(virErrorMsgStrings) =3D=3D VIR_ERR_NUMBER_LAS= T); --=20 2.26.2 From nobody Fri May 3 15:28:30 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=1604495131; cv=none; d=zohomail.com; s=zohoarc; b=YVsqWwS3tKmaa85D+d1vCp0kkcZgDmXEoj47gJAkpX3kJQugoNI2ITTwgOIQW9KaumQ5stP2rxEO62SEcjbstlXECcWwiWc7Xmsrt2I+Zk9R3egVrZO9g1/pTRnhZD/LnxCaRAoxm+cmNjiDYmYVd1jn0L1q7cOhsWkdLdsYQfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495131; 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=Mn6IbO8uEMBwTDZBDCUA7DcCwH1xpihhqdHE+LgwLTs=; b=aetnj08C3D8t1wUIVvHwxA2PB8IRx6XknIWZmTuyb2agmNR7rgD9B9xAcJRgXU5TY6WcH4mH/jUGf6yZBgwvRo40r8ejWbs7mWXRTreywvvqnALWPrGWHhXnE2cEb1LBLeGcr8uF033PKjWfj41CPIr0dKn4twG+HAw93GXHIQE= 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 1604495131705584.268550838337; Wed, 4 Nov 2020 05:05:31 -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-240-unO4TUO9OZ6j1OEFvoev5w-1; Wed, 04 Nov 2020 08:05:27 -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 99027107B47C; Wed, 4 Nov 2020 13:05:18 +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 6267A73672; Wed, 4 Nov 2020 13:05:18 +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 1BE9A18199F8; Wed, 4 Nov 2020 13:05:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5E6Z002933 for ; Wed, 4 Nov 2020 08:05:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2FD731C6; Wed, 4 Nov 2020 13:05:14 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AF2E5C1D0 for ; Wed, 4 Nov 2020 13:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495129; 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=Mn6IbO8uEMBwTDZBDCUA7DcCwH1xpihhqdHE+LgwLTs=; b=IZ/fNtdSePz6D/S09zIoK8M7Vrcs4Qn37/v0a6IMAxDctWwmsEQ2rNPkYpHy7de1nFJm6U /ttpowWWNs3Iv3nUw9hHZQk84F/YDwK0ttSEDxkt5QWJFGfk7Nj9yjQt172o3MVpsEyQxe j5acXEUXKLqjpkrcedRL19j3cMHAKvw= X-MC-Unique: unO4TUO9OZ6j1OEFvoev5w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/9] qemu: backup: Use VIR_ERR_CHECKPOINT_INCONSISTENT when starting a backup Date: Wed, 4 Nov 2020 14:05:02 +0100 Message-Id: <19f4e56b7704ae8d31baa397bb5a745766db7a97.1604495066.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.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" If we don't have a consistent chain of bitmaps for the backup to proceed we'd report VIR_ERR_INVALID_ARG error code, which makes it hard to decide whether an incremental backup makes even sense. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 5376d9485d..d0c852cf80 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -206,7 +206,7 @@ qemuBackupDiskPrepareOneBitmaps(struct qemuBackupDiskDa= ta *dd, if (!qemuBlockBitmapChainIsValid(dd->domdisk->src, dd->backupdisk->incremental, blockNamedNodeData)) { - virReportError(VIR_ERR_INVALID_ARG, + virReportError(VIR_ERR_CHECKPOINT_INCONSISTENT, _("missing or broken bitmap '%s' for disk '%s'"), dd->backupdisk->incremental, dd->domdisk->dst); return -1; --=20 2.26.2 From nobody Fri May 3 15:28:30 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=1604495133; cv=none; d=zohomail.com; s=zohoarc; b=gr5t7JLICK2qycnPTY13tCH4SxxVEAdI58OupEm8MNPh1dH5/zqSoyQsTnTFH1fl7qW2bx9NxRMXj649pq0UuFsectTVjlhyY4wvmHmx077JvXn/asnI+DgxiKEEmIa7PfSQq7ksH0MvH0iq5fuf0tR1FvyDDTW4Rjt61n9pROs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495133; 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=ko6CAxZDszNMoBH8VwmEQMxdgfQMeD6kKaj9WIoAfL8=; b=BxWrFMLQgNE9tZPssZx80k/pBValq1mP8SK5KDcXNPoPqlV5cCqEmP7MhotAcxoxSgjosGHXZ3x3bTcMHgNodlb8VnKxd/Gq3KPXamz2JK8xtw8suLZ9pPQZ6qvzWIuOCEjchfyxTCRuV89Xf3Ba2S5dRnnp7dlrKtXMbpoY8TE= 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 1604495133861321.94167414872607; Wed, 4 Nov 2020 05:05: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-165-QHpZVwyyM8GsRnV7iSt5ig-1; Wed, 04 Nov 2020 08:05:29 -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 784EE101F03C; Wed, 4 Nov 2020 13:05:19 +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 2C54D6CE52; Wed, 4 Nov 2020 13:05:19 +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 DF82D181A06D; Wed, 4 Nov 2020 13:05:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5Fxo002946 for ; Wed, 4 Nov 2020 08:05:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 533CE5C1D0; Wed, 4 Nov 2020 13:05:15 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F2605C640 for ; Wed, 4 Nov 2020 13:05:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495131; 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=ko6CAxZDszNMoBH8VwmEQMxdgfQMeD6kKaj9WIoAfL8=; b=KYUlcOaXSnq1yFcLA9HE52j2bwRy1+CSwrglODU9XR6nhmxZ6hwhWbdpfoGCXbKRoxJaxO nKG8qRcZaxWO0S2fCVOfoE8Ry4pCjtiCx+BElT0ETOxkRfgP3SJkrRAxErGrQRgQnMeio4 tA2ICyvK1GKtJe7q/TMzgjXWC/DUsdc= X-MC-Unique: QHpZVwyyM8GsRnV7iSt5ig-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/9] checkpoint: Introduce VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE flag Date: Wed, 4 Nov 2020 14:05:03 +0100 Message-Id: <77e6540b139321a47b6b2227fd6e1811749f441f.1604495066.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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" Introduce a flag which will allow users to perform hypervisor-specific valdiation when redefining the checkpoint metadata. This will allow to check metadata which is stored e.g. in disk images when populating the libvirt metadata. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- include/libvirt/libvirt-domain-checkpoint.h | 2 ++ src/libvirt-domain-checkpoint.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/libvirt/libvirt-domain-checkpoint.h b/include/libvirt/= libvirt-domain-checkpoint.h index f4bd92e81c..58932c8a6a 100644 --- a/include/libvirt/libvirt-domain-checkpoint.h +++ b/include/libvirt/libvirt-domain-checkpoint.h @@ -57,6 +57,8 @@ typedef enum { quiesce all mo= unted file systems w= ithin the domain */ + VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE =3D (1 << 2), /* validate dis= k data state + when redefinin= g a checkpoint */ } virDomainCheckpointCreateFlags; /* Create a checkpoint using the current VM state. */ diff --git a/src/libvirt-domain-checkpoint.c b/src/libvirt-domain-checkpoin= t.c index e9af8e4cf0..e0c2527ccb 100644 --- a/src/libvirt-domain-checkpoint.c +++ b/src/libvirt-domain-checkpoint.c @@ -125,6 +125,11 @@ virDomainCheckpointGetConnect(virDomainCheckpointPtr c= heckpoint) * has a way to resupply correct defaults). Not all hypervisors support * this flag. * + * If @flags includes VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE along with + * VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE the state of the metadata related + * to the disk state of the redefined checkpoint is validated. Note that + * hypervisors may require that the @domain is running to perform validati= on. + * * If @flags includes VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE, then the * libvirt will attempt to use guest agent to freeze and thaw all file * systems in use within domain OS. However, if the guest agent is not @@ -155,6 +160,10 @@ virDomainCheckpointCreateXML(virDomainPtr domain, VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE, error); + VIR_REQUIRE_FLAG_GOTO(VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE, + VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE, + error); + if (conn->driver->domainCheckpointCreateXML) { virDomainCheckpointPtr ret; ret =3D conn->driver->domainCheckpointCreateXML(domain, xmlDesc, f= lags); --=20 2.26.2 From nobody Fri May 3 15:28:30 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=1604495134; cv=none; d=zohomail.com; s=zohoarc; b=YNqmmRUzCPtVY5gNQkDOzAT31YSkBzDUH4wfVqWwczo1Un+Js40wDJleQxzv4vfPOXSla5tWYEaAbejI0kLgbHRhhl74IUWrlvAsQ9Fz9TUDV93HR0B74y40UVRfNESOurf5Q9QP35HBPX5Y50Rs3RT7OOdY10r9ipaR2IcmFrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495134; 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=yKljo1Xp51DtvahYHp9gFiV3YAdm7EDYV5FtFxvXPQc=; b=Ed/AC2UpwSHDzjqv2AoRVhCat7tGQhRqYZojydmsOH6Lq2vZ5Dlkg9CLeXbYSLaHetvI3phxVq/QK8CNU6niPvkrJvkesvPbL+Np0ZS21bucyZUX0TFWFqXtcKhpa+drxsVPMz/jyPxal2Lf919S6aEgIBSSVLBKB/9u3VDGWkA= 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 1604495134026632.9178806486121; Wed, 4 Nov 2020 05:05: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-498-U7i-kqJXP5qHgNoTClMKjA-1; Wed, 04 Nov 2020 08:05:30 -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 7FAF3907E5E; Wed, 4 Nov 2020 13:05:22 +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 3E45D1007620; Wed, 4 Nov 2020 13:05:22 +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 EF476181A06D; Wed, 4 Nov 2020 13:05:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5G1L002963 for ; Wed, 4 Nov 2020 08:05:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6EE271C6; Wed, 4 Nov 2020 13:05:16 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id C53D75C1D0 for ; Wed, 4 Nov 2020 13:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495131; 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=yKljo1Xp51DtvahYHp9gFiV3YAdm7EDYV5FtFxvXPQc=; b=UlS0nO/5MMtzh4/BJ3pCXNNJC74JKCcPybvAjuI70mqTNfqN2RCyvK8foNq7zpf4xvhbb/ kaEmcZ+WzTNL/dWZ2dUh6jgvSIBKd9W4SsF02LFewL1aQgcf1iuRe8l5pv6DLZ0MFYbSZK rRHmDLDKeCzAqK6M+LQNnDQWPW4xK5k= X-MC-Unique: U7i-kqJXP5qHgNoTClMKjA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/9] virsh: checkpoint-create: Add support for VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE Date: Wed, 4 Nov 2020 14:05:04 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.22 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: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/manpages/virsh.rst | 7 ++++++- tools/virsh-checkpoint.c | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 40b7dce093..6fc17e38cd 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -7141,7 +7141,7 @@ checkpoint-create :: - checkpoint-create domain [xmlfile] { --redefine | [--quiesce]} + checkpoint-create domain [xmlfile] { --redefine [--redefine-validate] |= [--quiesce]} Create a checkpoint for domain *domain* with the properties specified in *xmlfile* describing a top-level element. The @@ -7159,6 +7159,11 @@ alterations in the checkpoint metadata (such as host= -specific aspects of the domain XML embedded in the checkpoint). When this flag is supplied, the *xmlfile* argument is mandatory. +If *--redefine-validate* is specified along with *--redefine* the hypervis= or +performs validation of metadata associated with the checkpoint stored in p= laces +besides the checkpoint XML. Note that some hypervisors may require that the +domain is running to perform validation. + If *--quiesce* is specified, libvirt will try to use guest agent to freeze and unfreeze domain's mounted file systems. However, if domain has no guest agent, checkpoint creation will fail. diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index ac9d5bd348..cc2bbdae8a 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -99,6 +99,10 @@ static const vshCmdOptDef opts_checkpoint_create[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("redefine metadata for existing checkpoint") }, + {.name =3D "redefine-validate", + .type =3D VSH_OT_BOOL, + .help =3D N_("validate the redefined checkpoint") + }, {.name =3D "quiesce", .type =3D VSH_OT_BOOL, .help =3D N_("quiesce guest's file systems") @@ -116,8 +120,12 @@ cmdCheckpointCreate(vshControl *ctl, char *buffer =3D NULL; unsigned int flags =3D 0; + VSH_REQUIRE_OPTION("redefine-validate", "redefine"); + if (vshCommandOptBool(cmd, "redefine")) flags |=3D VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE; + if (vshCommandOptBool(cmd, "redefine-validate")) + flags |=3D VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE; if (vshCommandOptBool(cmd, "quiesce")) flags |=3D VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE; --=20 2.26.2 From nobody Fri May 3 15:28:30 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=1604495132; cv=none; d=zohomail.com; s=zohoarc; b=DYqP5loZRLZOGnbXoYF6m/NDEAlGdVCSCmYlZagWcQLCTv+w9B2YxKOTpSlsEgEyYxgzuwc0G8DfyfXeiZUq2qJqjcDT4UF+N+oug6zWZaNgrMaqbLj25J3RASODGM2+n1eLzSQa95voc8fMXe1zxoC5WsKO779aGXAOMjU08QM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495132; 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=4NYY+3eb9xMguNVdTjcRMLMFgxi9zRagjx5W7QkbVSg=; b=TbUkO0GtOZa73f++VddQY+W6DwbSYIyGjucyNz1G3Z1egjfpjwFZfW4YJleaIycBPBAQxNzfq9O4RYCLnAkKK3xtk4GSiRFM9xqlzJL5pMz7QBYpfdFcMtKnNjHU2JRCZlasg/JiIlhTuISiGQP2SrCh5mj9fdvjkCGCX7oxGZU= 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 1604495132458261.87026840962983; Wed, 4 Nov 2020 05:05:32 -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-123-QR-86hJMN4iVlHEs4wJZ6w-1; Wed, 04 Nov 2020 08:05:27 -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 1CC06804752; Wed, 4 Nov 2020 13:05:19 +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 E71E45D9CC; Wed, 4 Nov 2020 13:05:18 +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 AB0138C7B0; Wed, 4 Nov 2020 13:05:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5HEL002970 for ; Wed, 4 Nov 2020 08:05:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 86F395C640; Wed, 4 Nov 2020 13:05:17 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id D69CF5C1D0 for ; Wed, 4 Nov 2020 13:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495130; 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=4NYY+3eb9xMguNVdTjcRMLMFgxi9zRagjx5W7QkbVSg=; b=GCbXwbnEB2nTch5ioSA7g+78Wb/4hA/rSpcXjIQru38gFPlzz68Xnk7Gt4AU2qgAugajsT kyGfcEqT3F/RxBn1eDuLGzws8YuwjYbAcGtyxkKZCaB9e08HE70pVnPFHs2tcQw3SnXsif 82xMq1C75aqrYAxoz4xoPMxXlFnkwGU= X-MC-Unique: QR-86hJMN4iVlHEs4wJZ6w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/9] conf: checkpoint: Split virDomainCheckpointRedefinePrep into two functions Date: Wed, 4 Nov 2020 14:05:05 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.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" First one prepares and validates the definition, the second one actually either updates an existing checkpoint or assigns definition for the new one. This will allow driver code to add extra validation between those steps. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/checkpoint_conf.c | 30 +++++++++++++++++++++--------- src/conf/checkpoint_conf.h | 14 +++++++++----- src/libvirt_private.syms | 1 + src/qemu/qemu_checkpoint.c | 12 ++---------- src/test/test_driver.c | 9 ++++----- 5 files changed, 37 insertions(+), 29 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index e175917eae..a8d18928de 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -513,16 +513,11 @@ virDomainCheckpointDefFormat(virDomainCheckpointDefPt= r def, int virDomainCheckpointRedefinePrep(virDomainObjPtr vm, - virDomainCheckpointDefPtr *defptr, - virDomainMomentObjPtr *chk, - virDomainXMLOptionPtr xmlopt, + virDomainCheckpointDefPtr def, bool *update_current) { - virDomainCheckpointDefPtr def =3D *defptr; char uuidstr[VIR_UUID_STRING_BUFLEN]; virDomainMomentObjPtr parent =3D NULL; - virDomainMomentObjPtr other =3D NULL; - virDomainCheckpointDefPtr otherdef =3D NULL; virUUIDFormat(vm->def->uuid, uuidstr); @@ -550,12 +545,26 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm, if (virDomainCheckpointGetCurrent(vm->checkpoints) =3D=3D NULL) *update_current =3D true; + return 0; +} + + +virDomainMomentObjPtr +virDomainCheckpointRedefineCommit(virDomainObjPtr vm, + virDomainCheckpointDefPtr *defptr, + virDomainXMLOptionPtr xmlopt) +{ + virDomainCheckpointDefPtr def =3D *defptr; + virDomainMomentObjPtr other =3D NULL; + virDomainCheckpointDefPtr otherdef =3D NULL; + virDomainMomentObjPtr chk =3D NULL; + 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 -1; + return NULL; /* Drop and rebuild the parent relationship, but keep all * child relations by reusing chk. */ @@ -563,8 +572,11 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm, virObjectUnref(otherdef); other->def =3D &(*defptr)->parent; *defptr =3D NULL; - *chk =3D other; + chk =3D other; + } else { + chk =3D virDomainCheckpointAssignDef(vm->checkpoints, def); + *defptr =3D NULL; } - return 0; + return chk; } diff --git a/src/conf/checkpoint_conf.h b/src/conf/checkpoint_conf.h index f115b98c2b..631f863151 100644 --- a/src/conf/checkpoint_conf.h +++ b/src/conf/checkpoint_conf.h @@ -90,10 +90,14 @@ virDomainCheckpointDefFormat(virDomainCheckpointDefPtr = def, int virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr checkpoint); -int virDomainCheckpointRedefinePrep(virDomainObjPtr vm, - virDomainCheckpointDefPtr *def, - virDomainMomentObjPtr *checkpoint, - virDomainXMLOptionPtr xmlopt, - bool *update_current); +int +virDomainCheckpointRedefinePrep(virDomainObjPtr vm, + virDomainCheckpointDefPtr def, + bool *update_current); + +virDomainMomentObjPtr +virDomainCheckpointRedefineCommit(virDomainObjPtr vm, + virDomainCheckpointDefPtr *defptr, + virDomainXMLOptionPtr xmlopt); VIR_ENUM_DECL(virDomainCheckpoint); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 95e50835ad..fb6fbd1f9f 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -86,6 +86,7 @@ virDomainCheckpointDefFormat; virDomainCheckpointDefNew; virDomainCheckpointDefParseString; virDomainCheckpointFormatConvertXMLFlags; +virDomainCheckpointRedefineCommit; virDomainCheckpointRedefinePrep; virDomainCheckpointTypeFromString; virDomainCheckpointTypeToString; diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index fb76c211f8..caedfe1c55 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -377,22 +377,14 @@ qemuCheckpointRedefine(virQEMUDriverPtr driver, virDomainCheckpointDefPtr *def, bool *update_current) { - virDomainMomentObjPtr chk =3D NULL; - - if (virDomainCheckpointRedefinePrep(vm, def, &chk, driver->xmlopt, - update_current) < 0) + if (virDomainCheckpointRedefinePrep(vm, *def, update_current) < 0) return NULL; /* XXX Should we validate that the redefined checkpoint even * makes sense, such as checking that qemu-img recognizes the * checkpoint bitmap name in at least one of the domain's disks? */ - if (chk) - return chk; - - chk =3D virDomainCheckpointAssignDef(vm->checkpoints, *def); - *def =3D NULL; - return chk; + return virDomainCheckpointRedefineCommit(vm, def, driver->xmlopt); } diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 5c02a8ebb0..cd502781e1 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -8989,9 +8989,10 @@ testDomainCheckpointCreateXML(virDomainPtr domain, goto cleanup; if (redefine) { - if (virDomainCheckpointRedefinePrep(vm, &def, &chk, - privconn->xmlopt, - &update_current) < 0) + if (virDomainCheckpointRedefinePrep(vm, def, &update_current) < 0) + goto cleanup; + + if (!(chk =3D virDomainCheckpointRedefineCommit(vm, &def, privconn= ->xmlopt))) goto cleanup; } else { if (!(def->parent.dom =3D virDomainDefCopy(vm->def, @@ -9002,9 +9003,7 @@ testDomainCheckpointCreateXML(virDomainPtr domain, if (virDomainCheckpointAlignDisks(def) < 0) goto cleanup; - } - if (!chk) { if (!(chk =3D virDomainCheckpointAssignDef(vm->checkpoints, def))) goto cleanup; --=20 2.26.2 From nobody Fri May 3 15:28:30 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=1604495171; cv=none; d=zohomail.com; s=zohoarc; b=HbqjmVqtbEv7Kk1GxjHaWO2fhU1kBPOXQ31Fif+r1ZgHznsz4RawtD8gp8o4CZNXUMprSJyRMEM4dTuxinINggAjcZ3FFI2lFe2AEOFXQlzOMx0HAMEaprhCnIxRiE7IUZNn0JQEY3Mz5Ac+N31a64rAm3YnS6gDaciiMogsGUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495171; 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=//vkdBn7Xj1YEreafn4dYjGmhANGu0jHffzNVxN1juw=; b=UTt0+51bjOmZ4J4Y8kNasymwDQD5zySUpvT/REsjZ/Jka79gLAymZx2TJqpjnIpPF5GHOmgYYhNe4XrjXKNgUgXUVBYZICEbbXXdGaggvhMLvSEQFiDcc93A13HF8r1HGOig1WOUeuxBRxhJmu0ytHH4sGWUdMdq/Eh9bHaGa54= 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 1604495171099216.35633791827615; Wed, 4 Nov 2020 05:06:11 -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-406-DEgTC2L5ObaemedDGo5w6w-1; Wed, 04 Nov 2020 08:05:32 -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 3D12B907E3E; Wed, 4 Nov 2020 13:05:25 +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 1838960BFA; Wed, 4 Nov 2020 13:05:25 +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 D81E8181A06D; Wed, 4 Nov 2020 13:05:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5J67003017 for ; Wed, 4 Nov 2020 08:05:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0A7531E2; Wed, 4 Nov 2020 13:05:19 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DC88177F9 for ; Wed, 4 Nov 2020 13:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495168; 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=//vkdBn7Xj1YEreafn4dYjGmhANGu0jHffzNVxN1juw=; b=ag5y/hZvq7Gi2UWEx4m9fUciJHefKW1M2W4B1PVPSVX8gL4DQIm025IyQ0/P0bZNbDXadL KeZUfOF/X210BQgOJo7Ns+YOKNu8TuanbWQdmsBxzeBmrR2KAkF40O3Mp7oopHvyg1AHeI UZMn/Zp5iNTjl7/45AzRooVdjw686fw= X-MC-Unique: DEgTC2L5ObaemedDGo5w6w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 8/9] qemu: checkpoint: Implement VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE Date: Wed, 4 Nov 2020 14:05:06 +0100 Message-Id: <9b78871e48f4bfdba73b26f5636ed7960381806a.1604495066.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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" Validate that the bitmaps are present when redefining a checkpoint. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_checkpoint.c | 52 +++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index caedfe1c55..83cad5eab1 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -371,18 +371,56 @@ qemuCheckpointAddActions(virDomainObjPtr vm, } +static int +qemuCheckpointRedefineValidateBitmaps(virDomainObjPtr vm, + virDomainCheckpointDefPtr chkdef) +{ + g_autoptr(virHashTable) blockNamedNodeData =3D NULL; + size_t i; + + if (virDomainObjCheckActive(vm) < 0) + return -1; + + if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEMU_ASYNC_= JOB_NONE))) + return -1; + + for (i =3D 0; i < chkdef->ndisks; i++) { + virDomainCheckpointDiskDefPtr chkdisk =3D chkdef->disks + i; + virDomainDiskDefPtr domdisk; + + if (chkdisk->type !=3D VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP) + continue; + + /* we tolerate missing disks due to possible detach */ + if (!(domdisk =3D virDomainDiskByTarget(vm->def, chkdisk->name))) + continue; + + if (!qemuBlockBitmapChainIsValid(domdisk->src, chkdef->parent.name, + blockNamedNodeData)) { + virReportError(VIR_ERR_CHECKPOINT_INCONSISTENT, + _("missing or broken bitmap '%s' for disk '%s'"= ), + chkdef->parent.name, domdisk->dst); + return -1; + } + } + + return 0; +} + + static virDomainMomentObjPtr qemuCheckpointRedefine(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainCheckpointDefPtr *def, - bool *update_current) + bool *update_current, + bool validate_bitmaps) { if (virDomainCheckpointRedefinePrep(vm, *def, update_current) < 0) return NULL; - /* XXX Should we validate that the redefined checkpoint even - * makes sense, such as checking that qemu-img recognizes the - * checkpoint bitmap name in at least one of the domain's disks? */ + if (validate_bitmaps && + qemuCheckpointRedefineValidateBitmaps(vm, *def) < 0) + return NULL; return virDomainCheckpointRedefineCommit(vm, def, driver->xmlopt); } @@ -500,11 +538,13 @@ qemuCheckpointCreateXML(virDomainPtr domain, virDomainCheckpointPtr checkpoint =3D NULL; bool update_current =3D true; bool redefine =3D flags & VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE; + bool validate_bitmaps =3D flags & VIR_DOMAIN_CHECKPOINT_REDEFINE_VALID= ATE; unsigned int parse_flags =3D 0; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); g_autoptr(virDomainCheckpointDef) def =3D NULL; - virCheckFlags(VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE, NULL); + virCheckFlags(VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE | + VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE, NULL); if (redefine) { parse_flags |=3D VIR_DOMAIN_CHECKPOINT_PARSE_REDEFINE; @@ -535,7 +575,7 @@ qemuCheckpointCreateXML(virDomainPtr domain, return NULL; if (redefine) { - chk =3D qemuCheckpointRedefine(driver, vm, &def, &update_current); + chk =3D qemuCheckpointRedefine(driver, vm, &def, &update_current, = validate_bitmaps); } else { chk =3D qemuCheckpointCreate(driver, vm, &def); } --=20 2.26.2 From nobody Fri May 3 15:28:30 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=1604495136; cv=none; d=zohomail.com; s=zohoarc; b=APL0g91xED8qep27gtA6PJ0NEoiCzFc+YF9xi6eRXVaoGyEa7WKA7qzFaBXalzrUlxxDnymI1oLIfGExUPYWEZe1lkTQijcLJTS7g1PMqs0DJGrp+2yONMHgYfWSWVPIQ954MDzqUTnkNs9yz+CQNGUPoS2cOAsiqdqGWZJ7gX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604495136; 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=PqPThDTQTp68BvyjlndOfVKZ9HGYhNitDEH6DbBSYkY=; b=oDyaoSBUDiO65k3qMKBjpCMx0fpWhzU9Ff/3BGm7pWRYioXDIsORXkKIX23ZMj+sX4HofwunWNMf+1BWBA/dPAuhC6hOHQ8O7QYD1nWQ1xUEyDLEC6jW4UDRbl8uwSBDgkojUJdOe9knTHRMuRkQ2taiKZoSRtfkREgFmyqU3HI= 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 1604495136050699.1374089419818; Wed, 4 Nov 2020 05:05:36 -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-377-IsA3mko4PJmfZvt3_HHGcQ-1; Wed, 04 Nov 2020 08:05:31 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5AFBC8049F5; Wed, 4 Nov 2020 13:05:24 +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 355795C1D0; Wed, 4 Nov 2020 13:05: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 EEB538C7B0; Wed, 4 Nov 2020 13:05:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A4D5K1J003047 for ; Wed, 4 Nov 2020 08:05:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1F0E71C6; Wed, 4 Nov 2020 13:05:20 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6CF905C1D0 for ; Wed, 4 Nov 2020 13:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604495134; 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=PqPThDTQTp68BvyjlndOfVKZ9HGYhNitDEH6DbBSYkY=; b=HI6CXPxhAHgxm7irzzCYHRrB5Xi5d51rfY3eWlfZ3dbMS1HGMF6PpPy1VuHv0w69SREq4h CMPUEE8EZ9CojMjrB6WAt1nN/B/RfSPg12nfmKQChybbruaq+UOMKpJpLdROPGHOtNYXQD Mlhx+G3YtJz9UbDCqy2GVQLN7jbjcHM= X-MC-Unique: IsA3mko4PJmfZvt3_HHGcQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 9/9] qemu: backup: Add partial validation of incremental backup checkpoint Date: Wed, 4 Nov 2020 14:05:07 +0100 Message-Id: <42b612a720ab1fd699c35c1dbbe9dd8ac906dc03.1604495066.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.16 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" Verify that the checkpoint requested by an incremental backup exists. Unfortunately validating whether the checkpoint configuration actually matches the disk may not be reasonably feasible as the disk may have been renamed/snapshotted/etc. We still rely on bitmap presence. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_backup.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index d0c852cf80..92cdf34c46 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -277,6 +277,17 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, return -1; if (dd->backupdisk->incremental) { + /* We deliberately don't check the config of the disk in the check= point + * definition as it's not guaranteed that the disks still correspo= nd. + * We just verify that a checkpoint exists and later on that the d= isk + * has corresponding bitmap. */ + if (!virDomainCheckpointFindByName(vm->checkpoints, dd->backupdisk= ->incremental)) { + virReportError(VIR_ERR_NO_DOMAIN_CHECKPOINT, + _("Checkpoint '%s' for incremental backup of di= sk '%s' not found"), + dd->backupdisk->incremental, dd->backupdisk->na= me); + return -1; + } + if (dd->backupdisk->exportbitmap) dd->incrementalBitmap =3D g_strdup(dd->backupdisk->exportbitma= p); else --=20 2.26.2