]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
LXC: Fix return code evaulation in lxcCheckNetNsSupport()
authorRichard Weinberger <richard@nod.at>
Tue, 8 Apr 2014 12:26:26 +0000 (14:26 +0200)
committerEric Blake <eblake@redhat.com>
Tue, 8 Apr 2014 15:19:24 +0000 (09:19 -0600)
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

index 33ff011857a576108ac2f0ba52c54c3fe1f9ce14..942e1392cd02a39367aebfd0788be535e77f7c7f 100644 (file)
@@ -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)