From nobody Sun Feb 8 22:08:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616085980; cv=none; d=zohomail.com; s=zohoarc; b=ldtsfOwxBprw+EQne+pKMoySAVKXGxIFiZIIjQSlmaPgNUGeBYxWLMgHspJ1pMmagyy/nqrN+c7L9aAy8kEuXXF/S50faOLULu2K8lJ0kLFWJLPezft4nzZD5W0RqS1YkjbNVbZbxHOgBpwiQvvd6tUqUJQ4zl8SulxJkKsWxh4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616085980; 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=w3yfDPpVShfnJsFrHLkKTaUZjUsPwSE8SpbUHHmDAf8=; b=De8+KxLiA5M1yoBXhKrx8uvgy2XNj0ShuyWUNZWFRovjntNMUO7Np+EQswuK9VaDaMeTctBa+GPS69Pp8SNhgZIvn2I7PxylVeIknA3/uGBkun5TjJDqHKEoGbevUiM3FSmd2//R8o4d8jCsqqZCoii8TmqxYx8o9e4itj/p44A= 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 1616085980430551.2571765721025; Thu, 18 Mar 2021 09:46:20 -0700 (PDT) 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-326-nBAAvWPzMMStEktpYFIo9A-1; Thu, 18 Mar 2021 12:46:17 -0400 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 2643663CD8; Thu, 18 Mar 2021 16:46:11 +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 F27945D9D0; Thu, 18 Mar 2021 16:46:10 +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 A80B918155DD; Thu, 18 Mar 2021 16:46:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12IGk5pk029851 for ; Thu, 18 Mar 2021 12:46:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5B37210027A5; Thu, 18 Mar 2021 16:46:05 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6BD910023BE for ; Thu, 18 Mar 2021 16:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616085979; 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=w3yfDPpVShfnJsFrHLkKTaUZjUsPwSE8SpbUHHmDAf8=; b=DmOshotklnAXjIex6cG6gmTU6ATSLdyxdGyUXbQzC+XU9cgOHHaNRf3EGxFgRQphkUEaDm iBYFhghYzWm2tFrxy93IjKszM7kh4PGbcrpnnbHiebqfIZyKiH4m1n5muXs2ywPmKL2GvN LanELBGJI4od9XGjMIjtWtoYihq0uvs= X-MC-Unique: nBAAvWPzMMStEktpYFIo9A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/3] qemu: backup: Enable full backup support Date: Thu, 18 Mar 2021 17:45:56 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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" qemuBackupBegin can take a full backup of the disks (excluding any operations with bitmaps) without the need to wait for the blockdev-reopen support in qemu. Add a check that no checkpoint creation is required and the disk backup mode isn't VIR_DOMAIN_BACKUP_DISK_BACKUP_MODE_INCREMENTAL. Call to virDomainBackupAlignDisks is moved earlier as it initializes the disk backup mode if not present in user config. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 28 +++++++++++++++++++++++----- src/qemu/qemu_domain.c | 3 --- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index f91d632715..d89122f225 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -788,12 +788,33 @@ qemuBackupBegin(virDomainObjPtr vm, goto endjob; } - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) { + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_BACKUP)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("incremental backup is not supported yet")); + _("backup is not supported with this QEMU")); goto endjob; } + if (virDomainBackupAlignDisks(def, vm->def, suffix) < 0) + goto endjob; + + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) { + size_t i; + + if (chkdef) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("creating checkpoint for incremental backup i= s not supported yet")); + goto endjob; + } + + for (i =3D 0; i < def->ndisks; i++) { + if (def->disks[i].backupmode =3D=3D VIR_DOMAIN_BACKUP_DISK_BAC= KUP_MODE_INCREMENTAL) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("incremental backup is not supported yet"= )); + goto endjob; + } + } + } + if (priv->backup) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("another backup job is already running")); @@ -806,9 +827,6 @@ qemuBackupBegin(virDomainObjPtr vm, if (qemuBackupBeginPrepareTLS(vm, cfg, def, &tlsProps, &tlsSecretProps= ) < 0) goto endjob; - if (virDomainBackupAlignDisks(def, vm->def, suffix) < 0) - goto endjob; - actions =3D virJSONValueNewArray(); /* The 'chk' checkpoint must be rolled back if the transaction command diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ed2a1481d4..5c98f8ff1a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2322,9 +2322,6 @@ qemuDomainObjPrivateXMLFormatBackups(virBufferPtr buf, g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) - return 0; - if (priv->backup && virDomainBackupDefFormat(&childBuf, priv->backup, true) < 0) return -1; --=20 2.29.2