[sheepdog] [PATCH 1/2] dog: enable 'cluster format -c x:y'

MORITA Kazutaka morita.kazutaka at gmail.com
Wed Nov 13 19:53:00 CET 2013


At Fri,  1 Nov 2013 16:31:00 +0800,
Liu Yuan wrote:
> 
> diff --git a/dog/common.c b/dog/common.c
> index 4480b99..c243386 100644
> --- a/dog/common.c
> +++ b/dog/common.c
> @@ -435,3 +435,41 @@ void dump_loglevels(bool err)
>  			sd_info("%s\t(%d)", loglevel_table[i], i);
>  	}
>  }
> +
> +/* Return 0 to indicate ill str */
> +uint8_t parse_copy(const char *str, uint8_t *copy_policy)
> +{
> +	char *n1, *n2;
> +	uint8_t copy, parity;
> +	char p[10];
> +
> +	strcpy(p, str);
> +	n1 = strtok(p, ":");
> +	n2 = strtok(NULL, ":");
> +
> +	if ((n1 && !is_numeric(n1)) || (n2 && !is_numeric(n2)))

This line should be 
    if (!n1 || !is_numeric(n1) || (n2 && !is_numeric(n2)))
like your qemu patch?

Thanks,

Kazutaka



More information about the sheepdog mailing list