提交 c314222a 编写于 作者: P Peter Krempa

qemu: backup: Move capability check after inactive check

Inactive VM doesn't have qemuCaps set thus we'd never properly report
that VM backups are supported only for running VMs.

Move the capability check after the active check.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 7f0b2f21
...@@ -750,12 +750,6 @@ qemuBackupBegin(virDomainObjPtr vm, ...@@ -750,12 +750,6 @@ qemuBackupBegin(virDomainObjPtr vm,
virCheckFlags(VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL, -1); virCheckFlags(VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL, -1);
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("incremental backup is not supported yet"));
return -1;
}
if (!(def = virDomainBackupDefParseString(backupXML, priv->driver->xmlopt, 0))) if (!(def = virDomainBackupDefParseString(backupXML, priv->driver->xmlopt, 0)))
return -1; return -1;
...@@ -793,6 +787,12 @@ qemuBackupBegin(virDomainObjPtr vm, ...@@ -793,6 +787,12 @@ qemuBackupBegin(virDomainObjPtr vm,
goto endjob; goto endjob;
} }
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
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"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册