mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
blockcommit: update error messages related to block jobs
A future patch will add two-phase block commit jobs; as the mechanism for managing them is similar to managing a block copy job, existing errors should be made generic enough to occur for either job type. * src/conf/domain_conf.c (virDomainHasDiskMirror): Update comment. * src/qemu/qemu_driver.c (qemuDomainDefineXML) (qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot) (qemuDomainBlockJobImpl, qemuDomainBlockCopy): Update error message. * src/qemu/qemu_hotplug.c (qemuDomainDetachDiskDevice): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
1784037991
commit
278c51af3a
@ -10379,7 +10379,7 @@ virDomainDiskRemoveByName(virDomainDefPtr def, const char *name)
|
||||
}
|
||||
|
||||
/* Return true if VM has at least one disk involved in a current block
|
||||
* copy job (that is, with a <mirror> element in the disk xml). */
|
||||
* copy/commit job (that is, with a <mirror> element in the disk xml). */
|
||||
bool
|
||||
virDomainHasDiskMirror(virDomainObjPtr vm)
|
||||
{
|
||||
|
@ -6261,7 +6261,7 @@ static virDomainPtr qemuDomainDefineXML(virConnectPtr conn, const char *xml)
|
||||
def = NULL;
|
||||
if (virDomainHasDiskMirror(vm)) {
|
||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, "%s",
|
||||
_("domain has active block copy job"));
|
||||
_("domain has active block job"));
|
||||
virDomainObjAssignDef(vm, NULL, false, NULL);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -13465,7 +13465,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
||||
}
|
||||
if (virDomainHasDiskMirror(vm)) {
|
||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, "%s",
|
||||
_("domain has active block copy job"));
|
||||
_("domain has active block job"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -14075,7 +14075,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
|
||||
if (virDomainHasDiskMirror(vm)) {
|
||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, "%s",
|
||||
_("domain has active block copy job"));
|
||||
_("domain has active block job"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -15075,7 +15075,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
|
||||
|
||||
if (mode == BLOCK_JOB_PULL && disk->mirror) {
|
||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
|
||||
_("disk '%s' already in active block copy job"),
|
||||
_("disk '%s' already in active block job"),
|
||||
disk->dst);
|
||||
goto endjob;
|
||||
}
|
||||
@ -15283,7 +15283,7 @@ qemuDomainBlockCopy(virDomainObjPtr vm,
|
||||
disk = vm->def->disks[idx];
|
||||
if (disk->mirror) {
|
||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
|
||||
_("disk '%s' already in active block copy job"),
|
||||
_("disk '%s' already in active block job"),
|
||||
disk->dst);
|
||||
goto endjob;
|
||||
}
|
||||
|
@ -2986,7 +2986,7 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
|
||||
|
||||
if (detach->mirror) {
|
||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
|
||||
_("disk '%s' is in an active block copy job"),
|
||||
_("disk '%s' is in an active block job"),
|
||||
detach->dst);
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user