[PATCH RFC 2/2] qemu: suppor dirty ring feature

2021-01-11 Thread huangy81
From: Hyman QEMU introduced a dirty ring feature, this patch add a new KVM feature 'dirty-ring' to set this feature for kvm guests. To enable the feature, libvirt add "-accel dirty_gfn_count=xxx" to QEMU command line, the following XML needs to be added to the guest's domain description:

[PATCH RFC v2 2/2] qemu: suppor dirty ring feature

2021-01-11 Thread huangy81
From: Hyman QEMU introduced a dirty ring feature, this patch add a new KVM feature 'dirty-ring' to set this feature for kvm guests. To enable the feature, libvirt add "-accel dirty-gfn-count=xxx" to QEMU command line, the following XML needs to be added to the guest's domain description:

[PATCH RFC v1 0/2] Dirty ring support(Libvirt)

2021-01-11 Thread huangy81
From: Hyman This is v1 of Dirty ring support of Libvirt. It is merely the same as v0, but fix the parameter dirty-gfn-count passed to QEMU command line. A previous implementation was patched by me mistakenly. This series of patches is a supplement of dirty ring implementation for Libvirt:

[PATCH RFC 0/2] Dirty ring support (Libvirt)

2021-01-11 Thread huangy81
From: Hyman This series of patches is a supplement of dirty ring implementation in Libvirt: https://lore.kernel.org/qemu-devel/20210108165050.406906-10-pet...@redhat.com/ Since QEMU enable the dirty ring feature by specifying the "-accel" sub-parameter. Libvirt use "-machine accel=xxx" option

[PATCH RFC v1 2/2] qemu: suppor dirty ring feature

2021-01-11 Thread huangy81
From: Hyman QEMU introduced a dirty ring feature, this patch add a new KVM feature 'dirty-ring' to set this feature for kvm guests. To enable the feature, libvirt add "-accel dirty-gfn-count=xxx" to QEMU command line, the following XML needs to be added to the guest's domain description:

[PATCH RFC v2 0/2] Dirty ring support(Libvirt)

2021-01-11 Thread huangy81
From: Hyman The v2 of Dirty ring support of Libvirt just and an empty function of 'qemuBuildAccelCommandLineTcgOptions' and do some code clen, if things go smoothly, the tcg accelerator property may be support in the future, this empty function give a hint to do that. This is v1 of Dirty ring

[RFC v4 0/4] Dirty Ring support (Libvirt)

2021-01-13 Thread huangy81
From: Hyman The v4 of Dirty Ring just fix args file in testsuite which has 'No-newline-at-end-of-file' and mak it a stand-alone patch. The following is detail: https://www.redhat.com/archives/libvir-list/2021-January/msg00626.html The v3 of Dirty Ring do some modification based on the

[RFC v4 1/4] tests: Add 'end-of-file' character to args file in qemuxml2argvdata

2021-01-13 Thread huangy81
From: Hyman The test file disk-backing-chains-noindex.x86_64-latest.args has 'No newline at end of file', this patch rewrite it in case unexpected behavior bewteen diffrent platform. See the details: https://www.redhat.com/archives/libvir-list/2021-January/msg00626.html Signed-off-by: Hyman

[RFC v4 4/4] qemu: suppor dirty ring feature

2021-01-13 Thread huangy81
From: Hyman QEMU introduced a dirty ring feature, this patch add a new KVM feature 'dirty-ring' to set this feature for kvm guests. To enable the feature, libvirt add "-accel dirty-gfn-count=xxx" to QEMU command line, the following XML needs to be added to the guest's domain description:

[RFC v4 2/4] qemu_capabilities: Introduce QEMU_CAPS_ACCEL

2021-01-13 Thread huangy81
From: Hyman The "-machine" options for accelerators are legacy, the "-accel" options is a better mechanism. The following are the details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ This patch introduce QEMU_CAPS_ACCEL capability to tell if we're dealing

[RFC v5 0/3] Dirty Ring support (Libvirt)

