diff options
author | David Teigland <teigland@redhat.com> | 2021-06-22 13:36:10 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2021-06-22 13:36:10 -0500 |
commit | 1139a05939f85bd86a756b451a8f194bc7a72a2c (patch) | |
tree | 5e71c40b112ae83c0f360b99f184c31e309db7f7 | |
parent | c35f7722d588009edad22d59c68c82150bb5c216 (diff) | |
download | lvm2-1139a05939f85bd86a756b451a8f194bc7a72a2c.tar.gz |
device_id: handle scsi_debug wwid
Ignore the wwid value reported by scsi_debug devices
that begin "t10.Linux scsi_debug". The devname
will be used as the device id.
-rw-r--r-- | lib/device/device_id.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/device/device_id.c b/lib/device/device_id.c index 65912b9b6..ffeac3064 100644 --- a/lib/device/device_id.c +++ b/lib/device/device_id.c @@ -308,6 +308,10 @@ const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, u if (!sysbuf[0]) _read_sys_block(cmd, dev, "wwid", sysbuf, sizeof(sysbuf)); + + /* scsi_debug wwid begins "t10.Linux scsi_debug ..." */ + if (strstr(sysbuf, "scsi_debug")) + sysbuf[0] = '\0'; } else if (idtype == DEV_ID_TYPE_SYS_SERIAL) |