From 38aa84d04bcd47bb832c3b7ec1e40be9d3c38c69 Mon Sep 17 00:00:00 2001 From: Raghu Krishnamurthy Date: Wed, 28 Jan 2015 16:59:38 -0800 Subject: [PATCH] if cache_set uuid is given in format command, then put the same information in both set-uuid and user-uuid until support is added in the CLI to display user-uuid as part of query-devs and in format command to accept set_uuid and user_uuid. Issue DAT- Change-Id: I6f2306d858211933cb783f0efe8fe0ade64dd312 --- bcacheadm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bcacheadm.c b/bcacheadm.c index cf1ecfc2..6ffceaaa 100644 --- a/bcacheadm.c +++ b/bcacheadm.c @@ -297,7 +297,18 @@ int make_bcache(NihCommand *command, char *const *args) cache_set_sb = calloc(1, sizeof(*cache_set_sb) + sizeof(struct cache_member) * devs); - uuid_generate(cache_set_sb->set_uuid.b); + /* + * Currently make the cache-set uuid and user_id same, + * until proper support/usage is added. + */ + if (cache_set_uuid) { + if (uuid_parse(cache_set_uuid, cache_set_sb->set_uuid.b)) { + fprintf(stderr, "Bad uuid\n"); + return -1; + } + } else { + uuid_generate(cache_set_sb->set_uuid.b); + } if (cache_set_uuid) { if(uuid_parse(cache_set_uuid, cache_set_sb->user_uuid.b)) {