2021-01-13 Thread huangy81
From: Hyman The v5 of Dirty Ring correct the mistake introduced in v3 patch. Which using the shell script to modify the hundereds of test cases in qemuxml2argvdata directory, and do not take the symlink into account. The following is detail:

[RFC v5 1/3] qemu_capabilities: Introduce QEMU_CAPS_ACCEL

2021-01-13 Thread huangy81
From: Hyman The "-machine" options for accelerators are legacy, the "-accel" options is a better mechanism. The following are the details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ This patch introduce QEMU_CAPS_ACCEL capability to tell if we're dealing

[RFC v5 3/3] qemu: suppor dirty ring feature

2021-01-13 Thread huangy81
From: Hyman QEMU introduced a dirty ring feature, this patch add a new KVM feature 'dirty-ring' to set this feature for kvm guests. To enable the feature, libvirt add "-accel dirty-gfn-count=xxx" to QEMU command line, the following XML needs to be added to the guest's domain description:

[PATCH 1/2] qemu_capabilities: Introduce QEMU_CAPS_ACCEL

2021-01-13 Thread huangy81
From: Hyman The "-machine" options for accelerators are legacy, the "-accel" options is a better mechanism. The following are the details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ This patch introduce QEMU_CAPS_ACCEL capability to tell if we're dealing

[PATCH 0/2] specify the accelerator type using "-accel" parameter

2021-01-13 Thread huangy81
From: Hyman This patchset aims to support dirty ring feature which has been introduced in kernel: https://lore.kernel.org/lkml/8b3f68dd-c61c-16a0-2077-0a5d3d57a...@redhat.com/ The QEMU patchset is also being applied for merge, the review may be under the way:

[PATCH v3 3/3] qemu: suppor dirty ring feature

2021-01-12 Thread huangy81
From: Hyman QEMU introduced a dirty ring feature, this patch add a new KVM feature 'dirty-ring' to set this feature for kvm guests. To enable the feature, libvirt add "-accel dirty-gfn-count=xxx" to QEMU command line, the following XML needs to be added to the guest's domain description:

[PATCH v3 0/3] Dirty Ring support (Libvirt)

2021-01-12 Thread huangy81
From: Hyman The v3 of Dirty Ring do some modification based on the following discussion: https://www.redhat.com/archives/libvir-list/2021-January/msg00531.html https://www.redhat.com/archives/libvir-list/2021-January/msg00520.html modification 1: introducing the QEMU_CAPS_ACCEL so that we can

[PATCH v3 1/3] qemu_capabilities: Introduce QEMU_CAPS_ACCEL

2021-01-12 Thread huangy81
From: Hyman The "-machine" options for accelerators are legacy, the "-accel" options is a better mechanism. The following are the details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ This patch introduce QEMU_CAPS_ACCEL capability to tell if we're dealing

[PATCH 1/2] qemu_capabilities: Introduce QEMU_CAPS_ACCEL

2021-06-19 Thread huangy81
From: Hyman Huang(黄勇) Since the "-machine" option for accelerators is legacy, "-accel" option may be a better mechanism. following are details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ This patch introduce QEMU_CAPS_ACCEL capability to tell if we're

[PATCH 0/2] Dirty Ring support (Libvirt)

2021-06-19 Thread huangy81
From: Hyman Huang(黄勇) since qemu has introduced a dirty ring feature in 6.1.0, may be it's the right time to introduce dirty ring in libvirt meanwhile. this patch add feature named 'dirty-ring', which enable dirty ring feature when starting vm. to try this out, three things has done in this

[PATCH v2 3/4] conf: introduce dirty_ring_size in struct "_virDomainDef"

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) introduce dirty_ring_size to hold the ring size configured by user, and pass dirty_ring_size when building qemu commandline if dirty ring feature enabled. Signed-off-by: Hyman Huang(黄勇) --- src/conf/domain_conf.c | 78 +

[PATCH v2 4/4] qemu: support dirty ring feature

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) QEMU has introduced a dirty ring feature, this patch add corresponding feature named 'dirty-ring', which enable dirty ring feature when starting vm. to enable the feature, libvirt add "-accel dirty-ring-size=xxx" to QEMU command line, the following XML needs to be added to

