mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Remove path argument from qemuMonitorJSONFindLinkPath
All the callers use "/" anyway.
This commit is contained in:
parent
5aca919b6c
commit
c09e1729df
@ -1085,8 +1085,7 @@ qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options)
|
|||||||
* NOTE: This assumes we have already called qemuDomainObjEnterMonitor()
|
* NOTE: This assumes we have already called qemuDomainObjEnterMonitor()
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon,
|
qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon)
|
||||||
const char *curpath)
|
|
||||||
{
|
{
|
||||||
ssize_t i, nprops = 0;
|
ssize_t i, nprops = 0;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@ -1111,7 +1110,7 @@ qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorJSONFindLinkPath(mon, curpath, "virtio-balloon-pci", &path) < 0)
|
if (qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-pci", &path) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
nprops = qemuMonitorJSONGetObjectListPaths(mon, path, &bprops);
|
nprops = qemuMonitorJSONGetObjectListPaths(mon, path, &bprops);
|
||||||
@ -1160,7 +1159,7 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon,
|
|||||||
QEMU_CHECK_MONITOR(mon);
|
QEMU_CHECK_MONITOR(mon);
|
||||||
|
|
||||||
if (mon->json) {
|
if (mon->json) {
|
||||||
ret = qemuMonitorJSONFindLinkPath(mon, "/", videoName, &path);
|
ret = qemuMonitorJSONFindLinkPath(mon, videoName, &path);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ret == -2)
|
if (ret == -2)
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -1643,7 +1642,7 @@ qemuMonitorGetMemoryStats(qemuMonitorPtr mon,
|
|||||||
QEMU_CHECK_MONITOR(mon);
|
QEMU_CHECK_MONITOR(mon);
|
||||||
|
|
||||||
if (mon->json) {
|
if (mon->json) {
|
||||||
ignore_value(qemuMonitorFindBalloonObjectPath(mon, "/"));
|
ignore_value(qemuMonitorFindBalloonObjectPath(mon));
|
||||||
mon->ballooninit = true;
|
mon->ballooninit = true;
|
||||||
return qemuMonitorJSONGetMemoryStats(mon, mon->balloonpath,
|
return qemuMonitorJSONGetMemoryStats(mon, mon->balloonpath,
|
||||||
stats, nr_stats);
|
stats, nr_stats);
|
||||||
@ -1676,7 +1675,7 @@ qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon,
|
|||||||
if (period < 0)
|
if (period < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuMonitorFindBalloonObjectPath(mon, "/") == 0) {
|
if (qemuMonitorFindBalloonObjectPath(mon) == 0) {
|
||||||
ret = qemuMonitorJSONSetMemoryStatsPeriod(mon, mon->balloonpath,
|
ret = qemuMonitorJSONSetMemoryStatsPeriod(mon, mon->balloonpath,
|
||||||
period);
|
period);
|
||||||
|
|
||||||
|
@ -6721,7 +6721,6 @@ qemuMonitorJSONFindObjectPath(qemuMonitorPtr mon,
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
|
qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
|
||||||
const char *curpath,
|
|
||||||
const char *name,
|
const char *name,
|
||||||
char **path)
|
char **path)
|
||||||
{
|
{
|
||||||
@ -6731,7 +6730,7 @@ qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
|
|||||||
if (virAsprintf(&linkname, "link<%s>", name) < 0)
|
if (virAsprintf(&linkname, "link<%s>", name) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ret = qemuMonitorJSONFindObjectPath(mon, curpath, linkname, path);
|
ret = qemuMonitorJSONFindObjectPath(mon, "/", linkname, path);
|
||||||
VIR_FREE(linkname);
|
VIR_FREE(linkname);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -483,8 +483,7 @@ int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
|
|||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
|
int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
|
||||||
const char *curpath,
|
|
||||||
const char *name,
|
const char *name,
|
||||||
char **path)
|
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 */
|
#endif /* QEMU_MONITOR_JSON_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user