mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: Fix up balloon size after removing a memory device from def
To avoid having the ballooned memory size larger than the actual physical memory size, truncate the ballooned size if it overflows.
This commit is contained in:
parent
fccc2c3313
commit
de03b1ddde
@ -12988,6 +12988,11 @@ virDomainMemoryRemove(virDomainDefPtr def,
|
|||||||
{
|
{
|
||||||
virDomainMemoryDefPtr ret = def->mems[idx];
|
virDomainMemoryDefPtr ret = def->mems[idx];
|
||||||
VIR_DELETE_ELEMENT(def->mems, idx, def->nmems);
|
VIR_DELETE_ELEMENT(def->mems, idx, def->nmems);
|
||||||
|
|
||||||
|
/* fix up balloon size */
|
||||||
|
if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def))
|
||||||
|
def->mem.cur_balloon = virDomainDefGetMemoryActual(def);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user