[PATCH v2 0/4] Ring support (Libvirt)

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) v2 - split patchset into 4 patches - leave out the tcg case when building commandline. - handle the VIR_DOMAIN_KVM_DIRTY_RING case independently in , virDomainFeatureDefParse and virDomainDefFeaturesCheckABIStability, do not integrate it with other cases... - add

[PATCH v2 1/4] qemu_capabilities: introduce QEMU_CAPS_ACCEL

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) since the "-machine" option for accelerators is legacy, "-accel" option may be a better mechanism. following are details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ this patch introduce QEMU_CAPS_ACCEL capability to tell if we're

[PATCH v2 2/4] qemu_command: switch accelerator option to new style

2021-06-23 Thread huangy81
From: Hyman Huang(黄勇) QEMU greater than 2.9.0 support '-accel' option, change the way of assembling commandline from "accel=kvm" to "-accel kvm" when specifying accelerator. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_command.c| 31 +-

[PATCH v3 1/4] qemu_capabilities: introduce QEMU_CAPS_ACCEL

2021-06-24 Thread huangy81
From: Hyman Huang(黄勇) since the "-machine" option for accelerators is legacy, "-accel" option may be a better mechanism. following are details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ this patch introduce QEMU_CAPS_ACCEL capability to tell if we're

[PATCH v3 4/4] qemu: support dirty ring feature

2021-06-24 Thread huangy81
From: Hyman Huang(黄勇) QEMU has introduced a dirty ring feature, this patch add corresponding feature named 'dirty-ring', which enable dirty ring feature when starting vm. to enable the feature, libvirt add "-accel dirty-ring-size=xxx" to QEMU command line, the following XML needs to be added to

[PATCH v3 0/4] Dirty Ring support (Libvirt)

2021-06-24 Thread huangy81
From: Hyman Huang(黄勇) v3 - rebase master and fix the confilict when apply "conf: introduce dirty_ring_size in struct "_virDomainDef" to current master. v2 - split patchset into 4 patches - leave out the tcg case when building commandline. - handle the VIR_DOMAIN_KVM_DIRTY_RING case

[PATCH v3 2/4] qemu_command: switch accelerator option to new style

2021-06-24 Thread huangy81
From: Hyman Huang(黄勇) QEMU greater than 2.9.0 support '-accel' option, change the way of assembling commandline from "accel=kvm" to "-accel kvm" when specifying accelerator. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_command.c| 31 +-

[PATCH v3 3/4] conf: introduce dirty_ring_size in struct "_virDomainDef"

2021-06-24 Thread huangy81
From: Hyman Huang(黄勇) introduce dirty_ring_size to hold the ring size configured by user, and pass dirty_ring_size when building qemu commandline if dirty ring feature enabled. Signed-off-by: Hyman Huang(黄勇) --- src/conf/domain_conf.c | 74 -

[PATCH] qemu: code protection for qemuBlockJobEventProcessLegacy

2021-07-01 Thread huangy81
From: Chongyun Wu pointer disk might be null in some special cases or new usage scenarios, therefore code protection is needed to prevent segment faults. Signed-off-by: Chongyun Wu --- src/qemu/qemu_blockjob.c | 43 --- 1 file changed, 24 insertions(+),

[PATCH v7 0/2] Dirty Ring support (Libvirt)

2021-11-23 Thread huangy81
From: "Hyman Huang(黄勇)" v7 - rebase on master - modify the following points according to the advice given by Peter 1. skip the -accel switch and reuse the existing commit d20ebdda2 'qemu: Switch to -accel' 2. remove the post-parse function and do the parse work in

[PATCH v7 1/2] qemu: support dirty ring feature

2021-11-23 Thread huangy81
From: Hyman Huang(黄勇) Dirty ring feature was introduced in qemu-6.1.0, this patch add the corresponding feature named 'dirty-ring', which enable dirty ring feature when starting vm. To implement the dirty-ring feature, dirty_ring_size in struct "_virDomainDef" is introduced to hold the dirty

[PATCH v7 2/2] tests: add test for kvm-dirty-ring feature

