[PATCH v2 0/7] migration/dirtyrate: Introduce APIs for getting domain memory dirty rate

Hao Wang posted 7 patches 3 years, 6 months ago
Test syntax-check failed
Failed in applying to current master (apply log)
There is a newer version of this series
include/libvirt/libvirt-domain.h |  64 ++++++++++++++++++
src/driver-hypervisor.h          |   7 ++
src/libvirt-domain.c             |  46 +++++++++++++
src/libvirt_public.syms          |   5 ++
src/qemu/qemu_driver.c           |  70 +++++++++++++++++++
src/qemu/qemu_migration.c        |  59 ++++++++++++++++
src/qemu/qemu_migration.h        |  10 +++
src/qemu/qemu_monitor.c          |  24 +++++++
src/qemu/qemu_monitor.h          |   8 +++
src/qemu/qemu_monitor_json.c     |  97 ++++++++++++++++++++++++++
src/qemu/qemu_monitor_json.h     |   8 +++
src/remote/remote_driver.c       |   1 +
src/remote/remote_protocol.x     |  21 +++++-
tools/virsh-domain.c             | 112 +++++++++++++++++++++++++++++++
14 files changed, 531 insertions(+), 1 deletion(-)
[PATCH v2 0/7] migration/dirtyrate: Introduce APIs for getting domain memory dirty rate
Posted by Hao Wang 3 years, 6 months ago
V1 -> V2:
replace QEMU_JOB_ASYNC with QEMU_JOB_QUERY


Sometimes domain's memory dirty rate is expected by user in order to
decide whether it's proper to be migrated out or not.

We have already completed the QEMU part of the capability:
https://patchew.org/QEMU/1600237327-33618-1-git-send-email-zhengchuan@huawei.com/
And this serial of patches introduce the corresponding LIBVIRT part --
DomainGetDirtyRateInfo API and corresponding virsh api -- "getdirtyrate".


instructions:
bash# virsh getdirtyrate --help
  NAME
    getdirtyrate - Get a vm's memory dirty rate

  SYNOPSIS
    getdirtyrate <domain> [--seconds <number>] [--calculate] [--query]

  DESCRIPTION
    Get memory dirty rate of a domain in order to decide whether it's proper to be migrated out or not.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    --seconds <number>  calculate memory dirty rate within specified seconds, a valid range of values is [1, 60], and would default to 1s.
    --calculate      calculate dirty rate only, can be used together with --query, either or both is expected, otherwise would default to both.
    --query          query dirty rate only, can be used together with --calculate, either or both is expected, otherwise would default to both.


example:
bash# virsh getdirtyrate --calculate --query --domain vm0 --seconds 1
status:        measured
startTime:     820148
calcTime:      1 s
dirtyRate:     6 MB/s


Hao Wang (7):
  migration/dirtyrate: Introduce virDomainDirtyRateInfo structure
  migration/dirtyrate: Implement qemuMonitorJSONExtractDirtyRateInfo
  migration/dirtyrate: Implement qemuDomainQueryDirtyRate
  migration/dirtyrate: Implement qemuDomainCalculateDirtyRate
  migration/dirtyrate: Introduce virDomainDirtyRateFlags
  migration/dirtyrate: Introduce DomainGetDirtyRateInfo API
  migration/dirtyrate: Introduce getdirtyrate virsh api

 include/libvirt/libvirt-domain.h |  64 ++++++++++++++++++
 src/driver-hypervisor.h          |   7 ++
 src/libvirt-domain.c             |  46 +++++++++++++
 src/libvirt_public.syms          |   5 ++
 src/qemu/qemu_driver.c           |  70 +++++++++++++++++++
 src/qemu/qemu_migration.c        |  59 ++++++++++++++++
 src/qemu/qemu_migration.h        |  10 +++
 src/qemu/qemu_monitor.c          |  24 +++++++
 src/qemu/qemu_monitor.h          |   8 +++
 src/qemu/qemu_monitor_json.c     |  97 ++++++++++++++++++++++++++
 src/qemu/qemu_monitor_json.h     |   8 +++
 src/remote/remote_driver.c       |   1 +
 src/remote/remote_protocol.x     |  21 +++++-
 tools/virsh-domain.c             | 112 +++++++++++++++++++++++++++++++
 14 files changed, 531 insertions(+), 1 deletion(-)

-- 
2.23.0