summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2022-04-06 12:20:26 -0500
committerDavid Teigland <teigland@redhat.com>2022-06-09 14:33:29 -0500
commit4aa92f3e18cb49470ee9b5d928abe6b4c86f3074 (patch)
tree27b6c80d96869347cf0d32437409daa3fe8e1161
parent090dc0c320f0abee8ab79f4eaea6561c195b5009 (diff)
downloadlvm2-4aa92f3e18cb49470ee9b5d928abe6b4c86f3074.tar.gz
vgimportdevices: fix incorrect deviceidtype usage
When a VG has PVs with different device id types, it would try to use the idtype of the previous PV in the loop. This would produce an unncessary warning, or could lead to using the devname idtype when a better idtype is available.
-rw-r--r--tools/vgimportdevices.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/vgimportdevices.c b/tools/vgimportdevices.c
index 2580613c4..ea205d941 100644
--- a/tools/vgimportdevices.c
+++ b/tools/vgimportdevices.c
@@ -57,8 +57,7 @@ static int _vgimportdevices_single(struct cmd_context *cmd,
dm_list_iterate_items(pvl, &vg->pvs) {
pv = pvl->pv;
- if (!idtypestr && pv->device_id_type)
- idtypestr = pv->device_id_type;
+ idtypestr = pv->device_id_type;
memcpy(pvid, &pvl->pv->id.uuid, ID_LEN);
device_id_add(cmd, pv->dev, pvid, idtypestr, NULL);