qemu_namespace: Be tolerant to non-existent files when populating /dev
qemu_namespace: Be tolerant to non-existent files when populating /dev

In 6.7.0 release I've changed how domain namespace is built and
populated. Previously it used to be done from a pre-exec hook
(ran in the forked off child, just before dropping all privileges
and exec()-ing QEMU), which not only meant we had to have two
different code paths for creating a node in domain's namespace
(one for this pre-exec hook, the other for hotplug ran from the
daemon), it also proved problematic because it was leaking FDs
into QEMU process.

To mitigate this problem, we've not only ditched libdevmapper
from the NS population process, I've also dropped the pre-exec
code and let the NS be populated from the daemon (using the
hotplug code). But, I was not careful when doing so, because the
pre-exec code was tolerant to files that doesn't exist, while
this new code isn't. For instance, the very first thing that is
done when the new NS is created is it's populated with
@defaultDeviceACL which contain files like /dev/null, /dev/zero,
/dev/random and /dev/kvm (and others).  While the rest will
probably exist every time, /dev/kvm might not and thus the new
code I wrote has to be tolerant to that.

Of course, users can override the @defaultDeviceACL (by setting
cgroup_device_acl in qemu.conf) and remove /dev/kvm (which is
acceptable workaround), but we definitely want libvirt to work
out of the box even on hosts without KVM.

Fixes: 9048dc4e627ddf33996084167bece7b5fb83b0bc
Reported-by: Daniel P. Berrangé <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>
Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Daniel P. Berrangé <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

crobinso/libvirt,crobinso/libvirt,jardasgit/libvirt,jfehlig/libvirt,nertpinx/libvirt,libvirt/libvirt,nertpinx/libvirt,libvirt/libvirt,zippy2/libvirt,olafhering/libvirt,jardasgit/libvirt,libvirt/libvirt,olafhering/libvirt,zippy2/libvirt,libvirt/libvirt,zippy2/libvirt,olafhering/libvirt,nertpinx/libvirt,olafhering/libvirt,jardasgit/libvirt,jfehlig/libvirt,jfehlig/libvirt,jardasgit/libvirt,zippy2/libvirt,crobinso/libvirt,jardasgit/libvirt,nertpinx/libvirt,crobinso/libvirt,jfehlig/libvirt,nertpinx/libvirt