[sheepdog] [PATCH] dog: add a force option to dog cluster format

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Jul 1 16:20:30 CEST 2015


At Wed,  1 Jul 2015 23:19:03 +0900,
Hitoshi Mitake wrote:
> 
> The new option is useful for testing scripts that require to format
> the cluster.
> 
> Cc: Valerio Pachera <sirio81 at gmail.com>
> Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> ---
>  dog/cluster.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Valerio, could you test it?

Thanks,
Hitoshi

> 
> diff --git a/dog/cluster.c b/dog/cluster.c
> index bb61fcc..ef854d5 100644
> --- a/dog/cluster.c
> +++ b/dog/cluster.c
> @@ -150,7 +150,7 @@ static int cluster_format(int argc, char **argv)
>  		return EXIT_FAILURE;
>  	}
>  
> -	if (!no_vdi(vdi_inuse))
> +	if (!no_vdi(vdi_inuse) && !cluster_cmd_data.force)
>  		confirm(FORMAT_PRINT);
>  
>  	gettimeofday(&tv, NULL);
> @@ -824,7 +824,7 @@ failure:
>  static struct subcommand cluster_cmd[] = {
>  	{"info", NULL, "aprhvT", "show cluster information",
>  	 NULL, CMD_NEED_NODELIST, cluster_info, cluster_options},
> -	{"format", NULL, "bcltaphzTVR", "create a Sheepdog store",
> +	{"format", NULL, "bcltaphzTVRf", "create a Sheepdog store",
>  	 NULL, CMD_NEED_NODELIST, cluster_format, cluster_options},
>  	{"shutdown", NULL, "aphT", "stop Sheepdog",
>  	 NULL, 0, cluster_shutdown, cluster_options},
> -- 
> 1.9.1
> 


More information about the sheepdog mailing list