[libvirt] [PATCH] lxc: do not require 'ifconfig' or 'ipconfig' in container
Eric Blake
eblake at redhat.com
Fri Sep 2 02:18:40 UTC 2011
On 09/01/2011 03:02 AM, Daniel P. Berrange wrote:
> On Wed, Aug 31, 2011 at 02:02:10PM -0500, Serge Hallyn wrote:
>> Quoting Scott Moser (smoser at ubuntu.com):
>>> Currently, the lxc implementation invokes 'ip' and 'ifconfig' commands
>>> inside a container using 'virRun'. That has the side effect of requiring
>>> those commands to be present and to function in a manner consistent with
>>> the usage. Some small roots (such as ttylinux) may not have 'ip' or
>>> 'ifconfig'.
>>>
>
> ACK
>> +
>> + close(fd);
That fails 'make syntax-check'. Pushed as modified:
diff --git i/src/lxc/veth.c w/src/lxc/veth.c
index c24df91..e4db65c 100644
--- i/src/lxc/veth.c
+++ w/src/lxc/veth.c
@@ -1,7 +1,7 @@
/*
* veth.c: Tools for managing veth pairs
*
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright IBM Corp. 2008
*
* See COPYING.LIB for the License of this software
@@ -26,6 +26,7 @@
#include "memory.h"
#include "command.h"
#include "virterror_internal.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_LXC
@@ -217,7 +218,7 @@ int vethInterfaceUpOrDown(const char* veth, int
upOrDown)
ret = ioctl(fd, SIOCSIFFLAGS, &ifr);
}
- close(fd);
+ VIR_FORCE_CLOSE(fd);
if (ret == -1)
if (upOrDown == 0)
/*
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
More information about the libvir-list
mailing list