mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
domMemoryStats / qemu: Fix parsing of unknown stats
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. * src/qemu/qemu_monitor_text.c: qemuMonitorParseExtraBalloonInfo add a skip for extra ','
This commit is contained in:
parent
2dccf5ef07
commit
80b4d20dfe
@ -507,7 +507,11 @@ static int qemuMonitorParseExtraBalloonInfo(char *text,
|
|||||||
",total_mem=", &stats[nr_stats_found]))
|
",total_mem=", &stats[nr_stats_found]))
|
||||||
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, ',');
|
p = strchr (p, ',');
|
||||||
if (!p) break;
|
if (!p) break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user