[libvirt] [PATCH] Handle ENOTSUP from setfilecon on FUSE in LXC startup

From: "Daniel P. Berrange" <berrange@redhat.com> The setfilecon method can return ENOTSUP when trying to set the context of the /proc/meminfo FUSE filesystem. We must ignore this error and carry on, to prevent container startup failing entirely Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/lxc/lxc_container.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 48ccc09..9295d80 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -782,10 +782,15 @@ static int lxcContainerMountProcFuse(virDomainDefPtr def, ret = setfilecon(meminfo_path, scon); freecon(scon); if (ret < 0) { - virReportSystemError(errno, - _("Failed to set security context of %s for /proc/meminfo mount point"), - meminfo_path); - return ret; + if (errno == ENOTSUP) { + VIR_WARN("Setting security context of %s for /proc/meminfo not supported", + meminfo_path); + } else { + virReportSystemError(errno, + _("Failed to set security context of %s for /proc/meminfo mount point"), + meminfo_path); + return ret; + } } } # endif -- 1.8.2.1

On 05/16/2013 12:00 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The setfilecon method can return ENOTSUP when trying to set the context of the /proc/meminfo FUSE filesystem. We must ignore this error and carry on, to prevent container startup failing entirely
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/lxc/lxc_container.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, May 16, 2013 at 01:57:41PM -0600, Eric Blake wrote:
On 05/16/2013 12:00 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The setfilecon method can return ENOTSUP when trying to set the context of the /proc/meminfo FUSE filesystem. We must ignore this error and carry on, to prevent container startup failing entirely
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/lxc/lxc_container.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
ACK.
I have reverted the broken patch instead, since it seems it can't work at all. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
Eric Blake