[PATCH 3/4] virdevmapper: Don't use libdevmapper to obtain dependencies

Andrea Bolognani abologna at redhat.com
Thu Aug 6 14:17:27 UTC 2020


On Thu, 2020-08-06 at 15:45 +0200, Marc Hartmayer wrote:
> On Tue, Aug 04, 2020 at 11:39 PM +0200, Andrea Bolognani <abologna at redhat.com> wrote:
> > This patch broke libvirt in Debian for certain setups.
> > 
> > With AppArmor enabled (the default), the error is
> > 
> >   $ virsh start cirros
> >   error: Failed to start domain cirros
> >   error: internal error: Process exited prior to exec: libvirt:
> >   error : Cannot delete directory '/run/libvirt/qemu/1-cirros.dev':
> >   Device or resource busy
> > 
> > If I disable AppArmor by passing security='' on the kernel command
> > line, the error message changes to
> > 
> >   $ virsh start cirros
> >   error: Failed to start domain cirros
> >   error: internal error: Process exited prior to exec: libvirt:
> >   QEMU Driver error : Unable to get devmapper targets for
> >   /var/lib/libvirt/images/cirros.qcow2: Success
> > 
> > An effective workaround is to set namespaces=[] in qemu.conf, but
> > that's of course not something that we want users doing :)
> > 
> > The underlying issue seems to be caused by the fact that, on a Debian
> > installation that uses plain partitions instead of LVM, /proc/devices
> > doesn't contain an entry for device-mapper right after boot, which...
> > ... this code expects.
> > 
> > Running
> > 
> >   $ sudo dmsetup info
> >   No devices found
> 
> We see the same problem as mentioned by Andrea. The host kernel
> configuration used:
> 
>> CONFIG_BLK_DEV_DM_BUILTIN=y
> CONFIG_BLK_DEV_DM=m
>> 
> As soon as we load the kernel module ‘dm-mod‘ everything works because
> then ‘device-mapper‘ is listed in /proc/devices.

Thanks Marc! I have confirmed that Debian also uses the same kernel
configuration as the one you have reported above, and that running
dmsetup(8) causes the dm-mod kernel module to be loaded.

For comparison Fedora, where everything works fine, uses

  CONFIG_BLK_DEV_DM_BUILTIN=y
  CONFIG_BLK_DEV_DM=y

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list