mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
log: use separate 'orphan' report object type for orphan VGs
This commit is contained in:
parent
89e2aef63a
commit
cee1aedf12
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.158 -
|
Version 2.02.158 -
|
||||||
=================================
|
=================================
|
||||||
|
Use 'orphan' object type in cmd log for groups to collect PVs not yet in VGs.
|
||||||
Add lvm lastlog command for query and display of last cmd's log in lvm shell.
|
Add lvm lastlog command for query and display of last cmd's log in lvm shell.
|
||||||
Report per-object return codes via cmd log while processing multiple objects.
|
Report per-object return codes via cmd log while processing multiple objects.
|
||||||
Annotate processing code with log report hooks for per-object command log.
|
Annotate processing code with log report hooks for per-object command log.
|
||||||
|
@ -298,6 +298,7 @@ const char *log_get_report_context_name(log_report_context_t context)
|
|||||||
const char *log_get_report_object_type_name(log_report_object_type_t object_type)
|
const char *log_get_report_object_type_name(log_report_object_type_t object_type)
|
||||||
{
|
{
|
||||||
static const char *log_object_type_names[LOG_REPORT_OBJECT_TYPE_COUNT] = {[LOG_REPORT_OBJECT_TYPE_NULL] = "",
|
static const char *log_object_type_names[LOG_REPORT_OBJECT_TYPE_COUNT] = {[LOG_REPORT_OBJECT_TYPE_NULL] = "",
|
||||||
|
[LOG_REPORT_OBJECT_TYPE_ORPHAN] = "orphan",
|
||||||
[LOG_REPORT_OBJECT_TYPE_PV] = "pv",
|
[LOG_REPORT_OBJECT_TYPE_PV] = "pv",
|
||||||
[LOG_REPORT_OBJECT_TYPE_VG] = "vg",
|
[LOG_REPORT_OBJECT_TYPE_VG] = "vg",
|
||||||
[LOG_REPORT_OBJECT_TYPE_LV] = "lv"};
|
[LOG_REPORT_OBJECT_TYPE_LV] = "lv"};
|
||||||
|
@ -74,6 +74,7 @@ typedef enum {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LOG_REPORT_OBJECT_TYPE_NULL,
|
LOG_REPORT_OBJECT_TYPE_NULL,
|
||||||
|
LOG_REPORT_OBJECT_TYPE_ORPHAN,
|
||||||
LOG_REPORT_OBJECT_TYPE_PV,
|
LOG_REPORT_OBJECT_TYPE_PV,
|
||||||
LOG_REPORT_OBJECT_TYPE_VG,
|
LOG_REPORT_OBJECT_TYPE_VG,
|
||||||
LOG_REPORT_OBJECT_TYPE_LV,
|
LOG_REPORT_OBJECT_TYPE_LV,
|
||||||
|
@ -1894,11 +1894,14 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t read_flags,
|
|||||||
notfound = 0;
|
notfound = 0;
|
||||||
|
|
||||||
uuid[0] = '\0';
|
uuid[0] = '\0';
|
||||||
if (vg_uuid && !is_orphan_vg(vg_name) &&
|
if (is_orphan_vg(vg_name)) {
|
||||||
!id_write_format((const struct id*)vg_uuid, uuid, sizeof(uuid)))
|
log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_ORPHAN);
|
||||||
stack;
|
log_set_report_object_name_and_id(vg_name + sizeof(VG_ORPHANS), uuid);
|
||||||
|
} else {
|
||||||
log_set_report_object_name_and_id(vg_name, uuid);
|
if (vg_uuid && !id_write_format((const struct id*)vg_uuid, uuid, sizeof(uuid)))
|
||||||
|
stack;
|
||||||
|
log_set_report_object_name_and_id(vg_name, uuid);
|
||||||
|
}
|
||||||
|
|
||||||
if (sigint_caught()) {
|
if (sigint_caught()) {
|
||||||
ret_max = ECMD_FAILED;
|
ret_max = ECMD_FAILED;
|
||||||
@ -3306,7 +3309,8 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
|
|||||||
goto_out;
|
goto_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_set_report_object_group_and_group_id(vg->name, vg_uuid);
|
if (!is_orphan_vg(vg->name))
|
||||||
|
log_set_report_object_group_and_group_id(vg->name, vg_uuid);
|
||||||
|
|
||||||
dm_list_iterate_items(pvl, &vg->pvs) {
|
dm_list_iterate_items(pvl, &vg->pvs) {
|
||||||
pv = pvl->pv;
|
pv = pvl->pv;
|
||||||
@ -3430,11 +3434,14 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
|
|||||||
notfound = 0;
|
notfound = 0;
|
||||||
|
|
||||||
uuid[0] = '\0';
|
uuid[0] = '\0';
|
||||||
if (vg_uuid && !is_orphan_vg(vg_name) &&
|
if (is_orphan_vg(vg_name)) {
|
||||||
!id_write_format((const struct id*)vg_uuid, uuid, sizeof(uuid)))
|
log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_ORPHAN);
|
||||||
stack;
|
log_set_report_object_name_and_id(vg_name + sizeof(VG_ORPHANS), uuid);
|
||||||
|
} else {
|
||||||
log_set_report_object_name_and_id(vg_name, uuid);
|
if (vg_uuid && !id_write_format((const struct id*)vg_uuid, uuid, sizeof(uuid)))
|
||||||
|
stack;
|
||||||
|
log_set_report_object_name_and_id(vg_name, uuid);
|
||||||
|
}
|
||||||
|
|
||||||
if (sigint_caught()) {
|
if (sigint_caught()) {
|
||||||
ret_max = ECMD_FAILED;
|
ret_max = ECMD_FAILED;
|
||||||
@ -3750,7 +3757,8 @@ int process_each_pv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
if (!id_write_format(&vg->id, vg_uuid, sizeof(vg_uuid)))
|
if (!id_write_format(&vg->id, vg_uuid, sizeof(vg_uuid)))
|
||||||
stack;
|
stack;
|
||||||
|
|
||||||
log_set_report_object_group_and_group_id(vg->name, vg_uuid);
|
if (!is_orphan_vg(vg->name))
|
||||||
|
log_set_report_object_group_and_group_id(vg->name, vg_uuid);
|
||||||
|
|
||||||
dm_list_iterate_items(pvl, &vg->pvs) {
|
dm_list_iterate_items(pvl, &vg->pvs) {
|
||||||
pv_uuid[0] = '\0';
|
pv_uuid[0] = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user