mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Add descriptions to reporting field definitions.
This commit is contained in:
parent
3329c69865
commit
85feafd996
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.16 -
|
Version 1.02.16 -
|
||||||
===================================
|
===================================
|
||||||
|
Add descriptions to reporting field definitions.
|
||||||
Add a dso-private variable to dmeventd dso interface.
|
Add a dso-private variable to dmeventd dso interface.
|
||||||
Add dm_event_handler_[gs]et_timeout functions.
|
Add dm_event_handler_[gs]et_timeout functions.
|
||||||
Streamline dm_report_field_* interface.
|
Streamline dm_report_field_* interface.
|
||||||
|
@ -665,6 +665,7 @@ struct dm_report_field_type {
|
|||||||
int (*report_fn)(struct dm_report *rh, struct dm_pool *mem,
|
int (*report_fn)(struct dm_report *rh, struct dm_pool *mem,
|
||||||
struct dm_report_field *field, const void *data,
|
struct dm_report_field *field, const void *data,
|
||||||
void *private);
|
void *private);
|
||||||
|
const char *desc; /* description of the field */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -248,6 +248,11 @@ static void _display_fields(struct dm_report *rh)
|
|||||||
uint32_t f;
|
uint32_t f;
|
||||||
const struct dm_report_object_type *type;
|
const struct dm_report_object_type *type;
|
||||||
const char *desc, *last_desc = "";
|
const char *desc, *last_desc = "";
|
||||||
|
size_t id_len = 0;
|
||||||
|
|
||||||
|
for (f = 0; rh->fields[f].report_fn; f++)
|
||||||
|
if (strlen(rh->fields[f].id) > id_len)
|
||||||
|
id_len = strlen(rh->fields[f].id);
|
||||||
|
|
||||||
for (f = 0; rh->fields[f].report_fn; f++) {
|
for (f = 0; rh->fields[f].report_fn; f++) {
|
||||||
if ((type = _find_type(rh, rh->fields[f].type)) && type->desc)
|
if ((type = _find_type(rh, rh->fields[f].type)) && type->desc)
|
||||||
@ -260,7 +265,7 @@ static void _display_fields(struct dm_report *rh)
|
|||||||
log_print("%s Fields", desc);
|
log_print("%s Fields", desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
log_print("- %s", rh->fields[f].id);
|
log_print("- %-*s: %s", (int) id_len, rh->fields[f].id, rh->fields[f].desc);
|
||||||
last_desc = desc;
|
last_desc = desc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user