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

Re: [libvirt] [PATCH] Update QEMU JSON balloon command handling



On Tue, Feb 16, 2010 at 04:32:34PM +0000, Daniel P. Berrange wrote:
> The QEMU JSON monitor changed balloon commands to return/accept
> bytes instead of kilobytes. Update libvirt to cope with this
> 
> * src/qemu/qemu_monitor_json.c: Expect/use bytes for ballooning
> ---
>  src/qemu/qemu_monitor_json.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index c20d063..4d52ad0 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -729,14 +729,14 @@ int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon,
>                  goto cleanup;
>              }
>  
> -            if (virJSONValueObjectGetNumberUlong(data, "balloon", &mem) < 0) {
> +            if (virJSONValueObjectGetNumberUlong(data, "actual", &mem) < 0) {
>                  qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                                  _("info balloon reply was missing balloon data"));

  shouldn't we also update the error message ?

>                  ret = -1;
>                  goto cleanup;
>              }
>  
> -            *currmem = mem;
> +            *currmem = (mem/1024);
>              ret = 1;
>          }
>      }
> @@ -891,7 +891,7 @@ int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
>  {
>      int ret;
>      virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon",
> -                                                     "U:value", (unsigned long long)newmem,
> +                                                     "U:value", ((unsigned long long)newmem)*1024,
>                                                       NULL);
>      virJSONValuePtr reply = NULL;
>      if (!cmd)

ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/


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