[libvirt] [PATCH 01/11] qemu: monitor: Remove 'supportMaxOptions' argument from qemuMonitorGetBlockIoThrottle

Peter Krempa pkrempa at redhat.com
Wed May 25 13:03:59 UTC 2016


The caller is already aware that the params are missing and the
extractor is ignoring the missing ones so the parameter isn't necessary.
---
 src/qemu/qemu_driver.c       |  2 +-
 src/qemu/qemu_monitor.c      |  5 ++---
 src/qemu/qemu_monitor.h      |  3 +--
 src/qemu/qemu_monitor_json.c | 24 ++++++++++--------------
 src/qemu/qemu_monitor_json.h |  3 +--
 tests/qemumonitorjsontest.c  |  2 +-
 6 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ec2742c..af42c8d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17852,7 +17852,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
         if (!(device = qemuAliasFromDisk(disk)))
             goto endjob;
         qemuDomainObjEnterMonitor(driver, vm);
-        ret = qemuMonitorGetBlockIoThrottle(priv->mon, device, &reply, supportMaxOptions);
+        ret = qemuMonitorGetBlockIoThrottle(priv->mon, device, &reply);
         if (qemuDomainObjExitMonitor(driver, vm) < 0)
             goto endjob;
         if (ret < 0)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index a0060cc..597307f 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3126,15 +3126,14 @@ qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon,
 int
 qemuMonitorGetBlockIoThrottle(qemuMonitorPtr mon,
                               const char *device,
-                              virDomainBlockIoTuneInfoPtr reply,
-                              bool supportMaxOptions)
+                              virDomainBlockIoTuneInfoPtr reply)
 {
     VIR_DEBUG("device=%p, reply=%p", device, reply);

     QEMU_CHECK_MONITOR(mon);

     if (mon->json)
-        return qemuMonitorJSONGetBlockIoThrottle(mon, device, reply, supportMaxOptions);
+        return qemuMonitorJSONGetBlockIoThrottle(mon, device, reply);
     else
         return qemuMonitorTextGetBlockIoThrottle(mon, device, reply);
 }
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index a1cbc94..dd3587f 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -804,8 +804,7 @@ int qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon,

 int qemuMonitorGetBlockIoThrottle(qemuMonitorPtr mon,
                                   const char *device,
-                                  virDomainBlockIoTuneInfoPtr reply,
-                                  bool supportMaxOptions);
+                                  virDomainBlockIoTuneInfoPtr reply);

 int qemuMonitorSystemWakeup(qemuMonitorPtr mon);

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 0508fe6..64827c3 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -4499,8 +4499,7 @@ int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
 static int
 qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
                                    const char *device,
-                                   virDomainBlockIoTuneInfoPtr reply,
-                                   bool supportMaxOptions)
+                                   virDomainBlockIoTuneInfoPtr reply)
 {
     virJSONValuePtr io_throttle;
     int ret = -1;
@@ -4549,15 +4548,13 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
         GET_THROTTLE_STATS("iops", total_iops_sec);
         GET_THROTTLE_STATS("iops_rd", read_iops_sec);
         GET_THROTTLE_STATS("iops_wr", write_iops_sec);
-        if (supportMaxOptions) {
-            GET_THROTTLE_STATS_OPTIONAL("bps_max", total_bytes_sec_max);
-            GET_THROTTLE_STATS_OPTIONAL("bps_rd_max", read_bytes_sec_max);
-            GET_THROTTLE_STATS_OPTIONAL("bps_wr_max", write_bytes_sec_max);
-            GET_THROTTLE_STATS_OPTIONAL("iops_max", total_iops_sec_max);
-            GET_THROTTLE_STATS_OPTIONAL("iops_rd_max", read_iops_sec_max);
-            GET_THROTTLE_STATS_OPTIONAL("iops_wr_max", write_iops_sec_max);
-            GET_THROTTLE_STATS_OPTIONAL("iops_size", size_iops_sec);
-        }
+        GET_THROTTLE_STATS_OPTIONAL("bps_max", total_bytes_sec_max);
+        GET_THROTTLE_STATS_OPTIONAL("bps_rd_max", read_bytes_sec_max);
+        GET_THROTTLE_STATS_OPTIONAL("bps_wr_max", write_bytes_sec_max);
+        GET_THROTTLE_STATS_OPTIONAL("iops_max", total_iops_sec_max);
+        GET_THROTTLE_STATS_OPTIONAL("iops_rd_max", read_iops_sec_max);
+        GET_THROTTLE_STATS_OPTIONAL("iops_wr_max", write_iops_sec_max);
+        GET_THROTTLE_STATS_OPTIONAL("iops_size", size_iops_sec);

         break;
     }
@@ -4643,8 +4640,7 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon,

 int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
                                       const char *device,
-                                      virDomainBlockIoTuneInfoPtr reply,
-                                      bool supportMaxOptions)
+                                      virDomainBlockIoTuneInfoPtr reply)
 {
     int ret = -1;
     virJSONValuePtr cmd = NULL;
@@ -4670,7 +4666,7 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
         goto cleanup;
     }

-    ret = qemuMonitorJSONBlockIoThrottleInfo(result, device, reply, supportMaxOptions);
+    ret = qemuMonitorJSONBlockIoThrottleInfo(result, device, reply);
  cleanup:
     virJSONValueFree(cmd);
     virJSONValueFree(result);
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 95bba69..76758db 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -328,8 +328,7 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon,

 int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
                                       const char *device,
-                                      virDomainBlockIoTuneInfoPtr reply,
-                                      bool supportMaxOptions);
+                                      virDomainBlockIoTuneInfoPtr reply);

 int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon);

diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 87b1a8f..819f7ce 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1882,7 +1882,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(const void *data)
         goto cleanup;

     if (qemuMonitorJSONGetBlockIoThrottle(qemuMonitorTestGetMonitor(test),
-                                          "drive-virtio-disk0", &info, true) < 0)
+                                          "drive-virtio-disk0", &info) < 0)
         goto cleanup;

     if (memcmp(&info, &expectedInfo, sizeof(info)) != 0) {
-- 
2.8.2




More information about the libvir-list mailing list