[PATCH v2 1/2] virdevmapper: Don't cache device-mapper major

Peter Krempa pkrempa at redhat.com
Tue Aug 18 09:51:15 UTC 2020


On Tue, Aug 18, 2020 at 11:30:24 +0200, Michal Privoznik wrote:
> The device mapper major is needed in virIsDevMapperDevice() which
> determines whether given device is managed by device-mapper. This
> number is obtained by parsing /proc/devices and then stored in a
> global variable so that the file doesn't have to be parsed again.
> However, as it turns out this logic is flawed - the major number
> is not static and can change as it can be specified as a
> parameter when loading the dm-mod module.
> 
> Unfortunately, I was not able to come up with a good solution and
> thus the /proc/devices file is being parsed every time we need
> the device mapper major.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/util/virdevmapper.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)

Reviewed-by: Peter Krempa <pkrempa at redhat.com>




More information about the libvir-list mailing list