mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Add 'backup' block job type
A backup job may consist of many backup sub-blockjobs. Add the new blockjob type and add all type converter strings. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3656bb0a13
commit
08b810053a
@ -891,6 +891,9 @@ blockJobTypeToStr(int type)
|
||||
|
||||
case VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT:
|
||||
return "active layer block commit";
|
||||
|
||||
case VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP:
|
||||
return "backup";
|
||||
}
|
||||
|
||||
return "unknown";
|
||||
|
@ -2460,6 +2460,9 @@ typedef enum {
|
||||
* exists as long as sync is active */
|
||||
VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT = 4,
|
||||
|
||||
/* Backup (virDomainBackupBegin) */
|
||||
VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP = 5,
|
||||
|
||||
# ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_BLOCK_JOB_TYPE_LAST
|
||||
# endif
|
||||
|
@ -1227,7 +1227,7 @@ VIR_ENUM_IMPL(virDomainOsDefFirmware,
|
||||
VIR_ENUM_DECL(virDomainBlockJob);
|
||||
VIR_ENUM_IMPL(virDomainBlockJob,
|
||||
VIR_DOMAIN_BLOCK_JOB_TYPE_LAST,
|
||||
"", "", "copy", "", "active-commit",
|
||||
"", "", "copy", "", "active-commit", "",
|
||||
);
|
||||
|
||||
VIR_ENUM_IMPL(virDomainMemoryModel,
|
||||
|
@ -65,6 +65,7 @@ VIR_ENUM_IMPL(qemuBlockjob,
|
||||
"copy",
|
||||
"commit",
|
||||
"active-commit",
|
||||
"backup",
|
||||
"",
|
||||
"create",
|
||||
"broken");
|
||||
@ -1280,6 +1281,8 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
|
||||
qemuBlockJobProcessEventConcludedCopyAbort(driver, vm, job, asyncJob);
|
||||
break;
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_BACKUP:
|
||||
break;
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_BROKEN:
|
||||
case QEMU_BLOCKJOB_TYPE_NONE:
|
||||
|
@ -60,6 +60,7 @@ typedef enum {
|
||||
QEMU_BLOCKJOB_TYPE_COPY = VIR_DOMAIN_BLOCK_JOB_TYPE_COPY,
|
||||
QEMU_BLOCKJOB_TYPE_COMMIT = VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT,
|
||||
QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT = VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT,
|
||||
QEMU_BLOCKJOB_TYPE_BACKUP = VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP,
|
||||
/* Additional enum values local to qemu */
|
||||
QEMU_BLOCKJOB_TYPE_INTERNAL,
|
||||
QEMU_BLOCKJOB_TYPE_CREATE,
|
||||
|
@ -2603,6 +2603,8 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload,
|
||||
virBufferAddLit(&attrBuf, " shallownew='yes'");
|
||||
break;
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_BACKUP:
|
||||
break;
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_BROKEN:
|
||||
case QEMU_BLOCKJOB_TYPE_NONE:
|
||||
@ -3172,6 +3174,8 @@ qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemuBlockJobDataPtr job,
|
||||
}
|
||||
break;
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_BACKUP:
|
||||
break;
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_BROKEN:
|
||||
case QEMU_BLOCKJOB_TYPE_NONE:
|
||||
|
@ -17412,6 +17412,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_PULL:
|
||||
case QEMU_BLOCKJOB_TYPE_COMMIT:
|
||||
case QEMU_BLOCKJOB_TYPE_BACKUP:
|
||||
case QEMU_BLOCKJOB_TYPE_INTERNAL:
|
||||
case QEMU_BLOCKJOB_TYPE_CREATE:
|
||||
case QEMU_BLOCKJOB_TYPE_BROKEN:
|
||||
|
@ -1147,6 +1147,8 @@ qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon,
|
||||
type = VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT;
|
||||
else if (STREQ(type_str, "mirror"))
|
||||
type = VIR_DOMAIN_BLOCK_JOB_TYPE_COPY;
|
||||
else if (STREQ(type_str, "backup"))
|
||||
type = VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP;
|
||||
|
||||
switch ((virConnectDomainEventBlockJobStatus) event) {
|
||||
case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
|
||||
@ -4844,6 +4846,8 @@ qemuMonitorJSONParseBlockJobInfo(virHashTablePtr blockJobs,
|
||||
info->type = VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT;
|
||||
else if (STREQ(type, "mirror"))
|
||||
info->type = VIR_DOMAIN_BLOCK_JOB_TYPE_COPY;
|
||||
else if (STREQ(type, "backup"))
|
||||
info->type = VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP;
|
||||
else
|
||||
info->type = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN;
|
||||
|
||||
|
@ -2550,7 +2550,9 @@ VIR_ENUM_IMPL(virshDomainBlockJob,
|
||||
N_("Block Pull"),
|
||||
N_("Block Copy"),
|
||||
N_("Block Commit"),
|
||||
N_("Active Block Commit"));
|
||||
N_("Active Block Commit"),
|
||||
N_("Backup"),
|
||||
);
|
||||
|
||||
static const char *
|
||||
virshDomainBlockJobToString(int type)
|
||||
|
Loading…
x
Reference in New Issue
Block a user