qemu: driver: Reuse qemuDomainGetMonitor in qemuDomainMemoryStats

This commit is contained in:
Peter Krempa 2016-04-06 15:05:10 +02:00
parent d6cb0d256a
commit c0e962b6f3

View File

@ -11473,7 +11473,6 @@ qemuDomainMemoryStats(virDomainPtr dom,
unsigned int flags)
{
virQEMUDriverPtr driver = dom->conn->privateData;
qemuDomainObjPrivatePtr priv;
virDomainObjPtr vm;
int ret = -1;
long rss;
@ -11497,9 +11496,8 @@ qemuDomainMemoryStats(virDomainPtr dom,
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);
ret = qemuMonitorGetMemoryStats(qemuDomainGetMonitor(vm), stats, nr_stats);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;