[KERNEL_RELEASE="${withval}"],
[KERNEL_RELEASE=`uname -r`])
-AX_COMPARE_VERSION([$KERNEL_RELEASE], [ge], [2.6.29],
- AC_MSG_NOTICE([network autodestroy: yes]),
- AC_MSG_NOTICE([network autodestroy: no]))
-
-if test ${ax_compare_version} != "true"; then
- CFLAGS="$CFLAGS -DNETWORK_DESTROY"
-fi
-
AC_ARG_ENABLE(test, [ --enable-test compile test program [default=no]],, enable_test=no)
AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes)
return 0;
}
-#ifdef NETWORK_DESTROY
-static int delete_netdev_cb(const char *name, const char *directory,
- const char *file, void *data)
-{
- char strindex[MAXINDEXLEN];
- char path[MAXPATHLEN];
- char ifname[IFNAMSIZ];
- int i, ifindex;
-
- snprintf(path, MAXPATHLEN, "%s/%s", directory, file);
-
- if (read_info(path, "ifindex", strindex, MAXINDEXLEN)) {
- ERROR("failed to read ifindex info");
- return -1;
- }
-
- ifindex = atoi(strindex);
- if (!ifindex)
- return 0;
-
- /* TODO : temporary code - needs wait on namespace */
- for (i = 0; i < 120; i++) {
- if (if_indextoname(ifindex, ifname))
- break;
- if (!i)
- printf("waiting for interface #%d to come back\n", ifindex);
- else
- printf("."); fflush(stdout);
- sleep(1);
- }
-
- /* do not delete a physical network device */
- if (strncmp("phys", file, strlen("phys")))
- if (lxc_device_delete(ifname)) {
- ERROR("failed to remove the netdev %s", ifname);
- }
-
- delete_info(path, "ifindex");
-
- return 0;
-}
-#endif
-
-int conf_destroy_network(const char *name)
-{
-#ifdef NETWORK_DESTROY
- char directory[MAXPATHLEN];
-
- snprintf(directory, MAXPATHLEN, LXCPATH "/%s/network", name);
-
- if (lxc_dir_for_each(name, directory, delete_netdev_cb, NULL)) {
- ERROR("failed to remove the network devices");
- return -1;
- }
-#endif
- return 0;
-}
-
int lxc_create_tty(const char *name, struct lxc_tty_info *tty_info)
{
char path[MAXPATHLEN];