Introduce dirty_rate async job for qemuDomainGetDirtyRateInfo. Signed-off-by: Hao Wang <wanghao232@xxxxxxxxxx> Reviewed-by: Chuan Zheng <zhengchuan@xxxxxxxxxx> --- include/libvirt/libvirt-domain.h | 1 + src/qemu/qemu_domainjob.c | 3 +++ src/qemu/qemu_domainjob.h | 1 + src/qemu/qemu_driver.c | 5 +++++ src/qemu/qemu_migration.c | 2 ++ src/qemu/qemu_process.c | 3 +++ tools/virsh-domain.c | 1 + 7 files changed, 16 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index a4b5fcc..5ed0ecd 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -3295,6 +3295,7 @@ typedef enum { VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT = 7, VIR_DOMAIN_JOB_OPERATION_DUMP = 8, VIR_DOMAIN_JOB_OPERATION_BACKUP = 9, + VIR_DOMAIN_JOB_OPERATION_DIRTYRATE = 10, # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_JOB_OPERATION_LAST diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index 6393cc0..5f802d4 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -61,6 +61,7 @@ VIR_ENUM_IMPL(qemuDomainAsyncJob, "snapshot", "start", "backup", + "dirty rate" ); const char * @@ -78,6 +79,7 @@ qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job, case QEMU_ASYNC_JOB_START: case QEMU_ASYNC_JOB_NONE: case QEMU_ASYNC_JOB_BACKUP: + case QEMU_ASYNC_JOB_DIRTYRATE: G_GNUC_FALLTHROUGH; case QEMU_ASYNC_JOB_LAST: break; @@ -104,6 +106,7 @@ qemuDomainAsyncJobPhaseFromString(qemuDomainAsyncJob job, case QEMU_ASYNC_JOB_START: case QEMU_ASYNC_JOB_NONE: case QEMU_ASYNC_JOB_BACKUP: + case QEMU_ASYNC_JOB_DIRTYRATE: G_GNUC_FALLTHROUGH; case QEMU_ASYNC_JOB_LAST: break; diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h index c83e055..63496ef 100644 --- a/src/qemu/qemu_domainjob.h +++ b/src/qemu/qemu_domainjob.h @@ -74,6 +74,7 @@ typedef enum { QEMU_ASYNC_JOB_SNAPSHOT, QEMU_ASYNC_JOB_START, QEMU_ASYNC_JOB_BACKUP, + QEMU_ASYNC_JOB_DIRTYRATE, QEMU_ASYNC_JOB_LAST } qemuDomainAsyncJob; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0ad6359..268e457 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13808,6 +13808,11 @@ static int qemuDomainAbortJob(virDomainPtr dom) ret = 0; break; + case QEMU_ASYNC_JOB_DIRTYRATE: + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot abort get dirty rate")); + break; + case QEMU_ASYNC_JOB_LAST: default: virReportEnumRangeError(qemuDomainAsyncJob, priv->job.asyncJob); diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2c7bf34..25b06ca 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1525,6 +1525,8 @@ qemuMigrationJobName(virDomainObjPtr vm) return _("start job"); case QEMU_ASYNC_JOB_BACKUP: return _("backup job"); + case QEMU_ASYNC_JOB_DIRTYRATE: + return _("dirty rate"); case QEMU_ASYNC_JOB_LAST: default: return _("job"); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ec6ca14..b4db76f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3657,6 +3657,9 @@ qemuProcessRecoverJob(virQEMUDriverPtr driver, priv->job.current->started = now; break; + case QEMU_ASYNC_JOB_DIRTYRATE: + break; + case QEMU_ASYNC_JOB_NONE: case QEMU_ASYNC_JOB_LAST: break; diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index aaf3b9a..2eabc95 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6165,6 +6165,7 @@ VIR_ENUM_IMPL(virshDomainJobOperation, N_("Snapshot revert"), N_("Dump"), N_("Backup"), + N_("Dirty Rate"), ); static const char * -- 2.23.0