<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 6, 2020 at 4:21 PM Andrea Bolognani <<a href="mailto:abologna@redhat.com">abologna@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2020-08-06 at 15:45 +0200, Marc Hartmayer wrote:<br>
> On Tue, Aug 04, 2020 at 11:39 PM +0200, Andrea Bolognani <<a href="mailto:abologna@redhat.com" target="_blank">abologna@redhat.com</a>> wrote:<br>
> > This patch broke libvirt in Debian for certain setups.<br>
> > <br>
> > With AppArmor enabled (the default), the error is<br>
> > <br>
> >   $ virsh start cirros<br>
> >   error: Failed to start domain cirros<br>
> >   error: internal error: Process exited prior to exec: libvirt:<br>
> >   error : Cannot delete directory '/run/libvirt/qemu/<a href="http://1-cirros.dev" rel="noreferrer" target="_blank">1-cirros.dev</a>':<br>
> >   Device or resource busy<br>
> > <br>
> > If I disable AppArmor by passing security='' on the kernel command<br>
> > line, the error message changes to<br>
> > <br>
> >   $ virsh start cirros<br>
> >   error: Failed to start domain cirros<br>
> >   error: internal error: Process exited prior to exec: libvirt:<br>
> >   QEMU Driver error : Unable to get devmapper targets for<br>
> >   /var/lib/libvirt/images/cirros.qcow2: Success<br>
> > <br>
> > An effective workaround is to set namespaces=[] in qemu.conf, but<br>
> > that's of course not something that we want users doing :)<br>
> > <br>
> > The underlying issue seems to be caused by the fact that, on a Debian<br>
> > installation that uses plain partitions instead of LVM, /proc/devices<br>
> > doesn't contain an entry for device-mapper right after boot, which...<br>
> > ... this code expects.<br>
> > <br>
> > Running<br>
> > <br>
> >   $ sudo dmsetup info<br>
> >   No devices found<br>
> <br>
> We see the same problem as mentioned by Andrea. The host kernel<br>
> configuration used:<br>
> <br>
> …<br>
> CONFIG_BLK_DEV_DM_BUILTIN=y<br>
> CONFIG_BLK_DEV_DM=m<br>
> …<br>
> <br>
> As soon as we load the kernel module ‘dm-mod‘ everything works because<br>
> then ‘device-mapper‘ is listed in /proc/devices.<br>
<br>
Thanks Marc! I have confirmed that Debian also uses the same kernel<br>
configuration as the one you have reported above, and that running<br>
dmsetup(8) causes the dm-mod kernel module to be loaded.<br>
<br>
For comparison Fedora, where everything works fine, uses<br>
<br>
  CONFIG_BLK_DEV_DM_BUILTIN=y<br>
  CONFIG_BLK_DEV_DM=y<br></blockquote><div><br></div><div><pre class="gmail-bz_comment_text" id="gmail-comment_text_2" style="white-space:pre-wrap;margin:1em;padding-bottom:1em;color:rgb(0,0,0)">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</pre></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br>
Andrea Bolognani / Red Hat / Virtualization<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Christian Ehrhardt<br>Staff Engineer, Ubuntu Server<br>Canonical Ltd</div></div>