Re: [PATCH V1 1/6] Add QMP probing for TPM

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

 



On Wed, Mar 13, 2013 at 12:03:49PM -0400, Stefan Berger wrote:
> Index: libvirt/src/util/virutil.c
> ===================================================================
> --- libvirt.orig/src/util/virutil.c
> +++ libvirt/src/util/virutil.c
> @@ -3379,3 +3379,17 @@ cleanup:
>      VIR_FREE(buf);
>      return ret;
>  }
> +
> +
> +bool
> +virStrArrayHasString(char **strings, size_t n_strings, const char *needle)
> +{
> +    size_t i;
> +
> +    for (i = 0; i < n_strings; i++) {
> +        if (STREQ(strings[i], needle))
> +            return true;
> +    }
> +
> +    return false;
> +}
> Index: libvirt/src/util/virutil.h
> ===================================================================
> --- libvirt.orig/src/util/virutil.h
> +++ libvirt/src/util/virutil.h
> @@ -297,4 +297,7 @@ int virGetDeviceUnprivSGIO(const char *p
>  char * virGetUnprivSGIOSysfsPath(const char *path,
>                                   const char *sysfs_dir);
>  
> +bool virStrArrayHasString(char **strings, size_t n_strings,
> +                          const char *needle);
> +

These shouldn't be in virutil.h - we have a virstring.h. Instead
of passing in 'n_strings', we should declare that 'strings' is
NULL terminated as we do for other string list APIs. Finally the
name should be  'virStringArrayHasString' or 'virStringArrayContains'

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]