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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
> ---
>  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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]