2021-11-23 Thread huangy81
From: Hyman Huang(黄勇) Update the KVM feature tests for dirty ring. Signed-off-by: Hyman Huang(黄勇) --- tests/qemuxml2argvdata/kvm-features-off.xml | 1 + tests/qemuxml2argvdata/kvm-features.args | 2 +- tests/qemuxml2argvdata/kvm-features.xml | 1 +

[PATCH v6 2/4] qemu_command: switch accelerator option to new style

2021-11-20 Thread huangy81
From: Hyman Huang(黄勇) QEMU greater than 2.9.0 support '-accel' option, change the way of assembling commandline from "accel=kvm" to "-accel kvm" when specifying accelerator. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_command.c | 31 ++-

[PATCH v6 3/4] conf: introduce dirty_ring_size field

2021-11-20 Thread huangy81
From: Hyman Huang(黄勇) introduce dirty_ring_size in struct "_virDomainDef" to hold the ring size configured by user, and pass dirty_ring_size when building qemu commandline if dirty ring feature enabled. Signed-off-by: Hyman Huang(黄勇) --- src/conf/domain_conf.c | 76

[PATCH v6 1/4] qemu_capabilities: introduce QEMU_CAPS_ACCEL

2021-11-20 Thread huangy81
From: Hyman Huang(黄勇) since the "-machine" option for accelerators is legacy, "-accel" option may be a better mechanism. following are details: https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f7385...@redhat.com/ this patch introduce QEMU_CAPS_ACCEL capability to tell if we're

[PATCH v6 4/4] qemu: support dirty ring feature

2021-11-20 Thread huangy81
From: Hyman Huang(黄勇) dirty ring feature was introduced in qemu-6.1, this patch add corresponding feature named 'dirty-ring', which enable dirty ring feature when starting vm. to enable the feature, libvirt add "-accel dirty-ring-size=xxx" to QEMU command line, the following XML needs to be

[PATCH v6 0/4] Dirty Ring support (Libvirt)

2021-11-20 Thread huangy81
From: "Hyman Huang(黄勇)" Ping for this series. I still keep thinking the dirty ring feature is something good to have for libvirt. qemu-6.1 has supported dirty ring feature and followed up with the commit 0e21bf24 "support dirtyrate at the granualrity of vcpu", which is a typical usage scenario

[PATCH] Fix missing-field-initializers error

2022-01-12 Thread huangy81
From: Hyman Huang(黄勇) When compile libvirt via ninja tool with default configuration, it report the error message as the following: "missing initializer for field 'path' of 'virTPMBinaryInfo'". So initialize the 'path' field in 'virTPMBinaryInfo' with 'NULL'. Signed-off-by: Hyman Huang(黄勇) ---

[PATCH] NEWS: Document domain dirty page rate calculation APIs

2022-02-21 Thread huangy81
From: Hyman Huang(黄勇) The Libvirt API virDomainStartDirtyRateCalc was extended. Document this change. Signed-off-by: Hyman Huang(黄勇) --- NEWS.rst | 14 ++ 1 file changed, 14 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index f545325..b684416 100644 --- a/NEWS.rst +++ b/NEWS.rst

[PATCH v6 4/8] include: Introduce virDomainDirtyRateCalcFlags

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) Introduce virDomainDirtyRateCalcFlags to get ready for adding mode parameter to qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 13 + 1 file changed, 13 insertions(+) diff --git

[PATCH v6 3/8] qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) mode option of calc-dirty-rate command since qemu >=6.2.0. Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v6 7/8] virsh: Add mode option to domdirtyrate-calc virsh api

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) Extend domdirtyrate-calc virsh api with mode option, either of these three options "page-sampling,dirty-bitmap,dirty-ring" can be specified when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- docs/manpages/virsh.rst| 7 +--

