mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25:24 +00:00
qemu: avoid calling the balloon info command if disabled
Basically a followup of the previous patch about balloon desactivation if desactivated, to not ask for balloon information to qemu as we will just get an error back. This can make a huge difference in the time needed for domain information or list when a machine is loaded, and balloon has been desactivated in the guests. * src/qemu/qemu_driver.c: do not get the balloon info if the balloon suppor is disabled
This commit is contained in:
parent
e26672f786
commit
986c208695
@ -4938,7 +4938,11 @@ static int qemudDomainGetInfo(virDomainPtr dom,
|
|||||||
|
|
||||||
if (virDomainObjIsActive(vm)) {
|
if (virDomainObjIsActive(vm)) {
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
if (!priv->jobActive) {
|
|
||||||
|
if ((vm->def->memballoon != NULL) &&
|
||||||
|
(vm->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_NONE)) {
|
||||||
|
info->memory = vm->def->maxmem;
|
||||||
|
} else if (!priv->jobActive) {
|
||||||
if (qemuDomainObjBeginJob(vm) < 0)
|
if (qemuDomainObjBeginJob(vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -6745,8 +6749,10 @@ static char *qemudDomainDumpXML(virDomainPtr dom,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Refresh current memory based on balloon info */
|
/* Refresh current memory based on balloon info if supported */
|
||||||
if (virDomainObjIsActive(vm)) {
|
if ((vm->def->memballoon != NULL) &&
|
||||||
|
(vm->def->memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_NONE) &&
|
||||||
|
(virDomainObjIsActive(vm))) {
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
/* Don't delay if someone's using the monitor, just use
|
/* Don't delay if someone's using the monitor, just use
|
||||||
* existing most recent data instead */
|
* existing most recent data instead */
|
||||||
|
Loading…
Reference in New Issue
Block a user