Re: [libvirt] [PATCH] domMemoryStats / qemu: Fix parsing of unknown stats

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

 



On Tue, Jan 12, 2010 at 11:04:31AM -0500, Adam Litke wrote:
> Fix a small problem with the qemu memory stats parsing algorithm.  If qemu
> reports a stat that libvirt does not recognize, skip past it so parsing can
> continue.  This corrects a potential infinite loop in the parsing code that can
> only be triggered if new statistics are added to qemu.
> 
> Signed-off-by: Adam Litke <agl@xxxxxxxxxx>
> ---
>  src/qemu/qemu_monitor_text.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
> index 5b9ced2..87cf972 100644
> --- a/src/qemu/qemu_monitor_text.c
> +++ b/src/qemu/qemu_monitor_text.c
> @@ -507,7 +507,11 @@ static int qemuMonitorParseExtraBalloonInfo(char *text,
>                              ",total_mem=", &stats[nr_stats_found]))
>              nr_stats_found++;
>  
> -        /* Skip to the next label */
> +        /* Skip to the next label.  When *p is ',' the last match attempt
> +         * failed so try to match the next ','.
> +         */
> +        if (*p == ',')
> +            p++;
>          p = strchr (p, ',');
>          if (!p) break;
>      }

  ACK, applied, thanks !

Daniel

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

--
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]