mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 19:45:21 +00:00
virresctrl: Fix updating the mask for a cache resource
In 'virResctrlAllocUpdateMask', mask is updated only if 'previous mask' is NULL.
By default, the bitmask for a cache resource for a VM is initialized with
'default-resctrl-group' bitmask. So the 'previous mask' would not be NULL and
mask won't get updated if cachetune is configured for a VM. This causes libvirt
to use same bitmask as 'default-resctrl-group' bitmask for a cache resource for
a VM. This patch fixes the issue.
Fixes: d8a354954a
Signed-off-by: Vinayak Kale <vkale@nvidia.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
6bda1eb157
commit
a9c7da6126
@ -1104,7 +1104,9 @@ virResctrlAllocUpdateMask(virResctrlAlloc *alloc,
|
||||
VIR_EXPAND_N(a_type->masks, a_type->nmasks,
|
||||
cache - a_type->nmasks + 1);
|
||||
|
||||
if (!a_type->masks[cache])
|
||||
if (a_type->masks[cache])
|
||||
virBitmapFree(a_type->masks[cache]);
|
||||
|
||||
a_type->masks[cache] = virBitmapNewCopy(mask);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user