[libvirt] [PATCH] qemu: Adjust the cur_ballon on coldplug/unplug of dimms

Peter Krempa pkrempa at redhat.com
Wed Jul 27 11:19:53 UTC 2016


On Thu, Jul 21, 2016 at 15:39:30 +0530, Shivaprasad G Bhat wrote:
> The cur_balloon also increases/decreases with dimm hotplug/unplug.
> To be consistent, adjust the value for coldplug too. This was inconsistently
> taken care when cur_ballon != memory to begin with. The patch fixes it
> irrespective of that.
> 
> Signed-off-by: Shivaprasad G Bhat <sbhat at linux.vnet.ibm.com>
> ---
>  src/conf/domain_conf.c |    3 +--
>  src/qemu/qemu_driver.c |    3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 6dfcf81..8b0b790 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -14674,8 +14674,7 @@ virDomainMemoryRemove(virDomainDefPtr def,
>      VIR_DELETE_ELEMENT(def->mems, idx, def->nmems);
>  
>      /* fix up balloon size */
> -    if (def->mem.cur_balloon > virDomainDefGetMemoryTotal(def))
> -        def->mem.cur_balloon = virDomainDefGetMemoryTotal(def);

It will be better to move the balloon adjustment to the qemu driver
completely since the modification is done just there.

> +    def->mem.cur_balloon -= ret->size;
>  
>      /* fix total memory size of the domain */
>      virDomainDefSetMemoryTotal(def, memory - ret->size);

For the hotplug case we are fixing this by querying the balloon so no
adjustments are necessary there.

ACK with the change (I've already made it locally) and I'll push it in a
while.

Peter




More information about the libvir-list mailing list