+ if (o->cluster_name) {
+ char *client_name = NULL;
+
+ /*
+ * If we specify cluser name, the rados_create2
+ * will not assume 'client.'. name is considered
+ * as a full type.id namestr
+ */
+ if (o->client_name) {
+ if (!index(o->client_name, '.')) {
+ client_name = calloc(1, strlen("client.") +
+ strlen(o->client_name) + 1);
+ strcat(client_name, "client.");
+ strcat(client_name, o->client_name);
+ } else {
+ client_name = o->client_name;
+ }
+ }
+
+ r = rados_create2(&rbd->cluster, o->cluster_name,
+ client_name, 0);
+
+ if (client_name && !index(o->client_name, '.'))
+ free(client_name);
+ } else
+ r = rados_create(&rbd->cluster, o->client_name);
+