[PATCH v6 0/8] support mode option for dirtyrate calculation

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) v6: - rebase on mastr - drop the commit [PATCH v5 1/9] in this patchset, post an extra commit if needed in the future. Please review, thanks ! Regards Yong v5: - [PATCH v5 9/9]: Fix alignment error in qemuDomainGetStatsDirtyRate. v4: - Rebase the master - [PATCH v4

[PATCH v6 2/8] qemu_driver: Probe capability before calculating dirty page rate

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance in case of failure when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c

[PATCH v6 5/8] qemu_driver: Add mode parameter to qemuDomainStartDirtyRateCalc

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) Add mode parameter to qemuDomainStartDirtyRateCalc API, 'mode' option of 'calc-dirty-rate' command was introduced since qemu >= 6.2. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 3 ++- src/qemu/qemu_monitor.c | 5 +++-- src/qemu/qemu_monitor.h

[PATCH v6 8/8] qemu_driver: Add calc_mode for dirtyrate statistics

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) Add calc_mode for dirtyrate statistics retured by virsh domstats --dirtyrate api, also add vcpu dirtyrate if dirty-ring mode was used in last measurement. Signed-off-by: Hyman Huang(黄勇) --- src/libvirt-domain.c | 6 + src/qemu/qemu_driver.c | 22

[PATCH v6 6/8] qemu_driver: Extend flags parameter of virDomainStartDirtyRateCalc

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) Extend flags parameter of virDomainStartDirtyRateCalc as a superset of virDomainDirtyRateCalcFlags, parse the flags and handle it correspondingly in qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 23 ++- 1

[PATCH v6 1/8] qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability

2022-02-20 Thread huangy81
From: Hyman Huang(黄勇) calc-dirty-rate command was introduced since qemu >=5.2.0. Introduce QEMU_CAPS_CALC_DIRTY_RATE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v4 9/9] qemu_driver: Add calc_mode for dirtyrate statistics

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Add calc_mode for dirtyrate statistics retured by virsh domstats --dirtyrate api, also add vcpu dirtyrate if dirty-ring mode was used in last measurement. Signed-off-by: Hyman Huang(黄勇) --- src/libvirt-domain.c | 6 + src/qemu/qemu_driver.c | 22

[PATCH v4 2/9] qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) calc-dirty-rate command was introduced since qemu >=5.2.0. Introduce QEMU_CAPS_CALC_DIRTY_RATE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v4 6/9] qemu_driver: Add mode parameter to qemuDomainStartDirtyRateCalc

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Add mode parameter to qemuDomainStartDirtyRateCalc API, 'mode' option of 'calc-dirty-rate' command was introduced since qemu >= 6.2. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 3 ++- src/qemu/qemu_monitor.c | 5 +++-- src/qemu/qemu_monitor.h

[PATCH v4 8/9] virsh: Add mode option to domdirtyrate-calc virsh api

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Extend domdirtyrate-calc virsh api with mode option, either of these three options "page-sampling,dirty-bitmap,dirty-ring" can be specified when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- docs/manpages/virsh.rst| 7 +--

[PATCH v4 0/9] support mode option for dirtyrate calculation

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) v4: - Rebase the master - [PATCH v4 1/9]: Refactor dirty page rate calculation status implementation, display calc_status as string when 'virsh domstats --dirtyrate' api return. - [PATCH v4 3/9]: Adjust the 'cap check' block before

[PATCH v4 1/9] qemu: Refactor dirty page rate calculation status implementation

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) For any virTypedParameter API normal practice is to use a string to expose the data, not the rather enum integer value. So let's drop the virDomainDirtyRateStatus in public header file and introduce internal enum def qemuMonitorDirtyRateStatus to describe the dirty page

[PATCH v4 4/9] qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) mode option of calc-dirty-rate command since qemu >=6.2.0. Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v4 5/9] include: Introduce virDomainDirtyRateCalcFlags

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Introduce virDomainDirtyRateCalcFlags to get ready for adding mode parameter to qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 13 + 1 file changed, 13 insertions(+) diff --git

[PATCH v4 3/9] qemu_driver: Probe capability before calculating dirty page rate

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance in case of failure when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c

[PATCH v4 7/9] qemu_driver: Extend flags parameter of virDomainStartDirtyRateCalc

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Extend flags parameter of virDomainStartDirtyRateCalc as a superset of virDomainDirtyRateCalcFlags, parse the flags and handle it correspondingly in qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 23 ++- 1

