[libvirt] [PATCH v2 0/1] qemu: monitor: Add memory balloon support for virtio-ccw

v2: * corrected historic spelling error in comment * added return code checking of the first qemuMonitorJSONFindLinkPath call to prevent the second call of qemuMonitorJSONFindLinkPath on "error bail out" return code. A comment on this version: I find that even so this version is technically more correct the simplicity and perceivability have suffered profoundly. I am not sure that after the recent rework by which the init function protects itself from being fully run a second time during a run of the domain it is necessary to prevent a single second call returning "error bail out". Boris Fiuczynski (1): qemu: monitor: Add memory balloon support for virtio-ccw src/qemu/qemu_monitor.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) -- 2.3.0

The search for the memory balloon driver object is extended by a second known name "virtio-balloon-ccw" in support for virtio-ccw. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Daniel Hansel <daniel.hansel@linux.vnet.ibm.com> Reviewed-by: Eric Farman <farman@linux.vnet.ibm.com> Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com> --- src/qemu/qemu_monitor.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 33600f0..6f2f4a9 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1069,9 +1069,9 @@ qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options) /** - * Search the qom objects for the balloon driver object by it's known name - * of "virtio-balloon-pci". The entry for the driver will be found by using - * function "qemuMonitorFindObjectPath". + * Search the qom objects for the balloon driver object by its known names + * of "virtio-balloon-pci" or "virtio-balloon-ccw". The entry for the driver + * will be found by using function "qemuMonitorJSONFindLinkPath". * * Once found, check the entry to ensure it has the correct property listed. * If it does not, then obtaining statistics from QEMU will not be possible. @@ -1081,6 +1081,7 @@ static void qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon) { ssize_t i, nprops = 0; + int flp_ret = 0; char *path = NULL; qemuMonitorJSONListPathPtr *bprops = NULL; @@ -1093,8 +1094,14 @@ qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon) } mon->ballooninit = true; - if (qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-pci", &path) < 0) + flp_ret = qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-pci", &path); + if (flp_ret == -2) { + /* pci object was not found retry search for ccw object */ + if (qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-ccw", &path) < 0) + return; + } else if (flp_ret < 0) { return; + } nprops = qemuMonitorJSONGetObjectListPaths(mon, path, &bprops); if (nprops < 0) -- 2.3.0

On Wed, Jun 10, 2015 at 09:02:36AM +0200, Boris Fiuczynski wrote:
The search for the memory balloon driver object is extended by a second known name "virtio-balloon-ccw" in support for virtio-ccw.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Daniel Hansel <daniel.hansel@linux.vnet.ibm.com> Reviewed-by: Eric Farman <farman@linux.vnet.ibm.com> Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com> --- src/qemu/qemu_monitor.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 33600f0..6f2f4a9 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1069,9 +1069,9 @@ qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options)
ACK and pushed. Jan
participants (2)
-
Boris Fiuczynski
-
Ján Tomko