[libvirt] [PATCH] virBitmapFree: Change the function to a macro
Ján Tomko
jtomko at redhat.com
Wed Sep 11 07:25:28 UTC 2013
On 09/11/2013 04:27 AM, Liuji (Jeremy) wrote:
> From: "Liuji (Jeremy)" <jeremy.liu at huawei.com>
> Date: Tue, 10 Sep 2013 22:13:32 -0400
> Subject: [PATCH] virDomainDefParseXML: set the argument of virBitmapFree to
> NULL after calling virBitmapFree
>
> After freeing the bitmap pointer, it must set the pointer to NULL.
> This will avoid any other use of the freed memory of the bitmap pointer.
>
> Signed-off-by: Liuji (Jeremy) <jeremy.liu at huawei.com>
> ---
> src/conf/domain_conf.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
ACK, I've added a link to bugzilla and pushed it:
https://bugzilla.redhat.com/show_bug.cgi?id=1006710
Jan
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index e3aec69..9d1e9fc 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -11220,8 +11220,10 @@ virDomainDefParseXML(xmlDocPtr xml,
> }
>
> /* Ignore 'nodeset' if 'placement' is 'auto' finally */
> - if (placement_mode == VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_AUTO)
> + if (placement_mode == VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_AUTO) {
> virBitmapFree(def->numatune.memory.nodemask);
> + def->numatune.memory.nodemask = NULL;
> + }
>
> /* Copy 'placement' of <numatune> to <vcpu> if its 'placement'
> * is not specified and 'placement' of <numatune> is specified.
>
More information about the libvir-list
mailing list