Version 2.02.143 -
=====================================
+ Support reporting CheckNeeded and Fail state for thin-pool and thin LV.
For failing thin-pool and thin volume correctly report percentage as INVALID.
Report -1, not 'unkown' for lv_{snapshot_invalid,merge_failed} with --binary.
Add configure --enable-dbus-service for an LVM D-Bus service.
* linear/striped, old snapshots and raids have proper
* segment selected for status!
*/
- if (strcmp(target_name, "cache") && strcmp(target_name, "thin-pool"))
+ if (strcmp(target_name, "cache") &&
+ strcmp(target_name, "thin-pool") &&
+ strcmp(target_name, "thin"))
return 1;
if (!(segtype = get_segtype_from_string(seg_status->seg->lv->vg->cmd, target_name)))
}
}
+ /* 'c' when thin-pool active with needs_check flag
+ * 'C' for suspend */
+ if (lv_is_thin_pool(lv) &&
+ lvdm->seg_status.thin_pool->needs_check)
+ repstr[4] = lvdm->info.suspended ? 'C' : 'c';
+
/*
* 'R' indicates read-only activation of a device that
* does not have metadata flagging it as read-only.
repstr[8] = 'D';
else if (lvdm->seg_status.thin_pool->read_only)
repstr[8] = 'M';
+ } else if (lv_is_thin_volume(lv) &&
+ (lvdm->seg_status.type != SEG_STATUS_NONE)) {
+ if (lvdm->seg_status.type == SEG_STATUS_UNKNOWN)
+ repstr[8] = 'X'; /* Unknown */
+ else if (lvdm->seg_status.thin->fail)
+ repstr[8] = 'F';
}
if (lv->status & LV_ACTIVATION_SKIP)
FIELD(LVSSTATUS, lv, STR_LIST, "KCache Settings", lvid, 18, kernel_cache_settings, kernel_cache_settings, "Cache settings/parameters as set in kernel, including default values (cached segments only).", 0)
FIELD(LVSSTATUS, lv, STR, "Health", lvid, 15, lvhealthstatus, lv_health_status, "LV health status.", 0)
FIELD(LVSSTATUS, lv, STR, "KDiscards", lvid, 8, kdiscards, kernel_discards, "For thin pools, how discards are handled in kernel.", 0)
+FIELD(LVSSTATUS, lv, BIN, "CheckNeeded", lvid, 15, lvcheckneeded, lv_check_needed, "For thin pools, whether metadata check is needed.", 0)
FIELD(LABEL, label, STR, "Fmt", type, 3, pvfmt, pv_fmt, "Type of metadata.", 0)
FIELD(LABEL, label, STR, "PV UUID", type, 38, pvuuid, pv_uuid, "Unique identifier.", 0)
#define _lv_health_status_get prop_not_implemented_get
#define _lv_skip_activation_set prop_not_implemented_set
#define _lv_skip_activation_get prop_not_implemented_get
+#define _lv_check_needed_set prop_not_implemented_set
+#define _lv_check_needed_get prop_not_implemented_get
#define _cache_total_blocks_set prop_not_implemented_set
#define _cache_total_blocks_get prop_not_implemented_get
return _string_disp(rh, mem, field, &health, private);
}
+static int _lvcheckneeded_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_with_info_and_seg_status *lvdm = (const struct lv_with_info_and_seg_status *) data;
+
+ if (lv_is_thin_pool(lvdm->lv))
+ return _binary_disp(rh, mem, field, lvdm->seg_status.thin_pool->needs_check,
+ GET_FIRST_RESERVED_NAME(lv_check_needed_y), private);
+
+ return _binary_undef_disp(rh, mem, field, private);
+}
+
static int _lvskipactivation_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
FIELD_RESERVED_BINARY_VALUE(lv_device_open, lv_device_open, "", "open")
FIELD_RESERVED_BINARY_VALUE(lv_skip_activation, lv_skip_activation, "", "skip activation", "skip")
FIELD_RESERVED_BINARY_VALUE(zero, zero, "", "zero")
+FIELD_RESERVED_BINARY_VALUE(lv_check_needed, lv_check_needed, "", "check needed", "needed")
FIELD_RESERVED_VALUE(NAMED, lv_permissions, lv_permissions_rw, "", "writeable", "writeable", "rw", "read-write")
FIELD_RESERVED_VALUE(NAMED, lv_permissions, lv_permissions_r, "", "read-only", "read-only", "r", "ro")
FIELD_RESERVED_VALUE(NAMED, lv_permissions, lv_permissions_r_override, "", "read-only-override", "read-only-override", "ro-override", "r-override", "R")