[PATCH v5 1/9] qemu: Refactor dirty page rate calculation status implementation

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) For any virTypedParameter API normal practice is to use a string to expose the data, not the rather enum integer value. So let's drop the virDomainDirtyRateStatus in public header file and introduce internal enum def qemuMonitorDirtyRateStatus to describe the dirty page

[PATCH v5 0/9] support mode option for dirtyrate calculation

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) v5: - [PATCH v5 9/9]: Fix alignment error in qemuDomainGetStatsDirtyRate. v4: - Rebase the master - [PATCH v4 1/9]: Refactor dirty page rate calculation status implementation, display calc_status as string when 'virsh domstats

[PATCH v5 5/9] include: Introduce virDomainDirtyRateCalcFlags

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Introduce virDomainDirtyRateCalcFlags to get ready for adding mode parameter to qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 13 + 1 file changed, 13 insertions(+) diff --git

[PATCH v5 6/9] qemu_driver: Add mode parameter to qemuDomainStartDirtyRateCalc

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Add mode parameter to qemuDomainStartDirtyRateCalc API, 'mode' option of 'calc-dirty-rate' command was introduced since qemu >= 6.2. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 3 ++- src/qemu/qemu_monitor.c | 5 +++-- src/qemu/qemu_monitor.h

[PATCH v5 8/9] virsh: Add mode option to domdirtyrate-calc virsh api

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Extend domdirtyrate-calc virsh api with mode option, either of these three options "page-sampling,dirty-bitmap,dirty-ring" can be specified when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- docs/manpages/virsh.rst| 7 +--

[PATCH v5 2/9] qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) calc-dirty-rate command was introduced since qemu >=5.2.0. Introduce QEMU_CAPS_CALC_DIRTY_RATE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v5 7/9] qemu_driver: Extend flags parameter of virDomainStartDirtyRateCalc

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Extend flags parameter of virDomainStartDirtyRateCalc as a superset of virDomainDirtyRateCalcFlags, parse the flags and handle it correspondingly in qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 23 ++- 1

[PATCH v5 4/9] qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) mode option of calc-dirty-rate command since qemu >=6.2.0. Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v5 9/9] qemu_driver: Add calc_mode for dirtyrate statistics

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Add calc_mode for dirtyrate statistics retured by virsh domstats --dirtyrate api, also add vcpu dirtyrate if dirty-ring mode was used in last measurement. Signed-off-by: Hyman Huang(黄勇) --- src/libvirt-domain.c | 6 + src/qemu/qemu_driver.c | 22

[PATCH v5 3/9] qemu_driver: Probe capability before calculating dirty page rate

2022-02-15 Thread huangy81
From: Hyman Huang(黄勇) Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance in case of failure when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c

[PATCH v3 1/7] qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability

2022-01-27 Thread huangy81
From: Hyman Huang(黄勇) calc-dirty-rate command was introduced since qemu >=5.2.0. Introduce QEMU_CAPS_CALC_DIRTY_RATE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v3 4/7] include: Introduce enum for qemuDomainStartDirtyRateCalc

2022-01-27 Thread huangy81
From: Hyman Huang(黄勇) Introduce virDomainDirtyRateCalcFlags and virDomainDirtyRateCalcMode to get ready for adding mode parameter to qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 24 1 file changed, 24

[PATCH v3 3/7] qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability

2022-01-27 Thread huangy81
From: Hyman Huang(黄勇) mode option of calc-dirty-rate command since qemu >=6.2.0. Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v3 6/7] virsh: Add mode option to domdirtyrate-calc virsh api

2022-01-27 Thread huangy81
From: Hyman Huang(黄勇) Extend domdirtyrate-calc virsh api with mode option, either of these three options "page-sampling,dirty-bitmap,dirty-ring" can be specified when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- docs/manpages/virsh.rst | 7 +-- src/libvirt-domain.c

[PATCH v3 7/7] qemu_driver: Add calc_mode for dirtyrate statistics

