Fix LXC from throwing error System lacks NETNS support (bz #1084902)

This commit is contained in:
Cole Robinson 2014-04-11 15:53:56 -04:00
parent 8df3aef6aa
commit 810ca6c207
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,33 @@
From 21ec87f4f1a538f929c48ecb2bdbf48701022779 Mon Sep 17 00:00:00 2001
Message-Id: <21ec87f4f1a538f929c48ecb2bdbf48701022779.1397245564.git.crobinso@redhat.com>
From: Richard Weinberger <richard@nod.at>
Date: Tue, 8 Apr 2014 14:26:26 +0200
Subject: [PATCH] LXC: Fix return code evaulation in lxcCheckNetNsSupport()
Commit b9dd878f (util: make it easier to grab only regular command exit)
changed the call semantics of virCommandRun() and therefore of virRun()
too. But lxcCheckNetNsSupport() was not updated.
As consequence of this lxcCheckNetNsSupport always failed and broke LXC.
Signed-off-by: Richard Weinberger <richard@nod.at>
---
src/lxc/lxc_driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 33ff011..942e139 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1475,8 +1475,7 @@ static int lxcCheckNetNsSupport(void)
const char *argv[] = {"ip", "link", "set", "lo", "netns", "-1", NULL};
int ip_rc;
- if (virRun(argv, &ip_rc) < 0 ||
- !(WIFEXITED(ip_rc) && (WEXITSTATUS(ip_rc) != 255)))
+ if (virRun(argv, &ip_rc) < 0 || ip_rc == 255)
return 0;
if (lxcContainerAvailable(LXC_CONTAINER_FEATURE_NET) < 0)
--
1.9.0

View File

@ -388,7 +388,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 1.2.3
Release: 1%{?dist}%{?extra_release}
Release: 2%{?dist}%{?extra_release}
License: LGPLv2+
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@ -399,6 +399,9 @@ URL: http://libvirt.org/
%endif
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz
# Fix LXC from throwing error System lacks NETNS support (bz #1084902)
Patch0001: 0001-LXC-Fix-return-code-evaulation-in-lxcCheckNetNsSuppo.patch
%if %{with_libvirtd}
Requires: libvirt-daemon = %{version}-%{release}
%if %{with_network}
@ -1206,6 +1209,9 @@ driver
%prep
%setup -q
# Fix LXC from throwing error System lacks NETNS support (bz #1084902)
%patch0001 -p1
%build
%if ! %{with_xen}
%define _without_xen --without-xen
@ -2220,6 +2226,9 @@ exit 0
%doc examples/systemtap
%changelog
* Fri Apr 11 2014 Cole Robinson <crobinso@redhat.com> - 1.2.3-2
- Fix LXC from throwing error System lacks NETNS support (bz #1084902)
* Tue Apr 01 2014 Cole Robinson <crobinso@redhat.com> - 1.2.3-1
- Rebased to version 1.2.3