[PATCH 03/10] Remove path argument from qemuMonitorJSONFindLinkPath

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All the callers use "/" anyway.
---
 src/qemu/qemu_monitor.c      | 11 +++++------
 src/qemu/qemu_monitor_json.c |  3 +--
 src/qemu/qemu_monitor_json.h |  1 -
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 4a5e13c..9add05c 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1085,8 +1085,7 @@ qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options)
  * NOTE: This assumes we have already called qemuDomainObjEnterMonitor()
  */
 static int
-qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon,
-                                 const char *curpath)
+qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon)
 {
     ssize_t i, nprops = 0;
     int ret = -1;
@@ -1111,7 +1110,7 @@ qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon,
         return -1;
     }
 
-    if (qemuMonitorJSONFindLinkPath(mon, curpath, "virtio-balloon-pci", &path) < 0)
+    if (qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-pci", &path) < 0)
         return -1;
 
     nprops = qemuMonitorJSONGetObjectListPaths(mon, path, &bprops);
@@ -1160,7 +1159,7 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon,
     QEMU_CHECK_MONITOR(mon);
 
     if (mon->json) {
-        ret = qemuMonitorJSONFindLinkPath(mon, "/", videoName, &path);
+        ret = qemuMonitorJSONFindLinkPath(mon, videoName, &path);
         if (ret < 0) {
             if (ret == -2)
                 virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -1643,7 +1642,7 @@ qemuMonitorGetMemoryStats(qemuMonitorPtr mon,
     QEMU_CHECK_MONITOR(mon);
 
     if (mon->json) {
-        ignore_value(qemuMonitorFindBalloonObjectPath(mon, "/"));
+        ignore_value(qemuMonitorFindBalloonObjectPath(mon));
         mon->ballooninit = true;
         return qemuMonitorJSONGetMemoryStats(mon, mon->balloonpath,
                                              stats, nr_stats);
@@ -1676,7 +1675,7 @@ qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon,
     if (period < 0)
         return -1;
 
-    if (qemuMonitorFindBalloonObjectPath(mon, "/") == 0) {
+    if (qemuMonitorFindBalloonObjectPath(mon) == 0) {
         ret = qemuMonitorJSONSetMemoryStatsPeriod(mon, mon->balloonpath,
                                                   period);
 
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 6fafe81..13c57d2 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6721,7 +6721,6 @@ qemuMonitorJSONFindObjectPath(qemuMonitorPtr mon,
  */
 int
 qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
-                            const char *curpath,
                             const char *name,
                             char **path)
 {
@@ -6731,7 +6730,7 @@ qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
     if (virAsprintf(&linkname, "link<%s>", name) < 0)
         return -1;
 
-    ret = qemuMonitorJSONFindObjectPath(mon, curpath, linkname, path);
+    ret = qemuMonitorJSONFindObjectPath(mon, "/", linkname, path);
     VIR_FREE(linkname);
     return ret;
 }
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 953266c..ae8ef7c 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -483,7 +483,6 @@ int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 
 int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
-                                const char *curpath,
                                 const char *name,
                                 char **path);
 #endif /* QEMU_MONITOR_JSON_H */
-- 
2.3.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]