1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00

lvmdevices: allow deviceidtype with addpvid

in addition to using with adddev
This commit is contained in:
David Teigland 2021-09-13 14:11:07 -05:00
parent 9857b5a3dc
commit 8935dfee56
2 changed files with 4 additions and 2 deletions

View File

@ -1439,6 +1439,7 @@ ID: lvmdevices_edit
DESC: Remove a device from the devices file.
lvmdevices --addpvid String
OO: --deviceidtype String
ID: lvmdevices_edit
DESC: Find the device with the given PVID and add it to the devices file.

View File

@ -127,6 +127,7 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
struct device_list *devl;
struct device *dev;
struct dev_use *du, *du2;
const char *deviceidtype;
int changes = 0;
dm_list_init(&search_pvids);
@ -269,7 +270,6 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
if (arg_is_set(cmd, adddev_ARG)) {
const char *devname;
const char *deviceidtype;
if (!(devname = arg_str_value(cmd, adddev_ARG, NULL)))
goto_bad;
@ -366,7 +366,8 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
goto bad;
}
dm_list_iterate_items(devl, &found_devs) {
if (!device_id_add(cmd, devl->dev, devl->dev->pvid, NULL, NULL))
deviceidtype = arg_str_value(cmd, deviceidtype_ARG, NULL);
if (!device_id_add(cmd, devl->dev, devl->dev->pvid, deviceidtype, NULL))
goto_bad;
}
if (!device_ids_write(cmd))