From nobody Mon Feb 9 04:31:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1496760408139156.568687586024; Tue, 6 Jun 2017 07:46:48 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 9CD088123D; Tue, 6 Jun 2017 14:46:42 +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 6F00FDC279; Tue, 6 Jun 2017 14:46:42 +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 185E9180BAFC; Tue, 6 Jun 2017 14:46:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v56EkMAx029178 for ; Tue, 6 Jun 2017 10:46:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0C0A917D38; Tue, 6 Jun 2017 14:46:22 +0000 (UTC) Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 618CC17D5F; Tue, 6 Jun 2017 14:46:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9CD088123D Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9CD088123D From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 6 Jun 2017 16:46:14 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 1/2] qemu: Conditionally allow block-copy for persistent domains 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 06 Jun 2017 14:46:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow starting the block-copy job for a persistent domain if a user declares by using a flag that the job will not be recovered if the VM is switched off while the job is active. This allows to use the block-copy job with persistent VMs under the same conditions as would apply to transient domains. --- include/libvirt/libvirt-domain.h | 3 +++ src/libvirt-domain.c | 3 +++ src/qemu/qemu_driver.c | 9 ++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 720db32f7..45f939a8c 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2428,6 +2428,9 @@ typedef enum { backing chain */ VIR_DOMAIN_BLOCK_COPY_REUSE_EXT =3D 1 << 1, /* Reuse existing external file for a copy */ + VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB =3D 1 << 2, /* Don't force usage of + recoverable job for t= he + copy operation */ } virDomainBlockCopyFlags; /** diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 310b91b37..6726a5120 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -10027,6 +10027,9 @@ virDomainBlockRebase(virDomainPtr dom, const char *= disk, * or virDomainDetachDevice(), while a copy job is active; they may * also restrict a copy job to transient domains. * + * If @flags contains VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB the job will not= be + * recoverable if the VM is turned of while job is active. + * * The @disk parameter is either an unambiguous source name of the * block device (the sub-element, such as * "/path/to/image"), or the device target shorthand (the diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f0cdea659..29efda198 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16507,7 +16507,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, /* Preliminaries: find the disk we are editing, sanity checks */ virCheckFlags(VIR_DOMAIN_BLOCK_COPY_SHALLOW | - VIR_DOMAIN_BLOCK_COPY_REUSE_EXT, -1); + VIR_DOMAIN_BLOCK_COPY_REUSE_EXT | + VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB, -1); priv =3D vm->privateData; cfg =3D virQEMUDriverGetConfig(driver); @@ -16546,7 +16547,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, _("block copy is not supported with this QEMU binar= y")); goto endjob; } - if (vm->persistent) { + if (!(flags & VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB) && + vm->persistent) { /* XXX if qemu ever lets us start a new domain with mirroring * already active, we can relax this; but for now, the risk of * 'managedsave' due to libvirt-guests means we can't risk @@ -16773,7 +16775,8 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *d= isk, const char *destxml, size_t i; virCheckFlags(VIR_DOMAIN_BLOCK_COPY_SHALLOW | - VIR_DOMAIN_BLOCK_COPY_REUSE_EXT, -1); + VIR_DOMAIN_BLOCK_COPY_REUSE_EXT | + VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB, -1); if (virTypedParamsValidate(params, nparams, VIR_DOMAIN_BLOCK_COPY_BANDWIDTH, VIR_TYPED_PARAM_ULLONG, --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list