master - cleanup: add '.' to log messages
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=38200c2000e549...
Commit: 38200c2000e5499a6421f477305464f9772b8d57
Parent: f36080a05d987d359e1c09e64d1222636dcd96ad
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 14 16:08:27 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 14 18:12:35 2014 +0100
cleanup: add '.' to log messages
---
lib/metadata/metadata.c | 2 +-
tools/toollib.c | 146 +++++++++++++++++++++++-----------------------
2 files changed, 74 insertions(+), 74 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 0c5b0d6..26e43b4 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3677,7 +3677,7 @@ struct volume_group *vg_read_internal(struct cmd_context *cmd, const char *vgnam
out:
if (!*consistent && (warn_flags & WARN_INCONSISTENT))
- log_warn("WARNING: Volume Group %s is not consistent", vgname);
+ log_warn("WARNING: Volume Group %s is not consistent.", vgname);
return vg;
}
diff --git a/tools/toollib.c b/tools/toollib.c
index c3d6852..02a1bbf 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -137,7 +137,7 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
if (!dm_split_lvm_name(cmd->mem, vg_name, &vgname, &lvname, &layer) ||
*layer) {
- log_error("skip_dev_dir: Couldn't split up device name %s",
+ log_error("skip_dev_dir: Couldn't split up device name %s.",
vg_name);
return vg_name;
}
@@ -146,7 +146,7 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
dm_snprintf(vglv, vglv_sz, "%s%s%s", vgname,
*lvname ? "/" : "",
lvname) < 0) {
- log_error("vg/lv string alloc failed");
+ log_error("vg/lv string alloc failed.");
return vg_name;
}
return vglv;
@@ -250,7 +250,7 @@ static const char *_extract_vgname(struct cmd_context *cmd, const char *lv_name,
st++;
if (!st || strchr(st, '/')) {
- log_error("\"%s\": Invalid path for Logical Volume",
+ log_error("\"%s\": Invalid path for Logical Volume.",
lv_name);
return 0;
}
@@ -281,8 +281,8 @@ static const char *_default_vgname(struct cmd_context *cmd)
vg_path = skip_dev_dir(cmd, vg_path, NULL);
if (strchr(vg_path, '/')) {
- log_error("Environment Volume Group in LVM_VG_NAME invalid: "
- "\"%s\"", vg_path);
+ log_error("\"%s\": Invalid environment var LVM_VG_NAME set for Volume Group.",
+ vg_path);
return 0;
}
@@ -306,7 +306,7 @@ const char *extract_vgname(struct cmd_context *cmd, const char *lv_name)
if (!(vg_name = _default_vgname(cmd))) {
if (lv_name)
- log_error("Path required for Logical Volume \"%s\"",
+ log_error("Path required for Logical Volume \"%s\".",
lv_name);
return NULL;
}
@@ -323,7 +323,7 @@ static int _add_pe_range(struct dm_pool *mem, const char *pvname,
struct pe_range *per;
log_debug("Adding PE range: start PE %" PRIu32 " length %" PRIu32
- " on %s", start, count, pvname);
+ " on %s.", start, count, pvname);
/* Ensure no overlap with existing areas */
dm_list_iterate_items(per, pe_ranges) {
@@ -332,7 +332,7 @@ static int _add_pe_range(struct dm_pool *mem, const char *pvname,
(per->start + per->count - 1) >= start)) {
log_error("Overlapping PE ranges specified (%" PRIu32
"-%" PRIu32 ", %" PRIu32 "-%" PRIu32 ")"
- " on %s",
+ " on %s.",
start, start + count - 1, per->start,
per->start + per->count - 1, pvname);
return 0;
@@ -340,7 +340,7 @@ static int _add_pe_range(struct dm_pool *mem, const char *pvname,
}
if (!(per = dm_pool_alloc(mem, sizeof(*per)))) {
- log_error("Allocation of list failed");
+ log_error("Allocation of list failed.");
return 0;
}
@@ -425,7 +425,7 @@ static int _parse_pes(struct dm_pool *mem, char *c, struct dm_list *pe_ranges,
if ((start > end) || (end > size - 1)) {
log_error("PE range error: start extent %" PRIu32 " to "
- "end extent %" PRIu32, start, end);
+ "end extent %" PRIu32 ".", start, end);
return 0;
}
@@ -437,7 +437,7 @@ static int _parse_pes(struct dm_pool *mem, char *c, struct dm_list *pe_ranges,
return 1;
error:
- log_error("Physical extent parsing error at %s", c);
+ log_error("Physical extent parsing error at %s.", c);
return 0;
}
@@ -480,7 +480,7 @@ static int _create_pv_entry(struct dm_pool *mem, struct pv_list *pvl,
memcpy(new_pvl, pvl, sizeof(*new_pvl));
if (!(pe_ranges = dm_pool_alloc(mem, sizeof(*pe_ranges)))) {
- log_error("Allocation of pe_ranges list failed");
+ log_error("Allocation of pe_ranges list failed.");
return 0;
}
dm_list_init(pe_ranges);
@@ -522,7 +522,7 @@ struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int
if (at_sign && (at_sign == argv[i])) {
tagname = at_sign + 1;
if (!validate_tag(tagname)) {
- log_error("Skipping invalid tag %s", tagname);
+ log_error("Skipping invalid tag %s.", tagname);
continue;
}
dm_list_iterate_items(pvl, &vg->pvs) {
@@ -541,13 +541,13 @@ struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int
if (colon && !(pvname = dm_pool_strndup(mem, pvname,
(unsigned) (colon - pvname)))) {
- log_error("Failed to clone PV name");
+ log_error("Failed to clone PV name.");
return NULL;
}
if (!(pvl = find_pv_in_vg(vg, pvname))) {
log_error("Physical Volume \"%s\" not found in "
- "Volume Group \"%s\"", pvname, vg->name);
+ "Volume Group \"%s\".", pvname, vg->name);
return NULL;
}
if (!_create_pv_entry(mem, pvl, colon, allocatable_only, r))
@@ -555,7 +555,7 @@ struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int
}
if (dm_list_empty(r))
- log_error("No specified PVs have space available");
+ log_error("No specified PVs have space available.");
return dm_list_empty(r) ? NULL : r;
}
@@ -567,7 +567,7 @@ struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvsl)
/* Build up list of PVs */
if (!(r = dm_pool_alloc(mem, sizeof(*r)))) {
- log_error("Allocation of list failed");
+ log_error("Allocation of list failed.");
return NULL;
}
dm_list_init(r);
@@ -585,7 +585,7 @@ struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvsl)
return r;
}
-const char _pe_size_may_not_be_negative_msg[] = "Physical extent size may not be negative";
+const char _pe_size_may_not_be_negative_msg[] = "Physical extent size may not be negative.";
int vgcreate_params_set_defaults(struct cmd_context *cmd,
struct vgcreate_params *vp_def,
@@ -653,18 +653,18 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
}
if (arg_uint64_value(cmd, physicalextentsize_ARG, 0) > MAX_EXTENT_SIZE) {
- log_error("Physical extent size cannot be larger than %s",
+ log_error("Physical extent size cannot be larger than %s.",
display_size(cmd, (uint64_t) MAX_EXTENT_SIZE));
return 0;
}
if (arg_sign_value(cmd, maxlogicalvolumes_ARG, SIGN_NONE) == SIGN_MINUS) {
- log_error("Max Logical Volumes may not be negative");
+ log_error("Max Logical Volumes may not be negative.");
return 0;
}
if (arg_sign_value(cmd, maxphysicalvolumes_ARG, SIGN_NONE) == SIGN_MINUS) {
- log_error("Max Physical Volumes may not be negative");
+ log_error("Max Physical Volumes may not be negative.");
return 0;
}
@@ -806,18 +806,18 @@ void lv_spawn_background_polling(struct cmd_context *cmd,
if (lv_is_pvmove(lv) &&
(pvname = get_pvmove_pvname_from_lv_mirr(lv))) {
- log_verbose("Spawning background pvmove process for %s",
+ log_verbose("Spawning background pvmove process for %s.",
pvname);
pvmove_poll(cmd, pvname, 1);
} else if (lv_is_locked(lv) &&
(pvname = get_pvmove_pvname_from_lv(lv))) {
- log_verbose("Spawning background pvmove process for %s",
+ log_verbose("Spawning background pvmove process for %s.",
pvname);
pvmove_poll(cmd, pvname, 1);
}
if (lv_is_converting(lv) || lv_is_merging(lv)) {
- log_verbose("Spawning background lvconvert process for %s",
+ log_verbose("Spawning background lvconvert process for %s.",
lv->name);
lvconvert_poll(cmd, lv, 1);
}
@@ -834,7 +834,7 @@ int pvcreate_params_validate(struct cmd_context *cmd,
struct pvcreate_params *pp)
{
if (!argc) {
- log_error("Please enter a physical volume path");
+ log_error("Please enter a physical volume path.");
return 0;
}
@@ -842,7 +842,7 @@ int pvcreate_params_validate(struct cmd_context *cmd,
pp->force = (force_t) arg_count(cmd, force_ARG);
if (arg_int_value(cmd, labelsector_ARG, 0) >= LABEL_SCAN_SECTORS) {
- log_error("labelsector must be less than %lu",
+ log_error("labelsector must be less than %lu.",
LABEL_SCAN_SECTORS);
return 0;
} else {
@@ -883,7 +883,7 @@ int pvcreate_params_validate(struct cmd_context *cmd,
pp->zero = arg_int_value(cmd, zero_ARG, 1);
if (arg_sign_value(cmd, dataalignment_ARG, SIGN_NONE) == SIGN_MINUS) {
- log_error("Physical volume data alignment may not be negative");
+ log_error("Physical volume data alignment may not be negative.");
return 0;
}
pp->data_alignment = arg_uint64_value(cmd, dataalignment_ARG, UINT64_C(0));
@@ -917,12 +917,12 @@ int pvcreate_params_validate(struct cmd_context *cmd,
}
if (arg_sign_value(cmd, metadatasize_ARG, SIGN_NONE) == SIGN_MINUS) {
- log_error("Metadata size may not be negative");
+ log_error("Metadata size may not be negative.");
return 0;
}
if (arg_sign_value(cmd, bootloaderareasize_ARG, SIGN_NONE) == SIGN_MINUS) {
- log_error("Bootloader area size may not be negative");
+ log_error("Bootloader area size may not be negative.");
return 0;
}
@@ -947,7 +947,7 @@ int get_activation_monitoring_mode(struct cmd_context *cmd,
if (arg_count(cmd, monitor_ARG) &&
(arg_count(cmd, ignoremonitoring_ARG) ||
arg_count(cmd, sysinit_ARG))) {
- log_error("--ignoremonitoring or --sysinit option not allowed with --monitor option");
+ log_error("--ignoremonitoring or --sysinit option not allowed with --monitor option.");
return 0;
}
@@ -985,7 +985,7 @@ int get_pool_params(struct cmd_context *cmd,
if (arg_is_set(cmd, discards_ARG)) {
*passed_args |= PASS_ARG_DISCARDS;
*discards = (thin_discards_t) arg_uint_value(cmd, discards_ARG, 0);
- log_very_verbose("Setting pool discards: %s",
+ log_very_verbose("Setting pool discards to %s.",
get_pool_discards_name(*discards));
}
}
@@ -1011,7 +1011,7 @@ int get_pool_params(struct cmd_context *cmd,
if (!validate_pool_chunk_size(cmd, segtype, *chunk_size))
return_0;
- log_very_verbose("Setting pool chunk size: %s",
+ log_very_verbose("Setting pool chunk size to %s.",
display_size(cmd, *chunk_size));
}
@@ -1046,25 +1046,25 @@ static int _validate_stripe_params(struct cmd_context *cmd, uint32_t *stripes,
uint32_t *stripe_size)
{
if (*stripes == 1 && *stripe_size) {
- log_print_unless_silent("Ignoring stripesize argument with single stripe");
+ log_print_unless_silent("Ignoring stripesize argument with single stripe.");
*stripe_size = 0;
}
if (*stripes > 1 && !*stripe_size) {
*stripe_size = find_config_tree_int(cmd, metadata_stripesize_CFG, NULL) * 2;
- log_print_unless_silent("Using default stripesize %s",
+ log_print_unless_silent("Using default stripesize %s.",
display_size(cmd, (uint64_t) *stripe_size));
}
if (*stripes < 1 || *stripes > MAX_STRIPES) {
- log_error("Number of stripes (%d) must be between %d and %d",
+ log_error("Number of stripes (%d) must be between %d and %d.",
*stripes, 1, MAX_STRIPES);
return 0;
}
if (*stripes > 1 && (*stripe_size < STRIPE_SIZE_MIN ||
*stripe_size & (*stripe_size - 1))) {
- log_error("Invalid stripe size %s",
+ log_error("Invalid stripe size %s.",
display_size(cmd, (uint64_t) *stripe_size));
return 0;
}
@@ -1086,12 +1086,12 @@ int get_stripe_params(struct cmd_context *cmd, uint32_t *stripes, uint32_t *stri
*stripe_size = arg_uint_value(cmd, stripesize_ARG, 0);
if (*stripe_size) {
if (arg_sign_value(cmd, stripesize_ARG, SIGN_NONE) == SIGN_MINUS) {
- log_error("Negative stripesize is invalid");
+ log_error("Negative stripesize is invalid.");
return 0;
}
if (arg_uint64_value(cmd, stripesize_ARG, 0) > STRIPE_SIZE_LIMIT * 2) {
- log_error("Stripe size cannot be larger than %s",
+ log_error("Stripe size cannot be larger than %s.",
display_size(cmd, (uint64_t) STRIPE_SIZE_LIMIT));
return 0;
}
@@ -1105,7 +1105,7 @@ static int _pv_change_tag(struct physical_volume *pv, const char *tag, int addta
{
if (addtag) {
if (!str_list_add(pv->fmt->cmd->mem, &pv->tags, tag)) {
- log_error("Failed to add tag %s to physical volume %s",
+ log_error("Failed to add tag %s to physical volume %s.",
tag, pv_dev_name(pv));
return 0;
}
@@ -1127,7 +1127,7 @@ int change_tag(struct cmd_context *cmd, struct volume_group *vg,
continue;
if (!(tag = grouped_arg_str_value(current_group->arg_values, arg, NULL))) {
- log_error("Failed to get tag");
+ log_error("Failed to get tag.");
return 0;
}
@@ -1157,13 +1157,13 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv, void *han
for (; opt < argc; opt++) {
if (!(dev = dev_cache_get(argv[opt], cmd->full_filter))) {
log_error("Failed to find device "
- "\"%s\"", argv[opt]);
+ "\"%s\".", argv[opt]);
ret_max = ECMD_FAILED;
continue;
}
if (!label_read(dev, &label, 0)) {
- log_error("No physical volume label read from %s",
+ log_error("No physical volume label read from %s.",
argv[opt]);
ret_max = ECMD_FAILED;
continue;
@@ -1182,7 +1182,7 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv, void *han
}
if (!(iter = dev_iter_create(cmd->full_filter, 1))) {
- log_error("dev_iter creation failed");
+ log_error("dev_iter creation failed.");
return ECMD_FAILED;
}
@@ -1297,7 +1297,7 @@ int validate_lvname_param(struct cmd_context *cmd, const char **vg_name,
*vg_name = vgname;
else if (strcmp(vgname, *vg_name)) {
log_error("Please use a single volume group name "
- "(\"%s\" or \"%s\")", vgname, *vg_name);
+ "(\"%s\" or \"%s\").", vgname, *vg_name);
return 0;
}
@@ -1350,7 +1350,7 @@ static int _get_arg_vgnames(struct cmd_context *cmd,
int ret_max = ECMD_PROCESSED;
const char *vg_name;
- log_verbose("Using volume group(s) on command line");
+ log_verbose("Using volume group(s) on command line.");
for (; opt < argc; opt++) {
vg_name = argv[opt];
@@ -1363,7 +1363,7 @@ static int _get_arg_vgnames(struct cmd_context *cmd,
}
if (!str_list_add(cmd->mem, arg_tags,
dm_pool_strdup(cmd->mem, vg_name + 1))) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
continue;
@@ -1371,14 +1371,14 @@ static int _get_arg_vgnames(struct cmd_context *cmd,
vg_name = skip_dev_dir(cmd, vg_name, NULL);
if (strchr(vg_name, '/')) {
- log_error("Invalid volume group name: %s", vg_name);
+ log_error("Invalid volume group name %s.", vg_name);
if (ret_max < EINVALID_CMD_LINE)
ret_max = EINVALID_CMD_LINE;
continue;
}
if (!str_list_add(cmd->mem, arg_vgnames,
dm_pool_strdup(cmd->mem, vg_name))) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
}
@@ -1403,7 +1403,7 @@ static int _get_vgnameids_on_system(struct cmd_context *cmd,
if (only_this_vgname) {
vgnl = dm_pool_alloc(cmd->mem, sizeof(*vgnl));
if (!vgnl) {
- log_error("name_id_list allocation failed");
+ log_error("name_id_list allocation failed.");
return ECMD_FAILED;
}
@@ -1414,7 +1414,7 @@ static int _get_vgnameids_on_system(struct cmd_context *cmd,
return ECMD_PROCESSED;
}
- log_verbose("Finding all volume groups");
+ log_verbose("Finding all volume groups.");
if (!lvmetad_vg_list_to_lvmcache(cmd))
stack;
@@ -1434,7 +1434,7 @@ static int _get_vgnameids_on_system(struct cmd_context *cmd,
continue;
if (!(vgnl = dm_pool_alloc(cmd->mem, sizeof(*vgnl)))) {
- log_error("vgnameid_list allocation failed");
+ log_error("vgnameid_list allocation failed.");
return ECMD_FAILED;
}
@@ -1515,7 +1515,7 @@ static int _copy_str_to_vgnameid_list(struct cmd_context *cmd, struct dm_list *s
vgnl = dm_pool_alloc(cmd->mem, sizeof(*vgnl));
if (!vgnl) {
- log_error("vgnameid_list allocation failed");
+ log_error("vgnameid_list allocation failed.");
return ECMD_FAILED;
}
@@ -1656,7 +1656,7 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
(!tags_supplied || !str_list_match_list(tags_in, &lvl->lv->tags, NULL)))
continue;
- log_very_verbose("Processing LV %s in VG %s", lvl->lv->name, vg->name);
+ log_very_verbose("Processing LV %s in VG %s.", lvl->lv->name, vg->name);
if ((ret = process_single_lv(cmd, lvl->lv, handle)) != ECMD_PROCESSED)
stack;
@@ -1708,7 +1708,7 @@ static int _get_arg_lvnames(struct cmd_context *cmd,
const char *vgname_def;
unsigned dev_dir_found;
- log_verbose("Using logical volume(s) on command line");
+ log_verbose("Using logical volume(s) on command line.");
for (; opt < argc; opt++) {
lv_name = argv[opt];
@@ -1719,12 +1719,12 @@ static int _get_arg_lvnames(struct cmd_context *cmd,
if (*vgname == '@') {
if (!validate_tag(vgname + 1)) {
- log_error("Skipping invalid tag %s", vgname);
+ log_error("Skipping invalid tag %s.", vgname);
continue;
}
if (!str_list_add(cmd->mem, arg_tags,
dm_pool_strdup(cmd->mem, vgname + 1))) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
continue;
@@ -1734,7 +1734,7 @@ static int _get_arg_lvnames(struct cmd_context *cmd,
vgname = skip_dev_dir(cmd, vgname, &dev_dir_found);
if (*vgname == '/') {
- log_error("\"%s\": Invalid path for Logical Volume",
+ log_error("\"%s\": Invalid path for Logical Volume.",
argv[opt]);
if (ret_max < ECMD_FAILED)
ret_max = ECMD_FAILED;
@@ -1761,25 +1761,25 @@ static int _get_arg_lvnames(struct cmd_context *cmd,
if (!str_list_add(cmd->mem, arg_vgnames,
dm_pool_strdup(cmd->mem, vgname))) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
if (!lv_name) {
if (!str_list_add(cmd->mem, arg_lvnames,
dm_pool_strdup(cmd->mem, vgname))) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
} else {
vglv_sz = strlen(vgname) + strlen(lv_name) + 2;
if (!(vglv = dm_pool_alloc(cmd->mem, vglv_sz)) ||
dm_snprintf(vglv, vglv_sz, "%s/%s", vgname, lv_name) < 0) {
- log_error("vg/lv string alloc failed");
+ log_error("vg/lv string alloc failed.");
return ECMD_FAILED;
}
if (!str_list_add(cmd->mem, arg_lvnames, vglv)) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
}
@@ -1840,7 +1840,7 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
strlen(vg_name) == (size_t) (lvn - vgn)) {
if (!str_list_add(cmd->mem, &lvnames,
dm_pool_strdup(cmd->mem, lvn + 1))) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
}
@@ -1938,7 +1938,7 @@ static int _get_arg_pvnames(struct cmd_context *cmd,
char *arg_name;
int ret_max = ECMD_PROCESSED;
- log_verbose("Using physical volume(s) on command line");
+ log_verbose("Using physical volume(s) on command line.");
for (; opt < argc; opt++) {
arg_name = argv[opt];
@@ -1948,14 +1948,14 @@ static int _get_arg_pvnames(struct cmd_context *cmd,
tagname = at_sign + 1;
if (!validate_tag(tagname)) {
- log_error("Skipping invalid tag %s", tagname);
+ log_error("Skipping invalid tag %s.", tagname);
if (ret_max < EINVALID_CMD_LINE)
ret_max = EINVALID_CMD_LINE;
continue;
}
if (!str_list_add(cmd->mem, arg_tags,
dm_pool_strdup(cmd->mem, tagname))) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
continue;
@@ -1963,7 +1963,7 @@ static int _get_arg_pvnames(struct cmd_context *cmd,
if (!str_list_add(cmd->mem, arg_pvnames,
dm_pool_strdup(cmd->mem, arg_name))) {
- log_error("strlist allocation failed");
+ log_error("strlist allocation failed.");
return ECMD_FAILED;
}
}
@@ -1981,13 +1981,13 @@ static int _get_all_devices(struct cmd_context *cmd, struct dm_list *all_devices
lvmcache_seed_infos_from_lvmetad(cmd);
if (!(iter = dev_iter_create(cmd->filter, 1))) {
- log_error("dev_iter creation failed");
+ log_error("dev_iter creation failed.");
return ECMD_FAILED;
}
while ((dev = dev_iter_get(iter))) {
if (!(devl = dm_pool_alloc(cmd->mem, sizeof(*devl)))) {
- log_error("device_list alloc failed");
+ log_error("device_list alloc failed.");
goto out;
}
@@ -2038,7 +2038,7 @@ static int _process_device_list(struct cmd_context *cmd, struct dm_list *all_dev
pv_dummy.dev = devl->dev;
pv = &pv_dummy;
- log_very_verbose("Processing device %s", dev_name(devl->dev));
+ log_very_verbose("Processing device %s.", dev_name(devl->dev));
ret = process_single_pv(cmd, NULL, pv, handle);
@@ -2089,9 +2089,9 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
if (process_pv) {
if (skip)
- log_verbose("Skipping PV %s in VG %s", pv_name, vg->name);
+ log_verbose("Skipping PV %s in VG %s.", pv_name, vg->name);
else
- log_very_verbose("Processing PV %s in VG %s", pv_name, vg->name);
+ log_very_verbose("Processing PV %s in VG %s.", pv_name, vg->name);
dev_found = _device_list_remove(all_devices, pv->dev);
@@ -2105,7 +2105,7 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
* not present in all_devices.
*/
if (!dev_found && !is_missing_pv(pv)) {
- log_verbose("Skipping PV %s in VG %s: not in device list", pv_name, vg->name);
+ log_verbose("Skipping PV %s in VG %s: not in device list.", pv_name, vg->name);
continue;
}
@@ -2188,7 +2188,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t flags,
/* Return an error if a pvname arg was not found. */
dm_list_iterate_items(sl, arg_pvnames) {
- log_error("Failed to find physical volume \"%s\"", sl->str);
+ log_error("Failed to find physical volume \"%s\".", sl->str);
ret_max = ECMD_FAILED;
}
9 years, 5 months
master - vg_read: correct warning
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f36080a05d987d...
Commit: f36080a05d987d359e1c09e64d1222636dcd96ad
Parent: d8923457b82456ebee3e333b3fcc26087483cd01
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 14 14:58:20 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 14 18:12:35 2014 +0100
vg_read: correct warning
Use log_warn when we are effectively not creating an error -
we 'allowed' inconsistent read for a reason - so it's just warning
level we process inconsistent VG - it's upto caller later to decide
error level of command return value and in case of error it needs
to use log_error then.
---
lib/metadata/metadata.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 601a766..0c5b0d6 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3567,8 +3567,8 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
/* Don't touch if vgids didn't match */
if (inconsistent_vgid) {
- log_error("Inconsistent metadata UUIDs found for "
- "volume group %s", vgname);
+ log_warn("WARNING: Inconsistent metadata UUIDs found for "
+ "volume group %s.", vgname);
*consistent = 0;
_free_pv_list(&all_pvs);
return correct_vg;
@@ -3600,8 +3600,8 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
release_vg(correct_vg);
return_NULL;
}
- log_error("Removing PV %s (%s) that no longer belongs to VG %s",
- pv_dev_name(pvl->pv), uuid, correct_vg->name);
+ log_warn("WARNING: Removing PV %s (%s) that no longer belongs to VG %s",
+ pv_dev_name(pvl->pv), uuid, correct_vg->name);
if (!pv_write_orphan(cmd, pvl->pv)) {
_free_pv_list(&all_pvs);
release_vg(correct_vg);
@@ -3624,10 +3624,9 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
}
if ((correct_vg->status & PVMOVE) && !pvmove_mode()) {
- log_error("WARNING: Interrupted pvmove detected in "
- "volume group %s", correct_vg->name);
- log_error("Please restore the metadata by running "
- "vgcfgrestore.");
+ log_error("Interrupted pvmove detected in volume group %s.",
+ correct_vg->name);
+ log_print("Please restore the metadata by running vgcfgrestore.");
release_vg(correct_vg);
return NULL;
}
9 years, 5 months
master - toolib: fix ignore_vg
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d8923457b82456...
Commit: d8923457b82456ebee3e333b3fcc26087483cd01
Parent: 06e3f1757eee0005267bbe1e088dd95638540849
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 14 10:50:31 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 14 18:10:45 2014 +0100
toolib: fix ignore_vg
Rework ignore_vg() API so it properly handles
multiple kind of vg_read_error() states.
Skip processing only otherwise valid VG.
Always return ECMD_FAILED when break is detected.
Check sigint_caught() in front of dm iterator loop.
Add stack for _process failing ret codes.
---
WHATS_NEW | 1 +
tools/reporter.c | 22 +++---
tools/toollib.c | 201 ++++++++++++++++++++++++++----------------------------
tools/toollib.h | 2 +-
4 files changed, 112 insertions(+), 114 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4b526fa..33546ac 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.113 -
=====================================
+ Fix ignore_vg() to properly react on various vg_read errors (2.02.112).
Failed recovery returns FAILED_RECOVERY status flag for vg_read().
Exit with non-zero status code when pvck encounters a problem.
Fix clean_tree after activation/resume for cache target (2.02.112).
diff --git a/tools/reporter.c b/tools/reporter.c
index 8399395..eec9948 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -361,12 +361,13 @@ static int _pvs_in_vg(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
void *handle)
{
- int ret = ECMD_PROCESSED;
+ int skip;
- if (ignore_vg(vg, vg_name, 0, &ret)) {
- stack;
- return ret;
- }
+ if (ignore_vg(vg, vg_name, 0, &skip))
+ return_ECMD_FAILED;
+
+ if (skip)
+ return ECMD_PROCESSED;
return process_each_pv_in_vg(cmd, vg, handle, &_pvs_single);
}
@@ -375,12 +376,13 @@ static int _pvsegs_in_vg(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
void *handle)
{
- int ret = ECMD_PROCESSED;
+ int skip;
- if (ignore_vg(vg, vg_name, 0, &ret)) {
- stack;
- return ret;
- }
+ if (ignore_vg(vg, vg_name, 0, &skip))
+ return_ECMD_FAILED;
+
+ if (skip)
+ return ECMD_PROCESSED;
return process_each_pv_in_vg(cmd, vg, handle, &_pvsegs_single);
}
diff --git a/tools/toollib.c b/tools/toollib.c
index e47213d..c3d6852 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -159,26 +159,26 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
/*
* Returns 1 if VG should be ignored.
*/
-int ignore_vg(struct volume_group *vg, const char *vg_name, int allow_inconsistent, int *ret)
+int ignore_vg(struct volume_group *vg, const char *vg_name, int allow_inconsistent, int *skip)
{
uint32_t read_error = vg_read_error(vg);
+ *skip = 0;
- if (!read_error)
- return 0;
-
- if ((read_error == FAILED_INCONSISTENT) && allow_inconsistent)
- return 0;
+ if ((read_error & FAILED_INCONSISTENT) && allow_inconsistent)
+ read_error &= ~FAILED_INCONSISTENT; /* Check for other errors */
- if (read_error == FAILED_NOTFOUND)
- *ret = ECMD_FAILED;
- else if (read_error == FAILED_CLUSTERED && vg->cmd->ignore_clustered_vgs)
+ if ((read_error & FAILED_CLUSTERED) && vg->cmd->ignore_clustered_vgs) {
+ read_error &= ~FAILED_CLUSTERED; /* Check for other errors */
log_verbose("Skipping volume group %s", vg_name);
- else {
- log_error("Skipping volume group %s", vg_name);
- *ret = ECMD_FAILED;
+ *skip = 1;
}
- return 1;
+ if (read_error != SUCCESS) {
+ log_error("Cannot process volume group %s", vg_name);
+ return 1;
+ }
+
+ return 0;
}
/*
@@ -195,22 +195,17 @@ int process_each_segment_in_pv(struct cmd_context *cmd,
int ret;
struct pv_segment _free_pv_segment = { .pv = pv };
- if (dm_list_empty(&pv->segments)) {
- ret = process_single_pvseg(cmd, NULL, &_free_pv_segment, handle);
- if (ret > ret_max)
- ret_max = ret;
- } else {
+ if (!dm_list_empty(&pv->segments)) {
dm_list_iterate_items(pvseg, &pv->segments) {
- if (sigint_caught()) {
- ret_max = ECMD_FAILED;
+ if (sigint_caught())
+ return_ECMD_FAILED;
+ if ((ret = process_single_pvseg(cmd, vg, pvseg, handle)) != ECMD_PROCESSED)
stack;
- break;
- }
- ret = process_single_pvseg(cmd, vg, pvseg, handle);
if (ret > ret_max)
ret_max = ret;
}
- }
+ } else if ((ret_max = process_single_pvseg(cmd, NULL, &_free_pv_segment, handle)) != ECMD_PROCESSED)
+ stack;
return ret_max;
}
@@ -225,9 +220,13 @@ int process_each_segment_in_lv(struct cmd_context *cmd,
int ret;
dm_list_iterate_items(seg, &lv->segments) {
- if (sigint_caught())
- return_ECMD_FAILED;
- ret = process_single_seg(cmd, seg, handle);
+ if (sigint_caught()) {
+ stack;
+ ret_max = ECMD_FAILED;
+ break;
+ }
+ if ((ret = process_single_seg(cmd, seg, handle)) != ECMD_PROCESSED)
+ stack;
if (ret > ret_max)
ret_max = ret;
}
@@ -1459,7 +1458,7 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
const char *vg_name;
const char *vg_uuid;
int ret_max = ECMD_PROCESSED;
- int ret;
+ int ret, skip;
int process_all = 0;
/*
@@ -1469,34 +1468,32 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
process_all = 1;
dm_list_iterate_items(vgnl, vgnameids_to_process) {
+ if (sigint_caught())
+ return_ECMD_FAILED;
+
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
- ret = 0;
vg = vg_read(cmd, vg_name, vg_uuid, flags);
- if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &ret)) {
- if (ret > ret_max)
- ret_max = ret;
- release_vg(vg);
+ if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &skip)) {
stack;
- continue;
- }
-
- /* Process this VG? */
- if (process_all ||
- (!dm_list_empty(arg_vgnames) && str_list_match_item(arg_vgnames, vg_name)) ||
- (!dm_list_empty(arg_tags) && str_list_match_list(arg_tags, &vg->tags, NULL)))
- ret = process_single_vg(cmd, vg_name, vg, handle);
-
- if (vg_read_error(vg))
+ ret = ECMD_FAILED;
release_vg(vg);
- else
+ } else {
+ /* Process this VG? */
+ if (!skip &&
+ (process_all ||
+ (!dm_list_empty(arg_vgnames) && str_list_match_item(arg_vgnames, vg_name)) ||
+ (!dm_list_empty(arg_tags) && str_list_match_list(arg_tags, &vg->tags, NULL)))) {
+ if ((ret = process_single_vg(cmd, vg_name, vg, handle)) != ECMD_PROCESSED)
+ stack;
+ } else
+ ret = ECMD_PROCESSED;
unlock_and_release_vg(cmd, vg, vg_name);
+ }
if (ret > ret_max)
ret_max = ret;
- if (sigint_caught())
- break;
}
return ret_max;
@@ -1624,6 +1621,9 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
* but it works since entries are allocated from vg mem pool.
*/
dm_list_iterate_items(lvl, &vg->lvs) {
+ if (sigint_caught())
+ return_ECMD_FAILED;
+
if (lvl->lv->status & SNAPSHOT)
continue;
@@ -1656,12 +1656,10 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
(!tags_supplied || !str_list_match_list(tags_in, &lvl->lv->tags, NULL)))
continue;
- if (sigint_caught())
- return_ECMD_FAILED;
-
log_very_verbose("Processing LV %s in VG %s", lvl->lv->name, vg->name);
- ret = process_single_lv(cmd, lvl->lv, handle);
+ if ((ret = process_single_lv(cmd, lvl->lv, handle)) != ECMD_PROCESSED)
+ stack;
if (ret > ret_max)
ret_max = ret;
@@ -1809,11 +1807,14 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
const char *lvn;
int ret_max = ECMD_PROCESSED;
int ret;
+ int skip;
dm_list_iterate_items(vgnl, vgnameids_to_process) {
+ if (sigint_caught())
+ return_ECMD_FAILED;
+
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
- ret = 0;
/*
* arg_lvnames contains some elements that are just "vgname"
@@ -1846,23 +1847,21 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, flags);
- if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &ret)) {
- if (ret > ret_max)
- ret_max = ret;
- release_vg(vg);
+ if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &skip)) {
stack;
- continue;
+ ret = ECMD_FAILED;
+ release_vg(vg);
+ } else {
+ if (skip)
+ ret = ECMD_PROCESSED;
+ else if ((ret = process_each_lv_in_vg(cmd, vg, &lvnames, tags_arg, 0,
+ handle, process_single_lv)) != ECMD_PROCESSED)
+ stack;
+ unlock_and_release_vg(cmd, vg, vg_name);
}
- ret = process_each_lv_in_vg(cmd, vg, &lvnames, tags_arg, 0,
- handle, process_single_lv);
- unlock_and_release_vg(cmd, vg, vg_name);
-
if (ret > ret_max)
ret_max = ret;
-
- if (sigint_caught())
- break;
}
return ret_max;
@@ -2030,6 +2029,9 @@ static int _process_device_list(struct cmd_context *cmd, struct dm_list *all_dev
* FIXME Formalise this extension or find an alternative.
*/
dm_list_iterate_items(devl, all_devices) {
+ if (sigint_caught())
+ return_ECMD_FAILED;
+
memset(&pv_dummy, 0, sizeof(pv_dummy));
dm_list_init(&pv_dummy.tags);
dm_list_init(&pv_dummy.segments);
@@ -2042,9 +2044,6 @@ static int _process_device_list(struct cmd_context *cmd, struct dm_list *all_dev
if (ret > ret_max)
ret_max = ret;
-
- if (sigint_caught())
- return_ECMD_FAILED;
}
return ECMD_PROCESSED;
@@ -2069,6 +2068,9 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
int ret = 0;
dm_list_iterate_items(pvl, &vg->pvs) {
+ if (sigint_caught())
+ return_ECMD_FAILED;
+
pv = pvl->pv;
pv_name = pv_dev_name(pv);
@@ -2107,16 +2109,15 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
continue;
}
- if (!skip)
- ret = process_single_pv(cmd, vg, pv, handle);
+ if (!skip) {
+ if ((ret = process_single_pv(cmd, vg, pv, handle)) != ECMD_PROCESSED)
+ stack;
- if (ret > ret_max)
- ret_max = ret;
+ if (ret > ret_max)
+ ret_max = ret;
+ }
}
- if (sigint_caught())
- return_ECMD_FAILED;
-
/*
* When processing only specific PV names, we can quit
* once they've all been found.
@@ -2158,32 +2159,28 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t flags,
int ret;
dm_list_iterate_items(vgnl, all_vgnameids) {
+ if (sigint_caught())
+ return_ECMD_FAILED;
+
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
- ret = 0;
- skip = 0;
vg = vg_read(cmd, vg_name, vg_uuid, flags | READ_WARN_INCONSISTENT);
- if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &ret)) {
- if (ret > ret_max)
- ret_max = ret;
- skip = 1;
+ if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &skip)) {
+ stack;
+ ret = ECMD_FAILED;
+ release_vg(vg);
+ } else {
+ if ((ret = _process_pvs_in_vg(cmd, vg, all_devices, arg_pvnames, arg_tags,
+ process_all, skip, handle,
+ process_single_pv)) != ECMD_PROCESSED)
+ stack;
+ unlock_and_release_vg(cmd, vg, vg->name);
}
- ret = _process_pvs_in_vg(cmd, vg, all_devices, arg_pvnames, arg_tags,
- process_all, skip, handle, process_single_pv);
-
if (ret > ret_max)
ret_max = ret;
- if (skip)
- release_vg(vg);
- else
- unlock_and_release_vg(cmd, vg, vg->name);
-
- if (sigint_caught())
- return_ECMD_FAILED;
-
/* Quit early when possible. */
if (!process_all && dm_list_empty(arg_tags) && dm_list_empty(arg_pvnames))
return ret_max;
@@ -2248,21 +2245,19 @@ int process_each_pv(struct cmd_context *cmd,
return ret;
}
- ret = _process_pvs_in_vgs(cmd, flags, &all_vgnameids, &all_devices,
- &arg_pvnames, &arg_tags, process_all_pvs,
- handle, process_single_pv);
- if (ret > ret_max)
- ret_max = ret;
-
- if (sigint_caught())
- return_ECMD_FAILED;
+ if ((ret_max = _process_pvs_in_vgs(cmd, flags, &all_vgnameids, &all_devices,
+ &arg_pvnames, &arg_tags, process_all_pvs,
+ handle, process_single_pv)) != ECMD_PROCESSED)
+ stack;
- if (!process_all_devices)
- goto_out;
+ if (process_all_devices) {
+ if ((ret = _process_device_list(cmd, &all_devices, handle,
+ process_single_pv)) != ECMD_PROCESSED)
+ stack;
- ret = _process_device_list(cmd, &all_devices, handle, process_single_pv);
- if (ret > ret_max)
- ret_max = ret;
+ if (ret > ret_max)
+ ret_max = ret;
+ }
out:
return ret_max;
diff --git a/tools/toollib.h b/tools/toollib.h
index e0e1e66..9040387 100644
--- a/tools/toollib.h
+++ b/tools/toollib.h
@@ -20,7 +20,7 @@
int become_daemon(struct cmd_context *cmd, int skip_lvm);
-int ignore_vg(struct volume_group *vg, const char *vg_name, int allow_inconsistent, int *ret);
+int ignore_vg(struct volume_group *vg, const char *vg_name, int allow_inconsistent, int *skip);
typedef int (*process_single_vg_fn_t) (struct cmd_context * cmd,
const char *vg_name,
9 years, 5 months
master - vg_read: use new error flag
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=06e3f1757eee00...
Commit: 06e3f1757eee0005267bbe1e088dd95638540849
Parent: 01bbbc27bf7734ca81fa4dba6a497af1d8a66ad3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 14 14:55:57 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 14 18:09:27 2014 +0100
vg_read: use new error flag
Failed recovery provides different (NULL) VG then FAILED_INCONSISTENT.
Mark it with different failure bit - since FAILED_INCONSISTENT is
supposed to contain something 'usable' (thought inconsistent).
---
WHATS_NEW | 1 +
lib/metadata/metadata-exported.h | 1 +
lib/metadata/metadata.c | 2 +-
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 19f029b..4b526fa 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.113 -
=====================================
+ Failed recovery returns FAILED_RECOVERY status flag for vg_read().
Exit with non-zero status code when pvck encounters a problem.
Fix clean_tree after activation/resume for cache target (2.02.112).
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 375f7be..c472f41 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -162,6 +162,7 @@
#define FAILED_CLUSTERED 0x00000040U
#define FAILED_ALLOCATION 0x00000080U
#define FAILED_EXIST 0x00000100U
+#define FAILED_RECOVERY 0x00000200U
#define SUCCESS 0x00000000U
#define VGMETADATACOPIES_ALL UINT32_MAX
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 11dabcc..601a766 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4359,7 +4359,7 @@ static struct volume_group *_vg_lock_and_read(struct cmd_context *cmd, const cha
if (!(vg = _recover_vg(cmd, vg_name, vgid))) {
log_error("Recovery of volume group \"%s\" failed.",
vg_name);
- failure |= FAILED_INCONSISTENT;
+ failure |= FAILED_RECOVERY;
goto bad_no_unlock;
}
}
9 years, 5 months
master - lvmcache: remove unnecessary line break syntax
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=01bbbc27bf7734...
Commit: 01bbbc27bf7734ca81fa4dba6a497af1d8a66ad3
Parent: 474c6a527139af59c46ca8ddf272ce5da4730954
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Nov 13 11:07:34 2014 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Nov 13 11:07:34 2014 -0600
lvmcache: remove unnecessary line break syntax
---
man/lvmcache.7.in | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/man/lvmcache.7.in b/man/lvmcache.7.in
index ad31aef..24ce5b4 100644
--- a/man/lvmcache.7.in
+++ b/man/lvmcache.7.in
@@ -89,7 +89,6 @@ CacheDataLV is renamed CachePoolLV_cdata and becomes hidden.
CacheMetaLV is renamed CachePoolLV_cmeta and becomes hidden.
.B lvconvert \-\-type cache-pool \-\-poolmetadata VG/CacheMetaLV
-.br
.RS
.B VG/CacheDataLV
.RE
9 years, 5 months
master - lvmcache.7: remove unwanted line continuation syntax
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=474c6a527139af...
Commit: 474c6a527139af59c46ca8ddf272ce5da4730954
Parent: 271252eff7bac62c186528ebaee176133eeeabaf
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Nov 13 11:04:15 2014 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Nov 13 11:04:15 2014 -0600
lvmcache.7: remove unwanted line continuation syntax
---
man/lvmcache.7.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man/lvmcache.7.in b/man/lvmcache.7.in
index 79ceb64..ad31aef 100644
--- a/man/lvmcache.7.in
+++ b/man/lvmcache.7.in
@@ -88,7 +88,7 @@ CacheDataLV is renamed CachePoolLV_cdata and becomes hidden.
.br
CacheMetaLV is renamed CachePoolLV_cmeta and becomes hidden.
-.B lvconvert \-\-type cache-pool \-\-poolmetadata VG/CacheMetaLV \\
+.B lvconvert \-\-type cache-pool \-\-poolmetadata VG/CacheMetaLV
.br
.RS
.B VG/CacheDataLV
9 years, 5 months
master - lvconvert.8: fix bold and italic syntax mistake
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=271252eff7bac6...
Commit: 271252eff7bac62c186528ebaee176133eeeabaf
Parent: 88e944b5a3c8633f9c6b3994743159801f1a7147
Author: Stéphane Aulery <saulery(a)free.fr>
AuthorDate: Wed Nov 12 13:39:36 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Nov 13 17:49:42 2014 +0100
lvconvert.8: fix bold and italic syntax mistake
Signed-off-by: Stéphane Aulery <saulery(a)free.fr>
---
man/lvconvert.8.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index bf699ee..5c9c083 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -416,7 +416,7 @@ and
Sets the size of cache or thin pool's metadata logical volume,
if the pool metadata volume is undefined.
Pool is specified with the option
-\B\-\-cachepool\P or \fB\-\-thinpool\fP.
+\fB\-\-cachepool\fP or \fB\-\-thinpool\fP.
For thin pool supported value is in the range between 2MiB and 16GiB.
The default value is estimated with this formula
(Pool_LV_size / Pool_LV_chunk_size * 64b).
9 years, 5 months
master - cleanup: remove unused headers
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=88e944b5a3c863...
Commit: 88e944b5a3c8633f9c6b3994743159801f1a7147
Parent: 428b9fcd87d1c79cd4349c884a68de7ccac51981
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 13 14:36:20 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Nov 13 17:49:42 2014 +0100
cleanup: remove unused headers
---
lib/cache_segtype/cache.c | 1 -
lib/device/dev-md.c | 1 -
lib/filters/filter-persistent.c | 1 -
lib/zero/zero.c | 2 --
4 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 02ac198..73839f4 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -19,7 +19,6 @@
#include "text_export.h"
#include "config.h"
#include "str_list.h"
-#include "targets.h"
#include "lvm-string.h"
#include "activate.h"
#include "metadata.h"
diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c
index 91cc322..76e3093 100644
--- a/lib/device/dev-md.c
+++ b/lib/device/dev-md.c
@@ -15,7 +15,6 @@
#include "lib.h"
#include "dev-type.h"
-#include "metadata.h"
#include "xlate.h"
#ifdef __linux__
diff --git a/lib/filters/filter-persistent.c b/lib/filters/filter-persistent.c
index 3c1701b..b4a7683 100644
--- a/lib/filters/filter-persistent.c
+++ b/lib/filters/filter-persistent.c
@@ -17,7 +17,6 @@
#include "filter.h"
#include "config.h"
#include "lvm-file.h"
-#include "activate.h"
struct pfilter {
char *file;
diff --git a/lib/zero/zero.c b/lib/zero/zero.c
index f07f288..4efa0ce 100644
--- a/lib/zero/zero.c
+++ b/lib/zero/zero.c
@@ -14,8 +14,6 @@
#include "lib.h"
#include "segtype.h"
-#include "display.h"
-#include "config.h"
#include "str_list.h"
#include "activate.h"
9 years, 5 months
master - cleanup: validate pointers
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=428b9fcd87d1c7...
Commit: 428b9fcd87d1c79cd4349c884a68de7ccac51981
Parent: 7278556c768ae418b03873bd5d9e921e13ce79e8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 13 17:40:30 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Nov 13 17:49:42 2014 +0100
cleanup: validate pointers
Mostly on almost impossible to happen paths - but stay safe.
---
lib/activate/dev_manager.c | 3 ++-
lib/report/report.c | 4 +++-
tools/dmsetup.c | 11 +++++++----
tools/pvresize.c | 4 ++++
4 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 32abde7..44b273d 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -131,7 +131,8 @@ static int _get_segment_status_from_target_params(const char *target_name,
if (strcmp(target_name, "cache"))
return 1;
- segtype = get_segtype_from_string(seg_status->seg->lv->vg->cmd, target_name);
+ if (!(segtype = get_segtype_from_string(seg_status->seg->lv->vg->cmd, target_name)))
+ return_0;
if (segtype != seg_status->seg->segtype) {
log_error(INTERNAL_ERROR "_get_segment_status_from_target_params: "
diff --git a/lib/report/report.c b/lib/report/report.c
index 42355e2..5637d50 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -779,7 +779,9 @@ static int _cachemode_disp(struct dm_report *rh, struct dm_pool *mem,
seg = first_seg(seg->pool_lv);
if (seg_is_cache_pool(seg)) {
- cachemode_str = get_cache_pool_cachemode_name(seg);
+ if (!(cachemode_str = get_cache_pool_cachemode_name(seg)))
+ return_0;
+
return dm_report_field_string(rh, field, &cachemode_str);
}
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index f1808c0..4202dbb 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3824,13 +3824,15 @@ int main(int argc, char **argv)
}
if (_switches[HELP_ARG]) {
- cmd = _find_command("help");
- goto doit;
+ if ((cmd = _find_command("help")))
+ goto doit;
+ goto unknown;
}
if (_switches[VERSION_ARG]) {
- cmd = _find_command("version");
- goto doit;
+ if ((cmd = _find_command("version")))
+ goto doit;
+ goto unknown;
}
if (argc == 0) {
@@ -3839,6 +3841,7 @@ int main(int argc, char **argv)
}
if (!(cmd = _find_command(argv[0]))) {
+unknown:
fprintf(stderr, "Unknown command\n");
_usage(stderr);
goto out;
diff --git a/tools/pvresize.c b/tools/pvresize.c
index 70b564d..631e63e 100644
--- a/tools/pvresize.c
+++ b/tools/pvresize.c
@@ -30,6 +30,10 @@ static int _pvresize_single(struct cmd_context *cmd,
{
struct pvresize_params *params = (struct pvresize_params *) handle;
+ if (!params) {
+ log_error(INTERNAL_ERROR "Invalid resize params.");
+ return ECMD_FAILED;
+ }
params->total++;
if (!pv_resize_single(cmd, vg, pv, params->new_size))
9 years, 5 months
master - lvm2api: use fully initilized struct
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7278556c768ae4...
Commit: 7278556c768ae418b03873bd5d9e921e13ce79e8
Parent: 49e3fd1ce8d0b1023f553673e76b49e65348878f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 13 17:42:09 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Nov 13 17:49:41 2014 +0100
lvm2api: use fully initilized struct
Don't pass partially initialized struct.
---
python/liblvm.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/python/liblvm.c b/python/liblvm.c
index 1b0942d..3828f27 100644
--- a/python/liblvm.c
+++ b/python/liblvm.c
@@ -324,9 +324,10 @@ static PyObject *_liblvm_lvm_pv_remove(PyObject *self, PyObject *arg)
static int _set_pv_numeric_prop(pv_create_params_t pv_params, const char *name,
unsigned long long value)
{
- struct lvm_property_value prop_value;
- prop_value.is_integer = 1;
- prop_value.value.integer = value;
+ struct lvm_property_value prop_value = {
+ .is_integer = 1,
+ .value.integer = value,
+ };
return lvm_pv_params_set_property(pv_params, name, &prop_value);
}
9 years, 5 months