]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virdevmapper: Handle kernel without device-mapper support
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 18 Aug 2020 09:04:24 +0000 (11:04 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 18 Aug 2020 10:58:27 +0000 (12:58 +0200)
commitfeb8564a3cc63bc8f68284063d53ec0d2d81a1cc
treebeaeccdb40d538f996a549eb0e62bb8a0bbd8d63
parent82bb167f0d15b733b23931205be3488b83cb9ec6
virdevmapper: Handle kernel without device-mapper support

In one of my latest patch (v6.6.0~30) I was trying to remove
libdevmapper use in favor of our own implementation. However, the
code did not take into account that device mapper can be not
compiled into the kernel (e.g. be a separate module that's not
loaded) in which case /proc/devices won't have the device-mapper
major number and thus virDevMapperGetTargets() and/or
virIsDevMapperDevice() fails.

However, such failure is safe to ignore, because if device mapper
is missing then there can't be any multipath devices and thus we
don't need to allow the deps in CGroups, nor create them in the
domain private namespace, etc.

Fixes: 22494556542c676d1b9e7f1c1f2ea13ac17e1e3e
Reported-by: Andrea Bolognani <abologna@redhat.com>
Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
src/util/virdevmapper.c