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

Christian Ehrhardt christian.ehrhardt at canonical.com
Mon Aug 10 10:05:22 UTC 2020


On Thu, Aug 6, 2020 at 4:21 PM Andrea Bolognani <abologna at redhat.com> wrote:

> 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
>

FYI even having the module loaded isn't the ultimate workaround as
there is a further twist of the same issue.

Ubuntu has:
  CONFIG_BLK_DEV_DM_BUILTIN=y
  CONFIG_BLK_DEV_DM=y

And there is an entry in devices (in host and in the container)
  $ cat /proc/devices | grep map
  253 device-mapper

But libvirt 6.6 in this case running in a LXD system container
(working before) now fails related to this with what seems to be the
same high level symptom.

# virsh start kvmguest-groovy-normal3
error: Failed to start domain kvmguest-groovy-normal3
error: internal error: Process exited prior to exec: libvirt: QEMU
Driver error : Unable to get devmapper targets for
/var/lib/uvtool/libvirt/images/kvmguest-groovy-normal3.qcow: No such
file or directory



> --
> Andrea Bolognani / Red Hat / Virtualization
>
>

-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200810/40eedbfd/attachment-0001.htm>


More information about the libvir-list mailing list