Michal Privoznik d53ab9f54e virDevMapperGetTargetsImpl: Check for dm major properly
In v6.4.0-rc1~143 I've introduced a check that is supposed to
return from the function early, if given path is not a dm target.
While the idea is still valid, the implementation had a flaw.
It calls stat() over given path and the uses major(sb.st_dev) to
learn the major of the device. This is then passed to
dm_is_dm_major() which returns true or false depending whether
the device is under devmapper's control or not.

The problem with this approach is in how the major of the device
is obtained - paths managed by devmapper are special files and
thus we want to be using st_rdev instead of st_dev to obtain the
major number. Well, that's what virIsDevMapperDevice() does
already so might as well us that.

Fixes: 01626c668ecfbe465d18799ac4628e6127ea1d47
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1839992

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2020-06-15 14:50:46 +02:00
..
2020-02-24 23:15:49 +01:00
2020-01-30 12:32:03 +01:00
2019-10-16 12:06:44 +02:00
2019-10-16 12:06:44 +02:00
2019-11-15 12:58:00 +01:00
2020-02-03 19:44:38 +01:00
2020-02-03 19:44:38 +01:00
2020-05-05 11:19:34 +02:00
2019-11-12 17:54:01 +01:00
2020-03-13 17:26:55 +01:00
2020-03-13 17:26:55 +01:00
2020-02-24 23:15:49 +01:00
2019-10-16 12:06:44 +02:00
2020-02-24 23:15:49 +01:00
2020-02-24 17:25:07 +00:00
2020-02-24 17:25:07 +00:00
2020-02-24 20:25:48 +01:00
2020-05-05 11:19:34 +02:00
2020-04-23 12:49:30 +02:00
2020-02-24 23:15:49 +01:00
2019-10-16 12:06:44 +02:00
2020-05-05 13:08:57 +02:00
2020-02-24 23:15:50 +01:00
2019-12-17 10:04:43 +01:00
2020-03-13 17:26:55 +01:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:49 +01:00
2020-05-05 11:19:34 +02:00
2020-02-24 23:15:49 +01:00
2019-10-16 12:06:44 +02:00
2020-05-05 11:19:34 +02:00
2020-02-02 16:36:58 +01:00
2019-10-16 12:06:44 +02:00
2020-03-05 12:23:02 +00:00
2020-05-05 13:08:57 +02:00
2020-05-05 13:08:57 +02:00
2020-02-24 23:15:49 +01:00
2019-10-16 12:06:44 +02:00
2020-06-03 21:06:02 +02:00