mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
Only call qemuMonitorGetMemoryStats for virtio memballoon
There is nothing to get from the monitor for model='none'.
This commit is contained in:
parent
4bfc58b58d
commit
09ebc10fe1
@ -11599,14 +11599,19 @@ qemuDomainMemoryStats(virDomainPtr dom,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
priv = vm->privateData;
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
ret = qemuMonitorGetMemoryStats(priv->mon, stats, nr_stats);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
ret = -1;
|
||||
if (vm->def->memballoon &&
|
||||
vm->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO) {
|
||||
priv = vm->privateData;
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
ret = qemuMonitorGetMemoryStats(priv->mon, stats, nr_stats);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (ret < 0 || ret >= nr_stats)
|
||||
goto endjob;
|
||||
if (ret < 0 || ret >= nr_stats)
|
||||
goto endjob;
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
if (qemuGetProcessInfo(NULL, NULL, &rss, vm->pid, 0) < 0) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
|
Loading…
Reference in New Issue
Block a user