mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 02:04:16 +03:00
qemu: backup: Enable full backup support
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 <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
12758f040a
commit
272017484e
@ -788,12 +788,33 @@ qemuBackupBegin(virDomainObjPtr vm,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
|
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_BACKUP)) {
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("incremental backup is not supported yet"));
|
_("backup is not supported with this QEMU"));
|
||||||
goto endjob;
|
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 is not supported yet"));
|
||||||
|
goto endjob;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < def->ndisks; i++) {
|
||||||
|
if (def->disks[i].backupmode == VIR_DOMAIN_BACKUP_DISK_BACKUP_MODE_INCREMENTAL) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
_("incremental backup is not supported yet"));
|
||||||
|
goto endjob;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->backup) {
|
if (priv->backup) {
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||||
_("another backup job is already running"));
|
_("another backup job is already running"));
|
||||||
@ -806,9 +827,6 @@ qemuBackupBegin(virDomainObjPtr vm,
|
|||||||
if (qemuBackupBeginPrepareTLS(vm, cfg, def, &tlsProps, &tlsSecretProps) < 0)
|
if (qemuBackupBeginPrepareTLS(vm, cfg, def, &tlsProps, &tlsSecretProps) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainBackupAlignDisks(def, vm->def, suffix) < 0)
|
|
||||||
goto endjob;
|
|
||||||
|
|
||||||
actions = virJSONValueNewArray();
|
actions = virJSONValueNewArray();
|
||||||
|
|
||||||
/* The 'chk' checkpoint must be rolled back if the transaction command
|
/* The 'chk' checkpoint must be rolled back if the transaction command
|
||||||
|
@ -2322,9 +2322,6 @@ qemuDomainObjPrivateXMLFormatBackups(virBufferPtr buf,
|
|||||||
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||||
|
|
||||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (priv->backup &&
|
if (priv->backup &&
|
||||||
virDomainBackupDefFormat(&childBuf, priv->backup, true) < 0)
|
virDomainBackupDefFormat(&childBuf, priv->backup, true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user