2022-01-27 Thread huangy81
From: Hyman Huang(黄勇) Add calc_mode for dirtyrate statistics retured by virsh domstats --dirtyrate api, also add vcpu dirtyrate if dirty-ring mode was used in last measurement. Signed-off-by: Hyman Huang(黄勇) --- src/libvirt-domain.c | 5 + src/qemu/qemu_driver.c | 14

[PATCH v3 5/7] qemu_driver: Add mode parameter to qemuDomainStartDirtyRateCalc

2022-01-27 Thread huangy81
From: Hyman Huang(黄勇) Add mode parameter to qemuDomainStartDirtyRateCalc API, 'mode' option of 'calc-dirty-rate' command was introduced since qemu >= 6.2. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 4 +++- src/qemu/qemu_monitor.c | 5 +++--

[PATCH v3 0/7] support mode option for dirtyrate calculation

2022-01-27 Thread huangy81
From: Hyman Huang(黄勇) v3: - Rebase the master - [PATCH v2 2/6]: Fix the usage of virQEMUCapsGet - [PATCH v2 4/6]: Fix the cleanup missed in qemuDomainStartDirtyRateCalc - [PATCH v2 4/6]: Move all blocks below ACL check - [PATCH v2 4/6]: Make the qemuMonitorJSONStartDirtyRateCalc cleaner by

[PATCH v3 2/7] qemu_driver: Probe capability before calculating dirty page rate

2022-01-27 Thread huangy81
From: Hyman Huang(黄勇) Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance in case of failure when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_driver.c

[PATCH v2 1/6] qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) calc-dirty-rate command was introduced since qemu >=5.2.0. Introduce QEMU_CAPS_CALC_DIRTY_RATE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v2 6/6] qemu_driver: Add calc_mode for dirtyrate statistics

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) Add calc_mode for dirtyrate statistics retured by virsh domstats --dirtyrate api, also add vcpu dirtyrate if dirty-ring mode was used in last measurement. Signed-off-by: Hyman Huang(黄勇) --- src/libvirt-domain.c | 5 + src/qemu/qemu_driver.c | 14

[PATCH v2 4/6] qemu_driver: Add mode option for qemuDomainStartDirtyRateCalc

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) Add mode option to extend qemuDomainStartDirtyRateCalc API, which is introduced since qemu >= 6.2. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 13 + src/qemu/qemu_driver.c | 33 +++--

[PATCH v2 0/6] support mode option for dirtyrate calculation

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) v2: Rebase master and fix confilicts with commit "Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_PREALLOC" Thanks ! v1: This patchset introduce mode option as the supplement of qemuDomainStartDirtyRateCalc api, add calc_mode for dirtyrate statistics correspondingly. Qemu add

[PATCH v2 5/6] virsh: Extend domdirtyrate-calc virsh api

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) Extend domdirtyrate-calc virsh api with mode option, either of these three options "page-sampling,dirty-bitmap,dirty-ring" can be specified when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- docs/manpages/virsh.rst | 7 +-- src/libvirt-domain.c

[PATCH v2 2/6] qemu_driver: Probe capability before calculating dirty page rate

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance in case of failure when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 12 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_driver.c

[PATCH v2 3/6] qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) mode option of calc-dirty-rate command since qemu >=6.2.0. Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v1 4/6] qemu_driver: Add mode option for qemuDomainStartDirtyRateCalc

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) Add mode option to extend qemuDomainStartDirtyRateCalc API, which is introduced since qemu >= 6.2. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 13 + src/qemu/qemu_driver.c | 33 +++--

[PATCH v1 1/6] qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) calc-dirty-rate command was introduced since qemu >=5.2.0. Introduce QEMU_CAPS_CALC_DIRTY_RATE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v1 3/6] qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) mode option of calc-dirty-rate command since qemu >=6.2.0. Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[PATCH v1 6/6] qemu_driver: Add calc_mode for dirtyrate statistics

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) Add calc_mode for dirtyrate statistics retured by virsh domstats --dirtyrate api, also add vcpu dirtyrate if dirty-ring mode was used in last measurement. Signed-off-by: Hyman Huang(黄勇) --- src/libvirt-domain.c | 5 + src/qemu/qemu_driver.c | 14

