]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: eliminate "Ignoring open failure" when using root-squash NFS
authorLaine Stump <laine@laine.org>
Thu, 12 Jan 2012 18:24:45 +0000 (13:24 -0500)
committerLaine Stump <laine@laine.org>
Fri, 3 Feb 2012 21:47:43 +0000 (16:47 -0500)
commitc18a88ac489c5356734bb7cff59f8fc73c9d1227
tree914febc3b3569a1a9950263a27932d020a9a58a2
parent90e4d681bc30074466912e9ae733b0bf0b9d5a03
qemu: eliminate "Ignoring open failure" when using root-squash NFS

This eliminates the warning message reported in:

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

It was caused by a failure to open an image file that is not
accessible by root (the uid libvirtd is running as) because it's on a
root-squash NFS share, owned by a different user, with permissions of
660 (or maybe 600).

The solution is to use virFileOpenAs() rather than open(). The
codepath that generates the error is during qemuSetupDiskCGroup(), but
the actual open() is in a lower-level generic function called from
many places (virDomainDiskDefForeachPath), so some other pieces of the
code were touched just to add dummy (or possibly useful) uid and gid
arguments.

Eliminating this warning message has the nice side effect that the
requested operation may even succeed (which in this case isn't
necessary, but shouldn't hurt anything either).
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_cgroup.c
src/security/security_dac.c
src/security/security_selinux.c
src/security/virt-aa-helper.c