mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
system_id: apply consistent naming
In log messages refer to it as system ID (not System ID). Do not put quotes around the system_id string when printing. On the command line use systemid. In code, metadata, and config files use system_id. In lvmsystemid refer to the concept/entity as system_id.
This commit is contained in:
parent
e09f8a82f1
commit
c32efc7f7e
@ -80,7 +80,7 @@ const char *system_id_from_string(struct cmd_context *cmd, const char *str)
|
||||
}
|
||||
|
||||
if (!strncmp(system_id, "localhost", 9)) {
|
||||
log_warn("WARNING: System ID may not begin with the string \"localhost\".");
|
||||
log_warn("WARNING: system ID may not begin with the string \"localhost\".");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -459,7 +459,7 @@ static int _init_system_id(struct cmd_context *cmd)
|
||||
* The source failed to resolve a system_id. In this case allow
|
||||
* VGs with no system_id to be accessed, but not VGs with a system_id.
|
||||
*/
|
||||
log_warn("WARNING: No system ID found from system_id_source \"%s\".", source);
|
||||
log_warn("WARNING: No system ID found from system_id_source %s.", source);
|
||||
cmd->unknown_system_id = 1;
|
||||
|
||||
return 1;
|
||||
|
@ -4383,7 +4383,7 @@ static int _access_vg_systemid(struct cmd_context *cmd, struct volume_group *vg)
|
||||
* LVM1 VGs must not be accessed if a new-style LVM2 system ID is set.
|
||||
*/
|
||||
if (cmd->system_id && systemid_on_pvs(vg)) {
|
||||
log_error("Cannot access VG %s with LVM1 system ID \"%s\" when host system ID is set.",
|
||||
log_error("Cannot access VG %s with LVM1 system ID %s when host system ID is set.",
|
||||
vg->name, vg->lvm1_system_id);
|
||||
return 0;
|
||||
}
|
||||
@ -4416,7 +4416,7 @@ static int _access_vg_systemid(struct cmd_context *cmd, struct volume_group *vg)
|
||||
* Allow VG access if the local host has active LVs in it.
|
||||
*/
|
||||
if (lvs_in_vg_activated(vg)) {
|
||||
log_warn("WARNING: Found LVs active in VG %s with foreign system ID \"%s\". Possible data corruption.",
|
||||
log_warn("WARNING: Found LVs active in VG %s with foreign system ID %s. Possible data corruption.",
|
||||
vg->name, vg->system_id);
|
||||
if (cmd->include_active_foreign_vgs)
|
||||
return 1;
|
||||
@ -4427,7 +4427,7 @@ static int _access_vg_systemid(struct cmd_context *cmd, struct volume_group *vg)
|
||||
* A host without a system_id cannot access a VG with a system_id.
|
||||
*/
|
||||
if (!cmd->system_id || cmd->unknown_system_id) {
|
||||
log_error("Cannot access VG %s with system id \"%s\" with unknown local system ID.",
|
||||
log_error("Cannot access VG %s with system ID %s with unknown local system ID.",
|
||||
vg->name, vg->system_id);
|
||||
return 0;
|
||||
}
|
||||
@ -4436,7 +4436,7 @@ static int _access_vg_systemid(struct cmd_context *cmd, struct volume_group *vg)
|
||||
* Some commands always produce an error when accessing foreign VG.
|
||||
*/
|
||||
if (cmd->error_foreign_vgs) {
|
||||
log_error("Cannot access VG %s with system id \"%s\" with local system ID %s.",
|
||||
log_error("Cannot access VG %s with system ID %s with local system ID %s.",
|
||||
vg->name, vg->system_id, cmd->system_id);
|
||||
return 0;
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ int vg_set_system_id(struct volume_group *vg, const char *system_id)
|
||||
}
|
||||
|
||||
if (systemid_on_pvs(vg)) {
|
||||
log_error("Metadata format %s does not support this type of system id.",
|
||||
log_error("Metadata format %s does not support this type of system ID.",
|
||||
vg->fid->fmt->name);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
.TH "LVMSYSTEMID" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
|
||||
|
||||
.SH NAME
|
||||
lvmsystemid \(em LVM system id
|
||||
lvmsystemid \(em LVM system ID
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
|
@ -981,7 +981,7 @@ int systemid(struct cmd_context *cmd __attribute__((unused)),
|
||||
int argc __attribute__((unused)),
|
||||
char **argv __attribute__((unused)))
|
||||
{
|
||||
log_print("System ID: %s", cmd->system_id ? : "");
|
||||
log_print("system ID: %s", cmd->system_id ? : "");
|
||||
|
||||
return ECMD_PROCESSED;
|
||||
}
|
||||
@ -1468,7 +1468,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
|
||||
init_dmeventd_monitor(monitoring);
|
||||
|
||||
log_debug("Processing: %s", cmd->cmd_line);
|
||||
log_debug("System ID: %s", cmd->system_id ? : "");
|
||||
log_debug("system ID: %s", cmd->system_id ? : "");
|
||||
|
||||
#ifdef O_DIRECT_SUPPORT
|
||||
log_debug("O_DIRECT will be used");
|
||||
|
@ -43,7 +43,7 @@ static void _pvscan_display_single(struct cmd_context *cmd,
|
||||
/* pv_show(pv); */
|
||||
|
||||
/* FIXME - Moved to Volume Group structure */
|
||||
/* log_print("System Id %s", pv->vg->system_id); */
|
||||
/* log_print("system ID %s", pv->vg->system_id); */
|
||||
|
||||
/* log_print(" "); */
|
||||
/* return; */
|
||||
|
@ -200,7 +200,7 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
|
||||
*/
|
||||
if (read_error & FAILED_SYSTEMID) {
|
||||
if (arg_vgnames && str_list_match_item(arg_vgnames, vg->name)) {
|
||||
log_error("Cannot access VG %s with system id \"%s\" with local system ID %s.",
|
||||
log_error("Cannot access VG %s with system ID %s with local system ID %s.",
|
||||
vg->name, vg->system_id, vg->cmd->system_id);
|
||||
return 1;
|
||||
} else {
|
||||
@ -758,7 +758,7 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
|
||||
/* A clustered VG has no system ID. */
|
||||
if (vp_new->clustered) {
|
||||
if (arg_is_set(cmd, systemid_ARG)) {
|
||||
log_error("System ID cannot be set on clustered Volume Groups.");
|
||||
log_error("system ID cannot be set on clustered Volume Groups.");
|
||||
return 0;
|
||||
}
|
||||
vp_new->system_id = NULL;
|
||||
@ -772,7 +772,7 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
|
||||
if (vp_new->system_id && cmd->system_id &&
|
||||
strcmp(vp_new->system_id, cmd->system_id)) {
|
||||
if (*vp_new->system_id)
|
||||
log_warn("VG with system ID \"%s\" might become inaccessible as local system ID is \"%s\"",
|
||||
log_warn("VG with system ID %s might become inaccessible as local system ID is %s",
|
||||
vp_new->system_id, cmd->system_id);
|
||||
else
|
||||
log_warn("WARNING: A VG without a system ID allows unsafe access from other hosts.");
|
||||
|
@ -516,7 +516,7 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg)
|
||||
}
|
||||
|
||||
if (!strcmp(vg->system_id, system_id)) {
|
||||
log_error("Volume Group system ID is already \"%s\"", vg->system_id);
|
||||
log_error("Volume Group system ID is already %s", vg->system_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -527,7 +527,7 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg)
|
||||
if (!arg_count(cmd, yes_ARG) &&
|
||||
yes_no_prompt("Remove system ID %s on volume group %s? [y/n]: ",
|
||||
vg->system_id, vg->name) == 'n') {
|
||||
log_error("Volume group \"%s\" system ID not changed.", vg->name);
|
||||
log_error("Volume group %s system ID not changed.", vg->name);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
@ -537,7 +537,7 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_warn("WARNING: Requested system ID \"%s\" does not match local system ID \"%s\"",
|
||||
log_warn("WARNING: Requested system ID %s does not match local system ID %s",
|
||||
system_id, cmd->system_id);
|
||||
log_warn("WARNING: Volume group %s might become inaccessible from this machine.",
|
||||
vg->name);
|
||||
@ -545,13 +545,13 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg)
|
||||
if (!arg_count(cmd, yes_ARG) &&
|
||||
yes_no_prompt("Set foreign system ID %s on volume group %s? [y/n]: ",
|
||||
system_id, vg->name) == 'n') {
|
||||
log_error("Volume group \"%s\" system ID not changed.", vg->name);
|
||||
log_error("Volume group %s system ID not changed.", vg->name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log_verbose("Changing system ID for VG %s: %s -> %s.",
|
||||
log_verbose("Changing system ID for VG %s from %s to %s.",
|
||||
vg->name, vg->system_id, system_id);
|
||||
|
||||
vg->system_id = system_id;
|
||||
|
Loading…
Reference in New Issue
Block a user