unsigned clustered; /* Mirror */
unsigned mirror_area_count; /* Mirror */
uint32_t flags; /* Mirror log */
+ char *uuid; /* Clustered mirror log */
};
/* Per-device properties */
case SEG_LINEAR:
break;
case SEG_MIRRORED:
+ log_parm_count = 1; /* Region size */
+ log_parm_count = hweight32(seg->flags); /* [no]sync, block_on_error etc. */
+
if (seg->clustered) {
+ if (seg->uuid)
+ log_parm_count++; /* uuid */
if ((tw = _dm_snprintf(params + pos, paramsize - pos, "clustered_")) < 0) {
stack; /* Out of space */
return -1;
pos += tw;
}
- log_parm_count = 1; /* Region size */
- log_parm_count = hweight32(seg->flags); /* [no]sync, block_on_error etc. */
-
if (!seg->log)
logtype = "core";
else {
}
pos += tw;
+ if (seg->clustered && seg->uuid) {
+ if ((tw = _dm_snprintf(params + pos, paramsize - pos, "%s ", seg->uuid)) < 0) {
+ stack; /* Out of space */
+ return -1;
+ }
+ pos += tw;
+ }
+
if ((seg->flags & DM_NOSYNC)) {
if ((tw = _dm_snprintf(params + pos, paramsize - pos, "nosync ")) < 0) {
stack; /* Out of space */
log_error("Couldn't find mirror log uuid %s.", log_uuid);
return 0;
}
+
if (!_link_tree_nodes(node, log_node))
return_0;
+
+ if (!(seg->uuid = dm_pool_strdup(node->dtree->mem, log_uuid))) {
+ log_error("log uuid pool_strdup failed");
+ return 0;
+ }
}
seg->log = log_node;