Re: [PATCH 4/7] locking: Add const char * parameter to avoid ugly typecasts

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

 



On Thu, Sep 27, 2012 at 04:41:34PM +0200, Jiri Denemark wrote:
> ---
>  src/locking/lock_driver.h  | 2 ++
>  src/locking/lock_manager.c | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/src/locking/lock_driver.h b/src/locking/lock_driver.h
> index 83ef323..c33aea7 100644
> --- a/src/locking/lock_driver.h
> +++ b/src/locking/lock_driver.h
> @@ -66,6 +66,7 @@ typedef enum {
>  
>  enum {
>      VIR_LOCK_MANAGER_PARAM_TYPE_STRING,
> +    VIR_LOCK_MANAGER_PARAM_TYPE_CSTRING,
>      VIR_LOCK_MANAGER_PARAM_TYPE_INT,
>      VIR_LOCK_MANAGER_PARAM_TYPE_LONG,
>      VIR_LOCK_MANAGER_PARAM_TYPE_UINT,
> @@ -84,6 +85,7 @@ struct _virLockManagerParam {
>          unsigned long long ul;
>          double d;
>          char *str;
> +        const char *cstr;
>          unsigned char uuid[16];
>      } value;
>  };
> diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c
> index f5e967f..23126c9 100644
> --- a/src/locking/lock_manager.c
> +++ b/src/locking/lock_manager.c
> @@ -99,6 +99,9 @@ static void virLockManagerLogParams(size_t nparams,
>          case VIR_LOCK_MANAGER_PARAM_TYPE_STRING:
>              VIR_DEBUG("  key=%s type=string value=%s", params[i].key, params[i].value.str);
>              break;
> +        case VIR_LOCK_MANAGER_PARAM_TYPE_CSTRING:
> +            VIR_DEBUG("  key=%s type=cstring value=%s", params[i].key, params[i].value.cstr);
> +            break;
>          case VIR_LOCK_MANAGER_PARAM_TYPE_UUID:
>              virUUIDFormat(params[i].value.uuid, uuidstr);
>              VIR_DEBUG("  key=%s type=uuid value=%s", params[i].key, uuidstr);

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]