From e81632740ffff390ed31f571c8cf9c9cfa66955e Mon Sep 17 00:00:00 2001 From: Dmitry Guryanov Date: Wed, 26 Sep 2012 16:30:02 +0400 Subject: [PATCH] parallels: don't give null pointers to virBitmapEqual Signed-off-by: Dmitry Guryanov (cherry picked from commit adae5cf733b19c77db137ff6f6e1e0c9524d23dc) --- src/parallels/parallels_driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index 87e8cf5247..f4799f3976 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -1445,7 +1445,9 @@ parallelsApplyChanges(virDomainObjPtr dom, virDomainDefPtr new) return -1; } - if (!virBitmapEqual(old->cpumask, new->cpumask)) { + if ((old->cpumask != NULL || new->cpumask != NULL) && + (old->cpumask == NULL || new->cpumask == NULL || + !virBitmapEqual(old->cpumask, new->cpumask))) { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", _("changing cpu mask is not supported " @@ -1465,7 +1467,9 @@ parallelsApplyChanges(virDomainObjPtr dom, virDomainDefPtr new) if (old->numatune.memory.mode != new->numatune.memory.mode || old->numatune.memory.placement_mode != new->numatune.memory.placement_mode || - !virBitmapEqual(old->numatune.memory.nodemask, new->numatune.memory.nodemask)) { + ((old->numatune.memory.nodemask != NULL || new->numatune.memory.nodemask != NULL) && + (old->numatune.memory.nodemask == NULL || new->numatune.memory.nodemask == NULL || + !virBitmapEqual(old->numatune.memory.nodemask, new->numatune.memory.nodemask)))){ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", _("numa parameters are not supported "