On 07/04/2014 05:29 AM, Peter Krempa wrote:
> Add backends for this frontend function so that we can use it in the
> snapshot creation code.
> ---
>  src/storage/storage_backend_fs.c      | 17 +++++++++++++++++
>  src/storage/storage_backend_gluster.c | 28 ++++++++++++++++++++++++++++
>  2 files changed, 45 insertions(+)
> 

>  static int
> +virStorageFileBackendGlusterCreate(virStorageSourcePtr src)
> +{
> +    virStorageFileBackendGlusterPrivPtr priv = src->drv->priv;
> +    glfs_fd_t *fd = NULL;
> +    int save_errno;
> +    int ret = -1;
> +
> +    if (!(fd = glfs_open(priv->vol, src->path, O_CREAT | O_TRUNC | 
> O_WRONLY)))
> +        return -1;
> +
> +    if (src->drv->uid != 0 || src->drv->gid != 0) {

Isn't our sentinel value -1 for default? I think that comparison against
0 is likely to be wrong for running qemu:///session.

ACK with this change:

if (src->drv->uid != (uid_t)-1 || src->drv->gid != (gid_t)-1) {

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to