mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 18:15:25 +00:00
qemu: driver: Reuse qemuDomainGetMonitor in qemuDomainMemoryStats
This commit is contained in:
parent
d6cb0d256a
commit
c0e962b6f3
@ -11473,7 +11473,6 @@ qemuDomainMemoryStats(virDomainPtr dom,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||||
qemuDomainObjPrivatePtr priv;
|
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
long rss;
|
long rss;
|
||||||
@ -11497,9 +11496,8 @@ qemuDomainMemoryStats(virDomainPtr dom,
|
|||||||
|
|
||||||
if (vm->def->memballoon &&
|
if (vm->def->memballoon &&
|
||||||
vm->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO) {
|
vm->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO) {
|
||||||
priv = vm->privateData;
|
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
ret = qemuMonitorGetMemoryStats(priv->mon, stats, nr_stats);
|
ret = qemuMonitorGetMemoryStats(qemuDomainGetMonitor(vm), stats, nr_stats);
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user