Re: [PATCH 4/4] parallels: don't give null pointers to virBitmapEqual

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 26, 2012 at 04:30:02PM +0400, Dmitry Guryanov wrote:
> 
> Signed-off-by: Dmitry Guryanov <dguryanov@xxxxxxxxxxxxx>
> ---
>  src/parallels/parallels_driver.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
> index 87e8cf5..f4799f3 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 "

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]