mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Fix memory reporting for inactive domains in the qemu driver.
Currently, 'info' will always report that mem = max mem. Make sure we actually return the correct mem value.
This commit is contained in:
parent
5ea25b7801
commit
387935345c
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jun 22 12:33:37 EDT 2009 Cole Robinson <crobinso@redhat.com>
|
||||||
|
|
||||||
|
* src/qemu_driver.c: Fix memory reporting for inactive domains
|
||||||
|
in the qemu driver.
|
||||||
|
|
||||||
|
Currently, 'info' will always report that mem = max mem. Make sure we
|
||||||
|
actually return the correct mem value.
|
||||||
|
|
||||||
Mon Jun 22 12:31:38 EDT 2009 Cole Robinson <crobinso@redhat.com>
|
Mon Jun 22 12:31:38 EDT 2009 Cole Robinson <crobinso@redhat.com>
|
||||||
|
|
||||||
* src/storage_backend_fs.c src/storage_driver.c:
|
* src/storage_backend_fs.c src/storage_driver.c:
|
||||||
|
@ -2553,16 +2553,22 @@ static int qemudDomainGetInfo(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = qemudDomainGetMemoryBalloon(dom->conn, vm, &balloon);
|
|
||||||
if (err < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
info->maxMem = vm->def->maxmem;
|
info->maxMem = vm->def->maxmem;
|
||||||
if (err == 0)
|
|
||||||
/* Balloon not supported, so maxmem is always the allocation */
|
if (virDomainIsActive(vm)) {
|
||||||
info->memory = vm->def->maxmem;
|
err = qemudDomainGetMemoryBalloon(dom->conn, vm, &balloon);
|
||||||
else
|
if (err < 0)
|
||||||
info->memory = balloon;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (err == 0)
|
||||||
|
/* Balloon not supported, so maxmem is always the allocation */
|
||||||
|
info->memory = vm->def->maxmem;
|
||||||
|
else
|
||||||
|
info->memory = balloon;
|
||||||
|
} else {
|
||||||
|
info->memory = vm->def->memory;
|
||||||
|
}
|
||||||
|
|
||||||
info->nrVirtCpu = vm->def->vcpus;
|
info->nrVirtCpu = vm->def->vcpus;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user