From c09e1729dfbb47867676f8de99bd533f268aa1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 3 Jun 2015 12:58:17 +0200 Subject: [PATCH] Remove path argument from qemuMonitorJSONFindLinkPath All the callers use "/" anyway. --- src/qemu/qemu_monitor.c | 11 +++++------ src/qemu/qemu_monitor_json.c | 3 +-- src/qemu/qemu_monitor_json.h | 3 +-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 4a5e13c491..9add05c9da 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 6fafe81e55..13c57d2cc4 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 ab7cb28288..fb77930cd8 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -483,8 +483,7 @@ int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon, - const char *curpath, const char *name, char **path) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); #endif /* QEMU_MONITOR_JSON_H */ -- GitLab