[PATCH v1 5/6] virsh: Extend domdirtyrate-calc virsh api

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) Extend domdirtyrate-calc virsh api with mode option, either of these three options "page-sampling,dirty-bitmap,dirty-ring" can be specified when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- docs/manpages/virsh.rst | 7 +-- src/libvirt-domain.c

[PATCH v1 2/6] qemu_driver: Probe capability before calculating dirty page rate

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance in case of failure when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 12 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_driver.c

[PATCH v1 0/6] support mode option for dirtyrate calculation

2022-01-26 Thread huangy81
From: Hyman Huang(黄勇) v1: This patchset introduce mode option as the supplement of qemuDomainStartDirtyRateCalc api, add calc_mode for dirtyrate statistics correspondingly. Qemu add mode parameter for calc-dirty-rate command since >= 6.2.0, either of these three mode "page-sampling,

[PATCH v1 06/10] qemu_driver: Extend qemuDomainGetVcpus for dirtylimit

2022-08-26 Thread huangy81
From: Hyman Huang(黄勇) Extend qemuDomainGetVcpus for getting dirtylimit info so that 'virsh vcpuinfo' api can display vcpu dirty page rate limit. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 2 ++ src/qemu/qemu_driver.c | 62

[PATCH v1 03/10] qemu_driver: Implement qemuDomainSetVcpuDirtyLimit

2022-08-26 Thread huangy81
From: Hyman Huang(黄勇) Implement qemuDomainSetVcpuDirtyLimit which set dirty page rate limit. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 47 src/qemu/qemu_monitor.c | 13 src/qemu/qemu_monitor.h | 5

[PATCH v1 10/10] virsh: Add cancel option to vcpudirtylimit api

2022-08-26 Thread huangy81
From: Hyman Huang(黄勇) Add cancel option to vcpudirtylimit api to cancel dirty page rate limit for virtual CPUs. Signed-off-by: Hyman Huang(黄勇) --- tools/virsh-domain.c | 64 1 file changed, 44 insertions(+), 20 deletions(-) diff --git

[PATCH v1 07/10] virsh: Extend vcpuinfo api to display dirtylimit info

2022-08-26 Thread huangy81
From: Hyman Huang(黄勇) Extend vcpuinfo api so that 'virsh vcpuinfo domain' can display dirtylimit info for active virtual cpu, which can be set by using 'virsh vcpudirtylimit'. Signed-off-by: Hyman Huang(黄勇) --- src/remote/remote_daemon_dispatch.c | 2 ++ src/remote/remote_driver.c |

[PATCH v1 02/10] libvirt: Add virDomainSetVcpuDirtyLimit API

2022-08-26 Thread huangy81
From: Hyman Huang(黄勇) Introduce virDomainSetVcpuDirtyLimit API to set upper limit of dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 16 + src/driver-hypervisor.h | 7 ++ src/libvirt-domain.c | 51

[PATCH v1 08/10] libvirt: Add virDomainCancelVcpuDirtyLimit API

2022-08-26 Thread huangy81
From: Hyman Huang(黄勇) Introduce virDomainCancelVcpuDirtyLimit API to cancel upper limit of dirty page rate. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 4 src/driver-hypervisor.h | 6 ++ src/libvirt-domain.c | 43

[PATCH v1 09/10] qemu_driver: Implement qemuDomainCancelVcpuDirtyLimit

2022-08-26 Thread huangy81
From: Hyman Huang(黄勇) Implement qemuDomainCancelVcpuDirtyLimit to cancel vcpu dirty page rate limit. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 47 src/qemu/qemu_monitor.c | 11 +++ src/qemu/qemu_monitor.h |

[PATCH v1 01/10] qemu_capabilities: Introduce QEMU_CAPS_VCPU_DIRTY_LIMIT capability

2022-08-26 Thread huangy81
From: Hyman Huang(黄勇) set-vcpu-dirty-limit/cancel-vcpu-dirty-limit/query-vcpu-dirty-limit were introduced since qemu >=7.1.0. Introduce corresponding capability. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h

  1   2   >