[libvirt] [PATCH] rbd: Do not append Ceph monitor port number 6789 if not provided

Andrea Bolognani abologna at redhat.com
Wed Jan 6 08:49:30 UTC 2016


On Wed, 2016-01-06 at 09:32 +0100, Wido den Hollander wrote:
> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index 2aa1d90..1354601 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -2246,7 +2246,7 @@ virStorageSourceRBDAddHost(virStorageSourcePtr src,
>          if (VIR_STRDUP(src->hosts[src->nhosts - 1].port, port) < 0)
>              goto error;
>      } else {
> -        if (VIR_STRDUP(src->hosts[src->nhosts - 1].port, "6789") < 0)
> +        if (VIR_STRDUP(src->hosts[src->nhosts - 1].port, NULL) < 0)
>              goto error;
>      }

Shouldn't this be

>          if (VIR_STRDUP(src->hosts[src->nhosts - 1].port, port) < 0)
>              goto error;
>      } else {
> -        if (VIR_STRDUP(src->hosts[src->nhosts - 1].port, "6789") < 0)
> -            goto error;
> +        src->hosts[src->nhosts - 1].port = NULL;
>      }

instead?

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team




More information about the libvir-list mailing list