Skip to contentSkip to conversation

master - dmsetup: Add concise table output format.

PATCH Alasdair Kergon 1 participant 1 message Jul 25, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5fd7c0aa3340a58318d0bcfb0ae5aeb9924881f6
Commit:        5fd7c0aa3340a58318d0bcfb0ae5aeb9924881f6
Parent:        ca71ad0d5025d2d01eb9666368c1da7db3c9c7ce
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Tue Jul 25 01:13:14 2017 +0100
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Tue Jul 25 01:13:14 2017 +0100

dmsetup: Add concise table output format.

Create a new table output format that concisely shows multiple devices on one line.

dmsetup table --concise [device...]

<dev_name>,<uuid>,<flags>[,<table>]*[;<dev_name>,<uuid>,<flags>[,<table>]*]*

Table lines are separated by commas.
Devices are separated by semi-colons.
Flags is currently 'ro' or 'rw' (and might be extended in a yet-to-be-defined way in future).
Any comma, semi-colon or backslash within a field is quoted by a preceding backslash.

The format can later be supplied as input to dmsetup or even to the booting kernel as an alternative way to set up devices.

Based on patches submitted by
Enric Balletbo i Serra <[email protected]>.

---
 WHATS_NEW_DM       |    1 +
 man/dmsetup.8_main |    5 +++
 tools/dmsetup.c    |   74 ++++++++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 69 insertions(+), 11 deletions(-)
WHATS_NEW_DM +1 -0
index 7007c95..c41bcfd 100644
@@ -1,5 +1,6 @@
 Version 1.02.143 - 
 =================================
+  Introduce single-line concise table output format: dmsetup table --concise
 
 Version 1.02.142 - 20th July 2017
 =================================
man/dmsetup.8_main +5 -0
index 4421882..1d0219f 100644
@@ -269,6 +269,7 @@ dmsetup \(em low level logical volume management
 .de CMD_TABLE
 .  ad l
 .  BR table
+.  RB [ --concise ]
 .  RB [ --target
 .  IR target_type ]
 .  RB [ --showkeys ]
@@ -824,6 +825,10 @@ Real encryption keys are suppressed in the table output for the crypt
 target unless the \fB--showkeys\fP parameter is supplied. Kernel key
 references prefixed with \fB:\fP are not affected by the parameter and get
 displayed always.
+With \fB--concise\fP, the output is presented concisely on a single line.
+Commas then separate the name, uuid, flags ('ro' or 'rw') and the table
+(if present). Semi-colons separate devices. Backslashes escape any commas,
+semi-colons or backslashes.
 .
 .HP
 .CMD_TARGETS
tools/dmsetup.c +63 -11

152 lines not on this page · raw message