1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Remove dev name prefix from dmsetup line output if exactly one dev requested.

This commit is contained in:
Alasdair Kergon 2011-07-08 17:08:19 +00:00
parent 1485b6fc93
commit 3151e0995a
2 changed files with 6 additions and 11 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.65 - Version 1.02.65 -
================================== ==================================
Remove dev name prefix from dmsetup line output if exactly one dev requested.
Report internal error if suspending a device using an already-suspended dev. Report internal error if suspending a device using an already-suspended dev.
Add dmsetup --checks and dm_task_enable_checks framework to validate ioctls. Add dmsetup --checks and dm_task_enable_checks framework to validate ioctls.
Add age_in_minutes parameter to dmsetup udevcomplete_all. Add age_in_minutes parameter to dmsetup udevcomplete_all.

View File

@ -1413,10 +1413,7 @@ static int _error_device(CMD_ARGS)
uint64_t size; uint64_t size;
int r = 0; int r = 0;
if (names) name = names ? names->name : argv[1];
name = names->name;
else
name = argv[1];
size = _get_device_size(name); size = _get_device_size(name);
@ -1592,8 +1589,7 @@ static int _status(CMD_ARGS)
else { else {
if (argc == 1 && !_switches[UUID_ARG] && !_switches[MAJOR_ARG]) if (argc == 1 && !_switches[UUID_ARG] && !_switches[MAJOR_ARG])
return _process_all(cmd, argc, argv, 0, _status); return _process_all(cmd, argc, argv, 0, _status);
if (multiple_devices) name = argv[1];
name = argv[1];
} }
if (!strcmp(cmd->name, "table")) if (!strcmp(cmd->name, "table"))
@ -1729,8 +1725,7 @@ static int _info(CMD_ARGS)
else { else {
if (argc == 1 && !_switches[UUID_ARG] && !_switches[MAJOR_ARG]) if (argc == 1 && !_switches[UUID_ARG] && !_switches[MAJOR_ARG])
return _process_all(cmd, argc, argv, 0, _info); return _process_all(cmd, argc, argv, 0, _info);
if (multiple_devices) name = argv[1];
name = argv[1];
} }
if (!(dmt = dm_task_create(DM_DEVICE_INFO))) if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
@ -1772,8 +1767,7 @@ static int _deps(CMD_ARGS)
else { else {
if (argc == 1 && !_switches[UUID_ARG] && !_switches[MAJOR_ARG]) if (argc == 1 && !_switches[UUID_ARG] && !_switches[MAJOR_ARG])
return _process_all(cmd, argc, argv, 0, _deps); return _process_all(cmd, argc, argv, 0, _deps);
if (multiple_devices) name = argv[1];
name = argv[1];
} }
if (!(dmt = dm_task_create(DM_DEVICE_DEPS))) if (!(dmt = dm_task_create(DM_DEVICE_DEPS)))
@ -3482,7 +3476,7 @@ int main(int argc, char **argv)
#endif #endif
doit: doit:
multiple_devices = (argc > 1); multiple_devices = (argc != 2 && cmd->repeatable_cmd);
do { do {
if (!cmd->fn(cmd, argc--, argv++, NULL, multiple_devices)) { if (!cmd->fn(cmd, argc--, argv++, NULL, multiple_devices)) {
fprintf(stderr, "Command failed\n"); fprintf(stderr, "Command failed\n");