[libvirt] [PATCH] virnuma: add notset NULL check in virNumaSetupMemoryPolicy

Martin Kletzander mkletzan at redhat.com
Fri Nov 7 11:10:44 UTC 2014


On Fri, Nov 07, 2014 at 04:54:56PM +0800, Chen Fan wrote:

s/notset/nodeset/ in $SUBJ

>introduce by commit c63ef0452b, when nodeset is NULL, validation
>will pass in virNumaSetupMemoryPolicy, but virBitmapNextSetBit
>must ensure bitmap is not Null. there will cause a segmentation
>fault. this patch fixed it.
>

ACK, I fixed up the commit message and pushed it.

>Signed-off-by: Chen Fan <chen.fan.fnst at cn.fujitsu.com>
>---
> src/util/virnuma.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/src/util/virnuma.c b/src/util/virnuma.c
>index 06520f7..b8d76f4 100644
>--- a/src/util/virnuma.c
>+++ b/src/util/virnuma.c
>@@ -97,6 +97,9 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
>     size_t i;
>     int maxnode = 0;
>
>+    if (!nodeset)
>+        return 0;
>+
>     if (!virNumaNodesetIsAvailable(nodeset))
>         return -1;
>

Thanks for noticing that, I tried implement all the checks in those
functions, but missed this one because I just checked that the
consecutive call to virNumaNodesetIsAvailable() does the check by
itself :)

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141107/376a8b0f/attachment-0001.sig>


More information about the libvir-list mailing list