]> sourceware.org Git - lvm2.git/commitdiff
Add lv_path to reports to offer full /dev pathname.
authorAlasdair Kergon <agk@redhat.com>
Wed, 23 Jun 2010 12:32:08 +0000 (12:32 +0000)
committerAlasdair Kergon <agk@redhat.com>
Wed, 23 Jun 2010 12:32:08 +0000 (12:32 +0000)
WHATS_NEW
lib/report/columns.h
lib/report/report.c
man/lvs.8.in

index 47ff0023909c0dffd5efc8743db4f31059371e19..99ddcdd26b3e6b1b81ce4ffc7bb09786e8f99ffd 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.68 -
 ===============================
+  Add lv_path to reports to offer full /dev pathname.
   Fix typo in warning message about missing device with allocated data areas.
   Add device name and offset to output of error messages in raw_read_mda_header().
   Use flexible data[] in cmirrord request to prevent abort in runtime size checks.
@@ -14,7 +15,8 @@ Version 2.02.68 -
   Add --force, --nofsck and --resizefs to lvresize/extend/reduce man pages.
   Fix lvm2cmd example in documentation.
   Allow use of lvm2app and lvm2cmd headers in C++ code.
-  Remove some unused #includes from clvmd files.
+  Remove unused #includes from clvmd files and introduce clvmd-common.h.
+  Move common inclusions to clvmd-common.h.
   Use #include "" for libdevmapper.h and configure.h throughout tree.
   Fix LVM_PATH expansion when exec_prefix=NONE (2.02.67).
   Fix segfault in clvmd -R if no response from daemon received.
index 141497151871d205354ace88fdbc212c5470c6c3..a1d419c959d3c72ae0bfc120a8511bfa26c68388 100644 (file)
@@ -57,6 +57,7 @@
 /* *INDENT-OFF* */
 FIELD(LVS, lv, STR, "LV UUID", lvid.id[1], 38, uuid, "lv_uuid", "Unique identifier.")
 FIELD(LVS, lv, STR, "LV", lvid, 4, lvname, "lv_name", "Name.  LVs created for internal use are enclosed in brackets.")
+FIELD(LVS, lv, STR, "Path", lvid, 4, lvpath, "lv_path", "Full pathname for LV.")
 FIELD(LVS, lv, STR, "Attr", lvid, 4, lvstatus, "lv_attr", "Various attributes - see man page.")
 FIELD(LVS, lv, NUM, "Maj", major, 3, int32, "lv_major", "Persistent major number or -1 if not persistent.")
 FIELD(LVS, lv, NUM, "Min", minor, 3, int32, "lv_minor", "Persistent minor number or -1 if not persistent.")
index 063db07396813a57b054ab9ab17e62df37a10522..f71a46f819a19913c39f95f2ff03f1b34af95a11 100644 (file)
@@ -523,6 +523,30 @@ static int _lvname_disp(struct dm_report *rh, struct dm_pool *mem,
        return 1;
 }
 
+static int _lvpath_disp(struct dm_report *rh, struct dm_pool *mem,
+                       struct dm_report_field *field,
+                       const void *data, void *private __attribute((unused)))
+{
+       const struct logical_volume *lv = (const struct logical_volume *) data;
+       char *repstr;
+       size_t len;
+
+       len = strlen(lv->vg->cmd->dev_dir) + strlen(lv->vg->name) + strlen(lv->name) + 2;
+       if (!(repstr = dm_pool_zalloc(mem, len))) {
+               log_error("dm_pool_alloc failed");
+               return 0;
+       }
+
+       if (dm_snprintf(repstr, len, "%s%s/%s", lv->vg->cmd->dev_dir, lv->vg->name, lv->name) < 0) {
+               log_error("lvpath snprintf failed");
+               return 0;
+       }
+
+       dm_report_field_set_value(field, repstr, NULL);
+
+       return 1;
+}
+
 static int _origin_disp(struct dm_report *rh, struct dm_pool *mem,
                        struct dm_report_field *field,
                        const void *data, void *private)
index 1c4bcc43eb8528905cc19a40dd1d1e13dc1f1b4f..baa14ab49b6bb045df066107767c00805d88709a 100644 (file)
@@ -55,7 +55,7 @@ to select all logical volume segment columns.
 Use \fb-o help\fP to view the full list of columns available.
 .IP
 Column names include:
-lv_uuid, lv_name, lv_attr, lv_major, lv_minor, lv_read_ahead, lv_kernel_major,
+lv_uuid, lv_name, lv_path, lv_attr, lv_major, lv_minor, lv_read_ahead, lv_kernel_major,
 lv_kernel_minor, lv_kernel_read_ahead, lv_size, seg_count, origin, origin_size,
 snap_percent, copy_percent, move_pv, convert_lv, lv_tags, mirror_log, modules,
 segtype, stripes, stripesize, regionsize, chunksize, seg_start, seg_start_pe,
This page took 0.043965 seconds and 5 git commands to generate.