Re: [PATCH 1/4] parallels: fix virDomainDef.features comparison

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

 



On Wed, Apr 23, 2014 at 06:35:00PM +0400, Dmitry Guryanov wrote:
> virDomainDef.features became an array, so now we can't simply
> compare one features variable to another. We need to compare
> each each element from the array.
> 
> Signed-off-by: Dmitry Guryanov <dguryanov@xxxxxxxxxxxxx>
> ---
>  src/parallels/parallels_driver.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
> index 848ed9f..41bb34b 100644
> --- a/src/parallels/parallels_driver.c
> +++ b/src/parallels/parallels_driver.c
> @@ -1955,6 +1955,7 @@ static int
>  parallelsApplyChanges(virConnectPtr conn, virDomainObjPtr dom, virDomainDefPtr new)
>  {
>      char buf[32];
> +    size_t i;
>  
>      virDomainDefPtr old = dom->def;
>      parallelsDomObjPtr pdom = dom->privateData;
> @@ -2131,11 +2132,13 @@ parallelsApplyChanges(virConnectPtr conn, virDomainObjPtr dom, virDomainDefPtr n
>          return -1;
>      }
>  
> -    if (old->features != new->features) {
> -        virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
> -                       _("changing features is not supported "
> -                         "by parallels driver"));
> -        return -1;
> +    for (i = 0; i < VIR_DOMAIN_FEATURE_LAST; i++) {
> +        if (old->features[i] != new->features[i]) {
> +            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
> +                           _("changing features is not supported "
> +                             "by parallels driver"));
> +            return -1;
> +        }
>      }
>  
>      if (new->clock.offset != VIR_DOMAIN_CLOCK_OFFSET_UTC ||

ACK


Regards,
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]