
On Wed, Jun 12, 2024 at 03:02:13 -0700, wucf@linux.ibm.com wrote:
From: Chun Feng Wu <wucf@linux.ibm.com>
* ThrottleGroup is updated through "qemuMonitorJSONUpdateThrottleGroup" * ThrottleGroup is retrieved through "qemuMonitorJSONGetThrottleGroup" * ThrottleGroup is deleted by reusing "qemuMonitorDelObject" * ThrottleGroup is added by reusing "qemuMonitorAddObject" * "qemuMonitorMakeThrottleGroupLimits" will be used by building qemu cmd as well
Signed-off-by: Chun Feng Wu <wucf@linux.ibm.com> --- src/qemu/qemu_monitor.c | 34 ++++++++ src/qemu/qemu_monitor.h | 14 ++++ src/qemu/qemu_monitor_json.c | 150 +++++++++++++++++++++++++++++++++++ src/qemu/qemu_monitor_json.h | 14 ++++ 4 files changed, 212 insertions(+)
[...]
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index c5e758e7f8..462b40cb6b 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4633,6 +4633,156 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon, return qemuMonitorJSONBlockIoThrottleInfo(devices, qdevid, reply); }
+ +int +qemuMonitorMakeThrottleGroupLimits(virJSONValue *limits, + const virDomainThrottleGroupDef *group) +{ + if (virJSONValueObjectAdd(&limits, + "P:bps-total", + group->total_bytes_sec,
Please format both the string and the value on a single line (disregarding any line length "suggestions"):
+ "P:bps-read", group->read_bytes_sec, + "P:bps-write", group->write_bytes_sec,
like that
+ "P:iops-total", + group->total_iops_sec, + "P:iops-read", + group->read_iops_sec, + "P:iops-write", + group->write_iops_sec, + "P:bps-total-max", + group->total_bytes_sec_max, + "P:bps-read-max", + group->read_bytes_sec_max,
Please note that I'll be on hollidays, so the rest of the review will be delayed.