]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't reject making domain persistent if block copy is running
authorPeter Krempa <pkrempa@redhat.com>
Mon, 21 Jan 2019 11:28:25 +0000 (12:28 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 29 Jan 2019 16:11:02 +0000 (17:11 +0100)
Add documentation that the 'VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB' flag
is auto-assumed if the block copy job is started while the VM is
transient and remove the restriction to define the domain when copy
is running.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/libvirt-domain.c
src/qemu/qemu_driver.c

index b04929a6edc8306f25d54423b59f412105fffdfa..163f87916320fc2db4a314959a8ec8aea7394abb 100644 (file)
@@ -6133,11 +6133,6 @@ virDomainGetBlockInfo(virDomainPtr domain, const char *disk,
  * virDomainUndefine(). A previous definition for this domain would be
  * overridden if it already exists.
  *
- * Some hypervisors may prevent this operation if there is a current
- * block copy operation on a transient domain with the same id as the
- * domain being defined; in that case, use virDomainBlockJobAbort() to
- * stop the block copy first.
- *
  * virDomainFree should be used to free the resources after the
  * domain object is no longer needed.
  *
@@ -6181,11 +6176,6 @@ virDomainDefineXML(virConnectPtr conn, const char *xml)
  * virDomainUndefine(). A previous definition for this domain would be
  * overridden if it already exists.
  *
- * Some hypervisors may prevent this operation if there is a current
- * block copy operation on a transient domain with the same id as the
- * domain being defined; in that case, use virDomainBlockJobAbort() to
- * stop the block copy first.
- *
  * virDomainFree should be used to free the resources after the
  * domain object is no longer needed.
  *
@@ -10312,7 +10302,8 @@ virDomainBlockRebase(virDomainPtr dom, const char *disk,
  *
  * If @flags contains VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB the job will not be
  * recoverable if the VM is turned off while job is active. This flag will
- * remove the restriction of copy jobs to transient domains.
+ * remove the restriction of copy jobs to transient domains. Note that this flag
+ * is automatically implied if the VM is transient at the time it's started.
  *
  * The @disk parameter is either an unambiguous source name of the
  * block device (the <source file='...'/> sub-element, such as
index f6fba3a6adac22efd10757a73b15e38e04d36f41..26edbf799f41200609c92092a283c4bcb89196d6 100644 (file)
@@ -7709,12 +7709,6 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
         goto cleanup;
     def = NULL;
 
-    if (qemuDomainHasBlockjob(vm, true)) {
-        virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, "%s",
-                       _("domain has active block job"));
-        virDomainObjAssignDef(vm, NULL, false, NULL);
-        goto cleanup;
-    }
     vm->persistent = 1;
 
     if (virDomainSaveConfig(cfg->configDir, driver->caps,