qemu_cgroup: Handle device mapper targets properly
qemu_cgroup: Handle device mapper targets properly

https://bugzilla.redhat.com/show_bug.cgi?id=1557769

Problem with device mapper targets is that there can be several
other devices 'hidden' behind them. For instance, /dev/dm-1 can
consist of /dev/sda, /dev/sdb and /dev/sdc. Therefore, when
setting up devices CGroup and namespaces we have to take this
into account.

This bug was exposed after Linux kernel was fixed. Initially,
kernel used different functions for getting block device in
open() and ioctl(). While CGroup permissions were checked in the
former case, due to a bug in kernel they were not checked in the
latter case. This changed with the upstream commit of
519049afead4f7c3e6446028c41e99fde958cc04 (v4.16-rc5~11^2~4).

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

eskultety/libvirt,crobinso/libvirt,libvirt/libvirt,olafhering/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,olafhering/libvirt,crobinso/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,crobinso/libvirt,nertpinx/libvirt,jfehlig/libvirt,jfehlig/libvirt,jfehlig/libvirt,andreabolognani/libvirt,libvirt/libvirt,libvirt/libvirt,andreabolognani/libvirt,jardasgit/libvirt,zippy2/libvirt,eskultety/libvirt,olafhering/libvirt,andreabolognani/libvirt,libvirt/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,crobinso/libvirt,eskultety/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,jardasgit/libvirt,zippy2/libvirt,nertpinx/libvirt,zippy2/libvirt,eskultety/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,olafhering/libvirt,eskultety/libvirt,nertpinx/libvirt,zippy2/libvirt,jfehlig/libvirt