From f9f75de3da98e0f6f43d46539e4c17781d209478 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Tue, 25 Jul 2017 12:22:46 +0100 Subject: [PATCH] dmsetup: Add minor number to concise table output format. When using this new format for input, it'll sometimes help to be able to specify the minor number. --- man/dmsetup.8_main | 6 +++--- tools/dmsetup.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/man/dmsetup.8_main b/man/dmsetup.8_main index 1d0219f61..c218f6cae 100644 --- a/man/dmsetup.8_main +++ b/man/dmsetup.8_main @@ -826,9 +826,9 @@ 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. +Commas then separate the name, uuid, minor device number, flags ('ro' or 'rw') +and the table (if present). Semi-colons separate devices. Backslashes escape +any commas, semi-colons or backslashes. . .HP .CMD_TARGETS diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 3514fc58d..e92ba172a 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -2224,8 +2224,7 @@ static int _status(CMD_ARGS) _print_string_quoted(name); putchar(','); _print_string_quoted(dm_task_get_uuid(dmt)); - putchar(','); - printf("%s", info.read_only ? "ro" : "rw"); + printf(",%u,%s", info.minor, info.read_only ? "ro" : "rw"); } /* Next print any target-specific information */ if (target_type) {