diff --git a/lib/display/display.c b/lib/display/display.c index ffbf42a0e..bde656a28 100644 --- a/lib/display/display.c +++ b/lib/display/display.c @@ -511,7 +511,7 @@ void vgdisplay_short(struct volume_group *vg) display_size((vg->extent_count - vg->free_count) * vg->extent_size / 2, SIZE_SHORT); s3 = display_size(vg->free_count * vg->extent_size / 2, SIZE_SHORT); - log_print("%s %-9s [%-9s used / %s free]", vg->name, + log_print("\"%s\" %-9s [%-9s used / %s free]", vg->name, /********* FIXME if "open" print "/used" else print "/idle"??? ******/ s1, s2, s3); dbg_free(s1); diff --git a/tools/archive.c b/tools/archive.c index cbdd77607..7f84506eb 100644 --- a/tools/archive.c +++ b/tools/archive.c @@ -89,9 +89,9 @@ int archive(struct volume_group *vg) return 1; } - log_verbose("Archiving volume group %s metadata.", vg->name); + log_verbose("Archiving volume group \"%s\" metadata.", vg->name); if (!__archive(vg)) { - log_error("Volume group %s metadata archive failed.", + log_error("Volume group \"%s\" metadata archive failed.", vg->name); return 0; } @@ -149,7 +149,7 @@ static int __backup(struct volume_group *vg) return 0; } - log_verbose("Creating volume group backup %s", name); + log_verbose("Creating volume group backup \"%s\"", name); if (!(tf = text_format_create(vg->cmd, name, the_um))) { stack; diff --git a/tools/lvchange.c b/tools/lvchange.c index df27b6184..eac4b9c23 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -50,19 +50,19 @@ static int lvchange_single(struct logical_volume *lv) if ((lv->vg->status & PARTIAL_VG) && (arg_count(contiguous_ARG) || arg_count(permission_ARG) || arg_count(readahead_ARG))) { - log_error("Only -a permitted with partial volume group %s", + log_error("Only -a permitted with partial volume group \"%s\"", lv->vg->name); return EINVALID_CMD_LINE; } if (lv->status & SNAPSHOT_ORG) { - log_error("Can't change logical volume %s under snapshot", + log_error("Can't change logical volume \"%s\" under snapshot", lv->name); return ECMD_FAILED; } if (lv->status & SNAPSHOT) { - log_error("Can't change snapshot logical volume %s", lv->name); + log_error("Can't change snapshot logical volume \"%s\"", lv->name); return ECMD_FAILED; } @@ -91,7 +91,7 @@ static int lvchange_single(struct logical_volume *lv) } if (doit) - log_print("Logical volume %s changed", lv->name); + log_print("Logical volume \"%s\" changed", lv->name); /* availability change */ if (arg_count(available_ARG)) @@ -108,31 +108,31 @@ static int lvchange_permission(struct logical_volume *lv) lv_access = arg_int_value(permission_ARG, 0); if ((lv_access & LVM_WRITE) && (lv->status & LVM_WRITE)) { - log_error("Logical volume %s is already writable", lv->name); + log_error("Logical volume \"%s\" is already writable", lv->name); return 0; } if (!(lv_access & LVM_WRITE) && !(lv->status & LVM_WRITE)) { - log_error("Logical volume %s is already read only", lv->name); + log_error("Logical volume \"%s\" is already read only", lv->name); return 0; } if (lv_access & LVM_WRITE) { lv->status |= LVM_WRITE; - log_verbose("Setting logical volume %s read/write", lv->name); + log_verbose("Setting logical volume \"%s\" read/write", lv->name); } else { lv->status &= ~LVM_WRITE; - log_verbose("Setting logical volume %s read-only", lv->name); + log_verbose("Setting logical volume \"%s\" read-only", lv->name); } - log_very_verbose("Updating logical volume %s on disk(s)", lv->name); + log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name); if (!fid->ops->vg_write(fid, lv->vg)) return 0; backup(lv->vg); - log_very_verbose("Updating permissions for %s in kernel", lv->name); + log_very_verbose("Updating permissions for \"%s\" in kernel", lv->name); if (!lv_update_write_access(lv)) return 0; @@ -148,33 +148,33 @@ static int lvchange_availability(struct logical_volume *lv) activate = 1; if ((active = lv_active(lv)) < 0) { - log_error("Unable to determine status of %s", lv->name); + log_error("Unable to determine status of \"%s\"", lv->name); return 0; } if (activate && active) { - log_verbose("Logical volume %s is already active", lv->name); + log_verbose("Logical volume \"%s\" is already active", lv->name); return 0; } if (!activate && !active) { - log_verbose("Logical volume %s is already inactive", lv->name); + log_verbose("Logical volume \"%s\" is already inactive", lv->name); return 0; } if (activate & lv_suspended(lv)) { - log_verbose("Reactivating logical volume %s", lv->name); + log_verbose("Reactivating logical volume \"%s\"", lv->name); if (!lv_reactivate(lv)) return 0; return 1; } if (activate) { - log_verbose("Activating logical volume %s", lv->name); + log_verbose("Activating logical volume \"%s\"", lv->name); if (!lv_activate(lv)) return 0; } else { - log_verbose("Deactivating logical volume %s", lv->name); + log_verbose("Deactivating logical volume \"%s\"", lv->name); if (!lv_deactivate(lv)) return 0; } @@ -191,14 +191,14 @@ static int lvchange_contiguous(struct logical_volume *lv) if ((lv_allocation & ALLOC_CONTIGUOUS) && (lv->status & ALLOC_CONTIGUOUS)) { - log_error("Allocation policy of logical volume %s is " + log_error("Allocation policy of logical volume \"%s\" is " "already contiguous", lv->name); return 0; } if (!(lv_allocation & ALLOC_CONTIGUOUS) && !(lv->status & ALLOC_CONTIGUOUS)) { - log_error("Allocation policy of logical volume %s is already" + log_error("Allocation policy of logical volume \"%s\" is already" " not contiguous", lv->name); return 0; } @@ -206,21 +206,21 @@ static int lvchange_contiguous(struct logical_volume *lv) /******** FIXME lv_check_contiguous? if ((lv_allocation & ALLOC_CONTIGUOUS) && (ret = lv_check_contiguous(vg, lv_index + 1)) == FALSE) { - log_error("No contiguous logical volume %s", lv->name); + log_error("No contiguous logical volume \"%s\"", lv->name); return 0; *********/ if (lv_allocation & ALLOC_CONTIGUOUS) { lv->status |= ALLOC_CONTIGUOUS; - log_verbose("Setting contiguous allocation policy for %s", + log_verbose("Setting contiguous allocation policy for \"%s\"", lv->name); } else { lv->status &= ~ALLOC_CONTIGUOUS; - log_verbose("Removing contiguous allocation policy for %s", + log_verbose("Removing contiguous allocation policy for \"%s\"", lv->name); } - log_verbose("Updating logical volume %s on disk(s)", lv->name); + log_verbose("Updating logical volume \"%s\" on disk(s)", lv->name); if (!fid->ops->vg_write(fid, lv->vg)) return 0; @@ -244,15 +244,15 @@ static int lvchange_readahead(struct logical_volume *lv) ********/ if (lv->read_ahead == read_ahead) { - log_error("Read ahead is already %u for %s", + log_error("Read ahead is already %u for \"%s\"", read_ahead, lv->name); return 0; } lv->read_ahead = read_ahead; - log_verbose("Setting read ahead to %u for %s", read_ahead, lv->name); + log_verbose("Setting read ahead to %u for \"%s\"", read_ahead, lv->name); - log_verbose("Updating logical volume %s on disk(s)", lv->name); + log_verbose("Updating logical volume \"%s\" on disk(s)", lv->name); if (!fid->ops->vg_write(fid, lv->vg)) return 0; diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 0337d0c56..c852abc1e 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -103,7 +103,8 @@ int lvcreate(int argc, char **argv) return EINVALID_CMD_LINE; if (strcmp(vg_name, argv[0])) { log_error("Inconsistent volume group names " - "given: %s and %s", vg_name, argv[0]); + "given: \"%s\" and \"%s\"", + vg_name, argv[0]); return EINVALID_CMD_LINE; } } @@ -116,25 +117,25 @@ int lvcreate(int argc, char **argv) lv_name = st + 1; /* does VG exist? */ - log_verbose("Finding volume group %s", vg_name); + log_verbose("Finding volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s doesn't exist", vg_name); + log_error("Volume group \"%s\" doesn't exist", vg_name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg_name); + log_error("Volume group \"%s\" is exported", vg_name); return ECMD_FAILED; } if (!(vg->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg_name); + log_error("Volume group \"%s\" is read-only", vg_name); return ECMD_FAILED; } if (lv_name && find_lv_in_vg(vg, lv_name)) { - log_error("Logical volume %s already exists in " - "volume group %s", lv_name, vg_name); + log_error("Logical volume \"%s\" already exists in " + "volume group \"%s\"", lv_name, vg_name); return ECMD_FAILED; } @@ -218,7 +219,7 @@ int lvcreate(int argc, char **argv) backup(vg); - log_print("Logical volume %s created", lv->name); + log_print("Logical volume \"%s\" created", lv->name); if (!lv_activate(lv)) return ECMD_FAILED; @@ -239,10 +240,10 @@ int lvcreate(int argc, char **argv) return ECMD_FAILED; } - log_verbose("Zeroing start of logical volume %s", name); + log_verbose("Zeroing start of logical volume \"%s\"", name); if (!(dev = dev_cache_get(name, NULL))) { - log_error("%s not found: device not zeroed", name); + log_error("\"%s\" not found: device not zeroed", name); return ECMD_FAILED; } if (!(dev_open(dev, O_WRONLY))) @@ -251,7 +252,7 @@ int lvcreate(int argc, char **argv) dev_close(dev); } else - log_print("WARNING: %s not zeroed", lv->name); + log_print("WARNING: \"%s\" not zeroed", lv->name); return 0; } diff --git a/tools/lvremove.c b/tools/lvremove.c index 0eef4c88e..35b5f1b39 100644 --- a/tools/lvremove.c +++ b/tools/lvremove.c @@ -40,18 +40,18 @@ static int lvremove_single(struct logical_volume *lv) vg = lv->vg; if (!(vg->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg->name); + log_error("Volume group \"%s\" is read-only", vg->name); return ECMD_FAILED; } if (lv->status & SNAPSHOT_ORG) { - log_error("Can't remove logical volume %s under snapshot", + log_error("Can't remove logical volume \"%s\" under snapshot", lv->name); return ECMD_FAILED; } if (lv_open_count(lv) > 0) { - log_error("Can't remove open logical volume %s", lv->name); + log_error("Can't remove open logical volume \"%s\"", lv->name); return ECMD_FAILED; } @@ -59,9 +59,9 @@ static int lvremove_single(struct logical_volume *lv) if (active && !arg_count(force_ARG)) { if (yes_no_prompt - ("Do you really want to remove active logical volume %s? " + ("Do you really want to remove active logical volume \"%s\"? " "[y/n]: ", lv->name) == 'n') { - log_print("Logical volume %s not removed", lv->name); + log_print("Logical volume \"%s\" not removed", lv->name); return 0; } } @@ -70,12 +70,12 @@ static int lvremove_single(struct logical_volume *lv) return ECMD_FAILED; if (active && !lv_deactivate(lv)) { - log_error("Unable to deactivate logical volume %s", lv->name); + log_error("Unable to deactivate logical volume \"%s\"", lv->name); } - log_verbose("Releasing logical volume %s", lv->name); + log_verbose("Releasing logical volume \"%s\"", lv->name); if (!lv_remove(vg, lv)) { - log_error("Error releasing logical volume %s", lv->name); + log_error("Error releasing logical volume \"%s\"", lv->name); return ECMD_FAILED; } @@ -85,6 +85,6 @@ static int lvremove_single(struct logical_volume *lv) backup(vg); - log_print("logical volume %s successfully removed", lv->name); + log_print("logical volume \"%s\" successfully removed", lv->name); return 0; } diff --git a/tools/lvrename.c b/tools/lvrename.c index 5a67c10df..37a22f49e 100644 --- a/tools/lvrename.c +++ b/tools/lvrename.c @@ -49,7 +49,7 @@ int lvrename(int argc, char **argv) (vg_name_new = extract_vgname(fid, lv_name_new)) && strcmp(vg_name, vg_name_new)) { log_error("Logical volume names must " - "have the same volume group (%s or %s)", + "have the same volume group (\"%s\" or \"%s\")", vg_name, vg_name_new); return EINVALID_CMD_LINE; } @@ -74,7 +74,7 @@ int lvrename(int argc, char **argv) } if (!is_valid_chars(lv_name_new)) { - log_error("New logical volume name %s has invalid characters", + log_error("New logical volume name \"%s\" has invalid characters", lv_name_new); return EINVALID_CMD_LINE; } @@ -84,31 +84,31 @@ int lvrename(int argc, char **argv) return EINVALID_CMD_LINE; } - log_verbose("Checking for existing volume group %s", vg_name); + log_verbose("Checking for existing volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s doesn't exist", vg_name); + log_error("Volume group \"%s\" doesn't exist", vg_name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg->name); + log_error("Volume group \"%s\" is exported", vg->name); return ECMD_FAILED; } if (!(vg->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg_name); + log_error("Volume group \"%s\" is read-only", vg_name); return ECMD_FAILED; } if (find_lv_in_vg(vg, lv_name_new)) { - log_error("Logical volume %s already exists in " - "volume group %s", lv_name_new, vg_name); + log_error("Logical volume \"%s\" already exists in " + "volume group \"%s\"", lv_name_new, vg_name); return ECMD_FAILED; } if (!(lvl = find_lv_in_vg(vg, lv_name_old))) { - log_error("Existing logical volume %s not found in " - "volume group %s", lv_name_old, vg_name); + log_error("Existing logical volume \"%s\" not found in " + "volume group \"%s\"", lv_name_old, vg_name); return ECMD_FAILED; } @@ -118,12 +118,12 @@ int lvrename(int argc, char **argv) return ECMD_FAILED; if ((active = lv_active(lv)) < 0) { - log_error("Unable to determine status of %s", lv->name); + log_error("Unable to determine status of \"%s\"", lv->name); return ECMD_FAILED; } if (active && !lv_suspend(lv)) { - log_error("Failed to suspend %s", lv->name); + log_error("Failed to suspend \"%s\"", lv->name); return ECMD_FAILED; } @@ -145,8 +145,8 @@ int lvrename(int argc, char **argv) backup(lv->vg); - log_print("Renamed %s to %s in volume group %s%s", - lv_name_old, lv_name_new, fid->cmd->dev_dir, vg_name); + log_print("Renamed \"%s\" to \"%s\" in volume group \"%s\"", + lv_name_old, lv_name_new, vg_name); return 0; } diff --git a/tools/pvchange.c b/tools/pvchange.c index 5274ad36c..d6d3ac09f 100644 --- a/tools/pvchange.c +++ b/tools/pvchange.c @@ -53,7 +53,7 @@ int pvchange(int argc, char **argv) for (; opt < argc; opt++) { pv_name = argv[opt]; if (!(pv = fid->ops->pv_read(fid, pv_name))) { - log_error("Failed to read physical volume %s", + log_error("Failed to read physical volume \"%s\"", pv_name); continue; } @@ -73,8 +73,10 @@ int pvchange(int argc, char **argv) } } - log_print("%d physical volume(s) changed / %d physical volume(s) " - "not changed", done, total - done); + log_print("%d physical volume%s changed / %d physical volume%s " + "not changed", + done, done > 1 ? "s" : "", + total - done, total - done > 1 ? "s" : ""); return 0; } @@ -90,25 +92,26 @@ int pvchange_single(struct physical_volume *pv) /* If in a VG, must change using volume group. */ if (*pv->vg_name) { - log_verbose("Finding volume group of physical volume %s", + log_verbose("Finding volume group of physical volume \"%s\"", pv_name); if (!(vg = fid->ops->vg_read(fid, pv->vg_name))) { - log_error("Unable to find volume group of %s", pv_name); + log_error("Unable to find volume group of \"%s\"", + pv_name); return 0; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg->name); + log_error("Volume group \"%s\" is exported", vg->name); return ECMD_FAILED; } if (!(vg->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg->name); + log_error("Volume group \"%s\" is read-only", vg->name); return ECMD_FAILED; } if (!(pvl = find_pv_in_vg(vg, pv_name))) { - log_error("Unable to find %s in volume group %s", + log_error("Unable to find \"%s\" in volume group \"%s\"", pv_name, vg->name); return 0; } @@ -119,42 +122,42 @@ int pvchange_single(struct physical_volume *pv) /* change allocatability for a PV */ if (allocatable && (pv->status & ALLOCATABLE_PV)) { - log_error("Physical volume %s is already allocatable", pv_name); + log_error("Physical volume \"%s\" is already allocatable", pv_name); return 0; } if (!allocatable && !(pv->status & ALLOCATABLE_PV)) { - log_error("Physical volume %s is already unallocatable", + log_error("Physical volume \"%s\" is already unallocatable", pv_name); return 0; } if (allocatable) { - log_verbose("Setting physical volume %s allocatable", pv_name); + log_verbose("Setting physical volume \"%s\" allocatable", pv_name); pv->status |= ALLOCATABLE_PV; } else { - log_verbose("Setting physical volume %s NOT allocatable", + log_verbose("Setting physical volume \"%s\" NOT allocatable", pv_name); pv->status &= ~ALLOCATABLE_PV; } - log_verbose("Updating physical volume %s", pv_name); + log_verbose("Updating physical volume \"%s\"", pv_name); if (*pv->vg_name) { if (!(fid->ops->vg_write(fid,vg))) { - log_error("Failed to store physical volume %s in " - "volume group %s", pv_name, vg->name); + log_error("Failed to store physical volume \"%s\" in " + "volume group \"%s\"", pv_name, vg->name); return 0; } backup(vg); } else { if (!(fid->ops->pv_write(fid, pv))) { - log_error("Failed to store physical volume %s", + log_error("Failed to store physical volume \"%s\"", pv_name); return 0; } } - log_print("Physical volume %s changed", pv_name); + log_print("Physical volume \"%s\" changed", pv_name); return 1; } diff --git a/tools/pvcreate.c b/tools/pvcreate.c index 39fdc04b4..7effa611e 100644 --- a/tools/pvcreate.c +++ b/tools/pvcreate.c @@ -21,7 +21,7 @@ #include "tools.h" const char _really_init[] = - "Really INITIALIZE physical volume %s of volume group %s [y/n]? "; + "Really INITIALIZE physical volume \"%s\" of volume group \"%s\" [y/n]? "; /* * See if we may pvcreate on this device. @@ -46,23 +46,24 @@ static int pvcreate_check(const char *name) /* Allow partial & exported VGs to be destroyed. */ /* we must have -ff to overwrite a non orphan */ if (arg_count(force_ARG) < 2) { - log_error("Can't initialize physical volume %s of " - "volume group %s without -ff", name, pv->vg_name); + log_error("Can't initialize physical volume \"%s\" of " + "volume group \"%s\" without -ff", name, pv->vg_name); return 0; } /* prompt */ if (!arg_count(yes_ARG) && yes_no_prompt(_really_init, name, pv->vg_name) == 'n') { - log_print("Physical volume %s not initialized", name); + log_print("Physical volume \"%s\" not initialized", name); return 0; } if (arg_count(force_ARG)) { log_print("WARNING: Forcing physical volume creation on " - "%s%s%s", name, - pv->vg_name[0] ? " of volume group " : "", - pv->vg_name[0] ? pv->vg_name : ""); + "%s%s%s%s", name, + pv->vg_name[0] ? " of volume group \"" : "", + pv->vg_name[0] ? pv->vg_name : "", + pv->vg_name[0] ? "\"" : ""); } return 1; @@ -80,7 +81,7 @@ static void pvcreate_single(const char *pv_name) if (!id_read_format(&id, uuid)) return; if ((dev = uuid_map_lookup(the_um, &id))) { - log_error("uuid %s already in use on %s", uuid, + log_error("uuid %s already in use on \"%s\"", uuid, dev_name(dev)); return; } @@ -91,20 +92,21 @@ static void pvcreate_single(const char *pv_name) return; if (!(pv = pv_create(fid, pv_name, idp))) { - log_err("Failed to setup physical volume %s", pv_name); + log_err("Failed to setup physical volume \"%s\"", pv_name); return; } - log_verbose("Set up physical volume for %s with %" PRIu64 " sectors", + log_verbose("Set up physical volume for \"%s\" with %" PRIu64 + " sectors", pv_name, pv->size); - log_verbose("Writing physical volume data to disk %s", pv_name); + log_verbose("Writing physical volume data to disk \"%s\"", pv_name); if (!(fid->ops->pv_write(fid, pv))) { - log_error("Failed to write physical volume %s", pv_name); + log_error("Failed to write physical volume \"%s\"", pv_name); return; } - log_print("Physical volume %s successfully created", pv_name); + log_print("Physical volume \"%s\" successfully created", pv_name); } int pvcreate(int argc, char **argv) diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c index 1dafafaba..000f5d5e8 100644 --- a/tools/pvdisplay.c +++ b/tools/pvdisplay.c @@ -39,7 +39,8 @@ int pvdisplay(int argc, char **argv) for (; opt < argc; opt++) { if (!(pv = fid->ops->pv_read(fid, argv[opt]))) { - log_error("Failed to read physical volume %s", + log_error("Failed to read physical " + "volume \"%s\"", argv[opt]); continue; } @@ -71,14 +72,13 @@ void pvdisplay_single(struct physical_volume *pv) if (arg_count(short_ARG)) { sz = display_size(size / 2, SIZE_SHORT); - log_print("Device '%s' has a capacity of %s", pv_name, sz); - + log_print("Device \"%s\" has a capacity of %s", pv_name, sz); dbg_free(sz); return; } if (pv->status & EXPORTED_VG) - log_print("Physical volume '%s' of volume group '%s' " + log_print("Physical volume \"%s\" of volume group \"%s\" " "is exported" , pv_name, pv->vg_name); /********* FIXME @@ -86,7 +86,7 @@ void pvdisplay_single(struct physical_volume *pv) *********/ if (!pv->vg_name) { - log_print ( "'%s' is a new physical volume of %s", + log_print ( "\"%s\" is a new physical volume of \"%s\"", pv_name, ( sz = display_size ( size / 2, SIZE_SHORT))); dbg_free(sz); @@ -118,12 +118,13 @@ void pvdisplay_single(struct physical_volume *pv) if (!(pv->pe = pv_read_pe(pv_name, pv))) goto pvdisplay_device_out; if (!(lvs = pv_read_lvs(pv))) { - log_error("Failed to read LVs on %s", pv->pv_name); + log_error("Failed to read LVs on \"%s\"", pv->pv_name); goto pvdisplay_device_out; } pv_display_pe_text(pv, pv->pe, lvs); } else - log_print("no logical volume on physical volume %s", pv_name); + log_print("no logical volume on physical volume \"%s\"", + pv_name); **********/ return; diff --git a/tools/pvscan.c b/tools/pvscan.c index 3162c551a..44229ede7 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -184,7 +184,8 @@ void pvscan_display_single(struct physical_volume *pv) if (pv->status & EXPORTED_VG) { strncpy(vg_name_this, pv->vg_name, vg_name_len); - log_print("PV %-*s is in exported VG %s [%s / %s free]", + log_print("PV %-*s is in exported VG %s " + "[%s / %s free]", pv_max_name_len, pv_tmp_name, vg_name_this, (s1 = display_size(pv->pe_count * diff --git a/tools/toollib.c b/tools/toollib.c index 20c082a80..95dbff747 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -16,7 +16,7 @@ int dir_exists(const char *dir) return 1; if (stat(dir, &info) != -1) { - log_error("%s exists", dir); + log_error("\"%s\" exists", dir); return 0; } @@ -31,7 +31,7 @@ int create_dir(const char *dir) return 1; if (stat(dir, &info) < 0) { - log_verbose("Creating directory %s", dir); + log_verbose("Creating directory \"%s\"", dir); if (!mkdir(dir, 0777)) return 1; log_sys_error("mkdir", dir); @@ -41,7 +41,7 @@ int create_dir(const char *dir) if (S_ISDIR(info.st_mode)) return 1; - log_error("Directory %s not found", dir); + log_error("Directory \"%s\" not found", dir); return 0; } @@ -55,7 +55,7 @@ int process_each_lv_in_vg(struct volume_group *vg, struct logical_volume *lv; if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg->name); + log_error("Volume group \"%s\" is exported", vg->name); return ECMD_FAILED; } @@ -97,9 +97,9 @@ int process_each_lv(int argc, char **argv, continue; } - log_verbose("Finding volume group %s", vg_name); + log_verbose("Finding volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s doesn't exist", + log_error("Volume group \"%s\" doesn't exist", vg_name); if (ret_max < ECMD_FAILED) ret_max = ECMD_FAILED; @@ -107,14 +107,14 @@ int process_each_lv(int argc, char **argv, } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", + log_error("Volume group \"%s\" is exported", vg->name); return ECMD_FAILED; } if (!(lvl = find_lv_in_vg(vg, lv_name))) { - log_error("Can't find logical volume %s " - "in volume group %s", + log_error("Can't find logical volume \"%s\" " + "in volume group \"%s\"", lv_name, vg_name); if (ret_max < ECMD_FAILED) ret_max = ECMD_FAILED; @@ -135,7 +135,8 @@ int process_each_lv(int argc, char **argv, list_iterate(vgh, vgs) { vg_name = list_item(vgh, struct name_list)->name; if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s not found", vg_name); + log_error("Volume group \"%s\" not found", + vg_name); if (ret_max < ECMD_FAILED) ret_max = ECMD_FAILED; continue; @@ -216,8 +217,8 @@ int process_each_pv(int argc, char **argv, struct volume_group *vg, log_verbose("Using physical volume(s) on command line"); for (; opt < argc; opt++) { if (!(pvl = find_pv_in_vg(vg, argv[opt]))) { - log_error("Physical Volume %s not found in " - "Volume Group %s", argv[opt], + log_error("Physical Volume \"%s\" not found in " + "Volume Group \"%s\"", argv[opt], vg->name); continue; } @@ -257,7 +258,7 @@ char *extract_vgname(struct format_instance *fi, char *lv_name) /* Require exactly one slash */ /* FIXME But allow for consecutive slashes */ if (!(st = strchr(vg_name, '/')) || (strchr(st + 1, '/'))) { - log_error("%s: Invalid path for Logical Volume", + log_error("\"%s\": Invalid path for Logical Volume", lv_name); return 0; } @@ -274,7 +275,7 @@ char *extract_vgname(struct format_instance *fi, char *lv_name) if (!(vg_name = default_vgname(fid))) { if (lv_name) - log_error("Path required for Logical Volume %s", + log_error("Path required for Logical Volume \"%s\"", lv_name); return 0; } @@ -297,8 +298,8 @@ char *default_vgname(struct format_instance *fi) vg_path += strlen(dev_dir); if (strchr(vg_path, '/')) { - log_error("Environment Volume Group in LVM_VG_NAME invalid: %s", - vg_path); + log_error("Environment Volume Group in LVM_VG_NAME invalid: " + "\"%s\"", vg_path); return 0; } @@ -322,13 +323,13 @@ struct list *create_pv_list(struct pool *mem, for (i = 0; i < argc; i++) { if (!(pvl = find_pv_in_vg(vg, argv[i]))) { - log_err("Physical Volume %s not found in " - "Volume Group %s", argv[i], vg->name); + log_err("Physical Volume \"%s\" not found in " + "Volume Group \"%s\"", argv[i], vg->name); return NULL; } if (pvl->pv->pe_count == pvl->pv->pe_allocated) { - log_err("No free extents on physical volume %s", + log_err("No free extents on physical volume \"%s\"", argv[i]); continue; } diff --git a/tools/vgcfgbackup.c b/tools/vgcfgbackup.c index d2ad04016..949c96ec1 100644 --- a/tools/vgcfgbackup.c +++ b/tools/vgcfgbackup.c @@ -29,9 +29,9 @@ static int vg_backup_single(const char *vg_name) { struct volume_group *vg; - log_verbose("Checking for volume group %s", vg_name); + log_verbose("Checking for volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s not found", vg_name); + log_error("Volume group \"%s\" not found", vg_name); return ECMD_FAILED; } @@ -47,7 +47,7 @@ static int vg_backup_single(const char *vg_name) } } - log_print("Volume group %s successfully backed up.", vg_name); + log_print("Volume group \"%s\" successfully backed up.", vg_name); return 0; } diff --git a/tools/vgchange.c b/tools/vgchange.c index f6f1c11d0..711f5bcdd 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -52,17 +52,17 @@ static int vgchange_single(const char *vg_name) struct volume_group *vg; if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Unable to find volume group %s", vg_name); + log_error("Unable to find volume group \"%s\"", vg_name); return ECMD_FAILED; } if (!(vg->status & LVM_WRITE) && !arg_count(available_ARG)) { - log_error("Volume group %s is read-only", vg->name); + log_error("Volume group \"%s\" is read-only", vg->name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg_name); + log_error("Volume group \"%s\" is exported", vg_name); return ECMD_FAILED; } @@ -85,24 +85,24 @@ void vgchange_available(struct volume_group *vg) /* FIXME: Force argument to deactivate them? */ if (!available && (lv_open = lvs_in_vg_opened(vg))) { - log_error("Can't deactivate volume group '%s' with %d open " + log_error("Can't deactivate volume group \"%s\" with %d open " "logical volume(s)", vg->name, lv_open); return; } if (available && (lv_active = lvs_in_vg_activated(vg))) - log_verbose("%d logical volume(s) in volume group %s " + log_verbose("%d logical volume(s) in volume group \"%s\" " "already active", lv_active, vg->name); if (available && (lv_open = activate_lvs_in_vg(vg))) log_verbose("Activated %d logical volumes in " - "volume group %s", lv_open, vg->name); + "volume group \"%s\"", lv_open, vg->name); if (!available && (lv_open = deactivate_lvs_in_vg(vg))) log_verbose("Deactivated %d logical volumes in " - "volume group %s", lv_open, vg->name); + "volume group \"%s\"", lv_open, vg->name); - log_print("%d logical volume(s) in volume group %s now active", + log_print("%d logical volume(s) in volume group \"%s\" now active", lvs_in_vg_activated(vg), vg->name); return; } @@ -112,12 +112,12 @@ void vgchange_resizeable(struct volume_group *vg) int resizeable = !strcmp(arg_str_value(resizeable_ARG, "n"), "y"); if (resizeable && (vg->status & RESIZEABLE_VG)) { - log_error("Volume group %s is already resizeable", vg->name); + log_error("Volume group \"%s\" is already resizeable", vg->name); return; } if (!resizeable && !(vg->status & RESIZEABLE_VG)) { - log_error("Volume group %s is already not resizeable", + log_error("Volume group \"%s\" is already not resizeable", vg->name); return; } @@ -135,7 +135,7 @@ void vgchange_resizeable(struct volume_group *vg) backup(vg); - log_print("Volume group %s successfully changed", vg->name); + log_print("Volume group \"%s\" successfully changed", vg->name); return; } @@ -145,14 +145,14 @@ void vgchange_logicalvolume(struct volume_group *vg) int max_lv = arg_int_value(logicalvolume_ARG, 0); if (!(vg->status & RESIZEABLE_VG)) { - log_error("Volume group '%s' must be resizeable " + log_error("Volume group \"%s\" must be resizeable " "to change MaxLogicalVolume", vg->name); return; } if (max_lv < vg->lv_count) { log_error("MaxLogicalVolume is less than the current number " - "%d of logical volume(s) for '%s'", vg->lv_count, + "%d of logical volume(s) for \"%s\"", vg->lv_count, vg->name); return; } @@ -184,7 +184,7 @@ void vgchange_logicalvolume(struct volume_group *vg) backup(vg); - log_print("Volume group %s successfully changed", vg->name); + log_print("Volume group \"%s\" successfully changed", vg->name); return; } diff --git a/tools/vgck.c b/tools/vgck.c index 70d6e323b..26d0aeab8 100644 --- a/tools/vgck.c +++ b/tools/vgck.c @@ -31,21 +31,22 @@ static int vgck_single(const char *vg_name) { struct volume_group *vg; - log_verbose("Checking volume group %s", vg_name); + log_verbose("Checking volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s not found", vg_name); + log_error("Volume group \"%s\" not found", vg_name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg_name); + log_error("Volume group \"%s\" is exported", vg_name); return ECMD_FAILED; } /******* FIXME Must be caught and logged by vg_read - log_error("not all physical volumes of volume group %s online", - log_error("volume group %s has physical volumes with invalid version", + log_error("not all physical volumes of volume group \"%s\" online", + log_error("volume group \"%s\" has physical volumes with ", + "invalid version", ********/ /* FIXME: free */ diff --git a/tools/vgcreate.c b/tools/vgcreate.c index 403a415de..622cfb2dc 100644 --- a/tools/vgcreate.c +++ b/tools/vgcreate.c @@ -70,7 +70,7 @@ int vgcreate(int argc, char **argv) if (!dir_exists(vg_path)) return ECMD_FAILED; if (!is_valid_chars(vg_name)) { - log_error("New volume group name '%s' has invalid characters", + log_error("New volume group name \"%s\" has invalid characters", vg_name); return ECMD_FAILED; } @@ -97,7 +97,7 @@ int vgcreate(int argc, char **argv) backup(vg); - log_print("Volume group %s successfully created", vg->name); + log_print("Volume group \"%s\" successfully created", vg->name); return 0; } diff --git a/tools/vgdisplay.c b/tools/vgdisplay.c index 8b1913600..57e4e54c4 100644 --- a/tools/vgdisplay.c +++ b/tools/vgdisplay.c @@ -69,14 +69,14 @@ static int vgdisplay_single(const char *vg_name) /* FIXME Do the active check here if activevolumegroups_ARG ? */ - log_very_verbose("Finding volume group %s", vg_name); + log_very_verbose("Finding volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s doesn't exist", vg_name); + log_error("Volume group \"%s\" doesn't exist", vg_name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) - log_print("WARNING: volume group %s is exported", vg_name); + log_print("WARNING: volume group \"%s\" is exported", vg_name); if (arg_count(colon_ARG)) { vgdisplay_colons(vg); diff --git a/tools/vgexport.c b/tools/vgexport.c index 2c55af95d..e74db3c8b 100644 --- a/tools/vgexport.c +++ b/tools/vgexport.c @@ -42,22 +42,22 @@ static int vgexport_single(const char *vg_name) struct volume_group *vg; if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Unable to find volume group %s", vg_name); + log_error("Unable to find volume group \"%s\"", vg_name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is already exported", vg_name); + log_error("Volume group \"%s\" is already exported", vg_name); return ECMD_FAILED; } if (!(vg->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg_name); + log_error("Volume group \"%s\" is read-only", vg_name); return ECMD_FAILED; } if (lvs_in_vg_activated(vg)) { - log_error("Volume group %s has active logical volumes", + log_error("Volume group \"%s\" has active logical volumes", vg_name); return ECMD_FAILED; } @@ -72,7 +72,7 @@ static int vgexport_single(const char *vg_name) backup(vg); - log_print("Volume group %s successfully exported", vg->name); + log_print("Volume group \"%s\" successfully exported", vg->name); return 0; } diff --git a/tools/vgextend.c b/tools/vgextend.c index 6d81f2711..6c51c27b9 100644 --- a/tools/vgextend.c +++ b/tools/vgextend.c @@ -40,24 +40,24 @@ int vgextend(int argc, char **argv) argc--; argv++; - log_verbose("Checking for volume group '%s'", vg_name); + log_verbose("Checking for volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group '%s' not found.", vg_name); + log_error("Volume group \"%s\" not found.", vg_name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg->name); + log_error("Volume group \"%s\" is exported", vg->name); return ECMD_FAILED; } if (!(vg->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg_name); + log_error("Volume group \"%s\" is read-only", vg_name); return ECMD_FAILED; } if (!(vg->status & RESIZEABLE_VG)) { - log_error("Volume group '%s' is not resizeable.", vg_name); + log_error("Volume group \"%s\" is not resizeable.", vg_name); return ECMD_FAILED; } @@ -76,7 +76,7 @@ int vgextend(int argc, char **argv) return ECMD_FAILED; /* ret > 0 */ - log_verbose("Volume group '%s' will be extended by %d new " + log_verbose("Volume group \"%s\" will be extended by %d new " "physical volumes", vg_name, argc); /* store vg on disk(s) */ @@ -85,7 +85,7 @@ int vgextend(int argc, char **argv) backup(vg); - log_print("Volume group '%s' successfully extended", vg_name); + log_print("Volume group \"%s\" successfully extended", vg_name); return 0; } diff --git a/tools/vgimport.c b/tools/vgimport.c index 73dc24801..9163eda7e 100644 --- a/tools/vgimport.c +++ b/tools/vgimport.c @@ -42,17 +42,18 @@ static int vgimport_single(const char *vg_name) struct volume_group *vg; if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Unable to find exported volume group %s", vg_name); + log_error("Unable to find exported volume group \"%s\"", + vg_name); return ECMD_FAILED; } if (!(vg->status & EXPORTED_VG)) { - log_error("Volume group %s is not exported", vg_name); + log_error("Volume group \"%s\" is not exported", vg_name); return ECMD_FAILED; } if (vg->status & PARTIAL_VG) { - log_error("Volume group %s is partially missing", vg_name); + log_error("Volume group \"%s\" is partially missing", vg_name); return ECMD_FAILED; } @@ -66,7 +67,7 @@ static int vgimport_single(const char *vg_name) backup(vg); - log_print("Volume group %s successfully imported", vg->name); + log_print("Volume group \"%s\" successfully imported", vg->name); return 0; } diff --git a/tools/vgmerge.c b/tools/vgmerge.c index 825b706d0..a164967a3 100644 --- a/tools/vgmerge.c +++ b/tools/vgmerge.c @@ -53,44 +53,44 @@ int vgmerge_single(const char *vg_name_to, const char *vg_name_from) int active; if (!strcmp(vg_name_to, vg_name_from)) { - log_error("Duplicate volume group name %s", vg_name_from); + log_error("Duplicate volume group name \"%s\"", vg_name_from); return ECMD_FAILED; } - log_verbose("Checking for volume group %s", vg_name_to); + log_verbose("Checking for volume group \"%s\"", vg_name_to); if (!(vg_to = fid->ops->vg_read(fid, vg_name_to))) { - log_error("Volume group %s doesn't exist", vg_name_to); + log_error("Volume group \"%s\" doesn't exist", vg_name_to); return ECMD_FAILED; } if (vg_to->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg_to->name); + log_error("Volume group \"%s\" is exported", vg_to->name); return ECMD_FAILED; } if (!(vg_to->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg_to->name); + log_error("Volume group \"%s\" is read-only", vg_to->name); return ECMD_FAILED; } - log_verbose("Checking for volume group %s", vg_name_from); + log_verbose("Checking for volume group \"%s\"", vg_name_from); if (!(vg_from = fid->ops->vg_read(fid, vg_name_from))) { - log_error("Volume group %s doesn't exist", vg_name_from); + log_error("Volume group \"%s\" doesn't exist", vg_name_from); return ECMD_FAILED; } if (vg_from->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg_from->name); + log_error("Volume group \"%s\" is exported", vg_from->name); return ECMD_FAILED; } if (!(vg_from->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg_from->name); + log_error("Volume group \"%s\" is read-only", vg_from->name); return ECMD_FAILED; } if ((active = lvs_in_vg_activated(vg_from))) { - log_error("Logical volumes in %s must be inactive", + log_error("Logical volumes in \"%s\" must be inactive", vg_name_from); return ECMD_FAILED; } @@ -105,14 +105,14 @@ int vgmerge_single(const char *vg_name_to, const char *vg_name_from) if (vg_to->max_pv < vg_to->pv_count + vg_from->pv_count) { log_error("Maximum number of physical volumes (%d) exceeded " - " for %s and %s", vg_to->max_pv, vg_to->name, + " for \"%s\" and \"%s\"", vg_to->max_pv, vg_to->name, vg_from->name); return ECMD_FAILED; } if (vg_to->max_lv < vg_to->lv_count + vg_from->lv_count) { log_error("Maximum number of logical volumes (%d) exceeded " - " for %s and %s", vg_to->max_lv, vg_to->name, + " for \"%s\" and \"%s\"", vg_to->max_lv, vg_to->name, vg_from->name); return ECMD_FAILED; } @@ -126,8 +126,10 @@ int vgmerge_single(const char *vg_name_to, const char *vg_name_from) char *name2 = list_item(lvh2, struct lv_list)->lv->name; if (!strcmp(name1, name2)) { - log_error("Duplicate logical volume name %s " - "in %s and %s", name1, vg_to->name, + log_error("Duplicate logical volume ", + "name \"%s\" " + "in \"%s\" and \"%s\"", + name1, vg_to->name, vg_from->name); return ECMD_FAILED; } @@ -173,7 +175,7 @@ int vgmerge_single(const char *vg_name_to, const char *vg_name_from) backup(vg_to); - log_print("Volume group %s successfully merged into %s", + log_print("Volume group \"%s\" successfully merged into \"%s\"", vg_from->name, vg_to->name); return 0; } diff --git a/tools/vgreduce.c b/tools/vgreduce.c index d16fa0682..71153fefc 100644 --- a/tools/vgreduce.c +++ b/tools/vgreduce.c @@ -48,24 +48,24 @@ int vgreduce(int argc, char **argv) argv++; argc--; - log_verbose("Finding volume group %s", vg_name); + log_verbose("Finding volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s doesn't exist", vg_name); + log_error("Volume group \"%s\" doesn't exist", vg_name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg->name); + log_error("Volume group \"%s\" is exported", vg->name); return ECMD_FAILED; } if (!(vg->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg_name); + log_error("Volume group \"%s\" is read-only", vg_name); return ECMD_FAILED; } if (!(vg->status & RESIZEABLE_VG)) { - log_error("Volume group %s is not reducable", vg_name); + log_error("Volume group \"%s\" is not reducable", vg_name); return ECMD_FAILED; } @@ -79,7 +79,8 @@ int vgreduce(int argc, char **argv) log_verbose ("volume group \"%s\" will be reduced by %d physical volume%s", vg_name, np, np > 1 ? "s" : ""); - log_verbose ("reducing volume group \"%s\" by physical volume \"%s\"", vg_name, pv_names[p]); + log_verbose ("reducing volume group \"%s\" by physical volume \"%s\"", + vg_name, pv_names[p]); log_print ("volume group \"%s\" %ssuccessfully reduced by physical volume%s:", @@ -96,7 +97,7 @@ static int vgreduce_single(struct volume_group *vg, struct physical_volume *pv) const char *name = dev_name(pv->dev); if (pv->pe_allocated) { - log_error("Physical volume %s still in use", name); + log_error("Physical volume \"%s\" still in use", name); return ECMD_FAILED; } @@ -107,8 +108,8 @@ static int vgreduce_single(struct volume_group *vg, struct physical_volume *pv) *********/ if (vg->pv_count == 1) { - log_error("Can't remove final physical volume %s from " - "volume group %s", name, vg->name); + log_error("Can't remove final physical volume \"%s\" from " + "volume group \"%s\"", name, vg->name); return ECMD_FAILED; } @@ -117,7 +118,7 @@ static int vgreduce_single(struct volume_group *vg, struct physical_volume *pv) if (!archive(vg)) return ECMD_FAILED; - log_verbose("Removing %s from volume group %s", name, vg->name); + log_verbose("Removing \"%s\" from volume group \"%s\"", name, vg->name); if (pvl) list_del(&pvl->list); @@ -128,20 +129,22 @@ static int vgreduce_single(struct volume_group *vg, struct physical_volume *pv) vg->extent_count -= pv->pe_count; if (!(fid->ops->vg_write(fid, vg))) { - log_error("Removal of physical volume %s from %s failed", + log_error("Removal of physical volume \"%s\" from " + "\"%s\" failed", name, vg->name); return ECMD_FAILED; } if (!fid->ops->pv_write(fid, pv)) { - log_error("Failed to clear metadata from physical volume %s " - "after removal from %s", name, vg->name); + log_error("Failed to clear metadata from physical " + "volume \"%s\" " + "after removal from \"%s\"", name, vg->name); return ECMD_FAILED; } backup(vg); - log_print("Removed %s from volume group %s", name, vg->name); + log_print("Removed \"%s\" from volume group \"%s\"", name, vg->name); return 0; } diff --git a/tools/vgremove.c b/tools/vgremove.c index 13dcf0cef..cd5d04004 100644 --- a/tools/vgremove.c +++ b/tools/vgremove.c @@ -34,24 +34,26 @@ static int vgremove_single(const char *vg_name) struct list *pvh; int ret = 0; - log_verbose("Checking for volume group %s", vg_name); + log_verbose("Checking for volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s doesn't exist", vg_name); + log_error("Volume group \"%s\" doesn't exist", vg_name); return ECMD_FAILED; } if (vg->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg->name); + log_error("Volume group \"%s\" is exported", vg->name); return ECMD_FAILED; } if (vg->status & PARTIAL_VG) { - log_error("Cannot remove partial volume group %s", vg->name); + log_error("Cannot remove partial volume group \"%s\"", + vg->name); return ECMD_FAILED; } if (vg->lv_count) { - log_error("Volume group %s still contains %d logical volume(s)", + log_error("Volume group \"%s\" still contains %d " + "logical volume(s)", vg_name, vg->lv_count); return ECMD_FAILED; } @@ -61,7 +63,7 @@ static int vgremove_single(const char *vg_name) /************ FIXME if (vg_remove_dir_and_group_and_nodes(vg_name) < 0) { - log_error("removing special files of volume group %s", + log_error("removing special files of volume group \"%s\"", vg_name); } *************/ @@ -69,13 +71,14 @@ static int vgremove_single(const char *vg_name) /* init physical volumes */ list_iterate(pvh, &vg->pvs) { pv = list_item(pvh, struct pv_list)->pv; - log_verbose("Removing physical volume %s from volume group %s", + log_verbose("Removing physical volume \"%s\" from " + "volume group \"%s\"", dev_name(pv->dev), vg_name); *pv->vg_name = '\0'; if (!(fid->ops->pv_write(fid, pv))) { - log_error("Failed to remove physical volume %s from " - "volume group %s", dev_name(pv->dev), - vg_name); + log_error("Failed to remove physical volume \"%s\"" + " from volume group \"%s\"", + dev_name(pv->dev), vg_name); ret = ECMD_FAILED; } } @@ -83,9 +86,9 @@ static int vgremove_single(const char *vg_name) backup_remove(vg_name); if (!ret) - log_print("Volume group %s successfully removed", vg_name); + log_print("Volume group \"%s\" successfully removed", vg_name); else - log_error("Volume group %s not properly removed", vg_name); + log_error("Volume group \"%s\" not properly removed", vg_name); return ret; } diff --git a/tools/vgrename.c b/tools/vgrename.c index 4183df484..d3a74cd7f 100644 --- a/tools/vgrename.c +++ b/tools/vgrename.c @@ -57,7 +57,7 @@ int vgrename(int argc, char **argv) } if (!is_valid_chars(vg_name_new)) { - log_error("New volume group name %s has invalid characters", + log_error("New volume group name \"%s\" has invalid characters", vg_name_new); return ECMD_FAILED; } @@ -67,24 +67,25 @@ int vgrename(int argc, char **argv) return ECMD_FAILED; } - log_verbose("Checking for existing volume group %s", vg_name_old); + log_verbose("Checking for existing volume group \"%s\"", vg_name_old); if (!(vg_old = fid->ops->vg_read(fid, vg_name_old))) { - log_error("Volume group %s doesn't exist", vg_name_old); + log_error("Volume group \"%s\" doesn't exist", vg_name_old); return ECMD_FAILED; } if (vg_old->status & EXPORTED_VG) { - log_error("Volume group %s is exported", vg_old->name); + log_error("Volume group \"%s\" is exported", vg_old->name); return ECMD_FAILED; } if (!(vg_old->status & LVM_WRITE)) { - log_error("Volume group %s is read-only", vg_old->name); + log_error("Volume group \"%s\" is read-only", vg_old->name); return ECMD_FAILED; } if (lvs_in_vg_activated(vg_old)) { - log_error("Volume group %s still has active LVs", vg_name_old); + log_error("Volume group \"%s\" still has active LVs", + vg_name_old); /***** FIXME Handle this with multiple LV renames! if (!force_ARG) { log_error("Use -f to force the rename"); @@ -93,9 +94,10 @@ int vgrename(int argc, char **argv) *****/ } - log_verbose("Checking for new volume group %s", vg_name_new); + log_verbose("Checking for new volume group \"%s\"", vg_name_new); if ((vg_new = fid->ops->vg_read(fid, vg_name_new))) { - log_error("New volume group %s already exists", vg_name_new); + log_error("New volume group \"%s\" already exists", + vg_name_new); return ECMD_FAILED; } @@ -120,9 +122,9 @@ int vgrename(int argc, char **argv) sprintf(old_path, "%s%s", dev_dir, vg_name_old); sprintf(new_path, "%s%s", dev_dir, vg_name_new); - log_verbose("Renaming %s to %s", old_path, new_path); + log_verbose("Renaming \"%s\" to \"%s\"", old_path, new_path); if (rename(old_path, new_path)) { - log_error("Renaming %s to %s failed: %s", + log_error("Renaming \"%s\" to \"%s\" failed: %s", old_path, new_path, strerror(errno)); return ECMD_FAILED; } @@ -137,7 +139,7 @@ int vgrename(int argc, char **argv) backup(vg_old); - log_print("Volume group %s successfully renamed to %s", + log_print("Volume group \"%s\" successfully renamed to \"%s\"", vg_name_old, vg_name_new); /* FIXME: Deallocations */ diff --git a/tools/vgscan.c b/tools/vgscan.c index b09f0b6f7..d5f541d8b 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -44,13 +44,13 @@ static int vgscan_single(const char *vg_name) { struct volume_group *vg; - log_verbose("Checking for volume group %s", vg_name); + log_verbose("Checking for volume group \"%s\"", vg_name); if (!(vg = fid->ops->vg_read(fid, vg_name))) { - log_error("Volume group %s not found", vg_name); + log_error("Volume group \"%s\" not found", vg_name); return ECMD_FAILED; } - log_print("Found %svolume group %s", + log_print("Found %svolume group \"%s\"", (vg->status & EXPORTED_VG) ? "exported " : "", vg_name);