with_device_uid
with_device_gid
with_device_mode
+with_device_nodes_on
enable_lvm1_fallback
with_lvm1
with_pool
--with-device-uid=UID set the owner used for new device nodes [[UID=0]]
--with-device-gid=GID set the group used for new device nodes [[GID=0]]
--with-device-mode=MODE set the mode used for new device nodes [[MODE=0600]]
+ --with-device-nodes-on=ON
+ create nodes on resume or create [[ON=resume]]
--with-lvm1=TYPE LVM1 metadata support: internal/shared/none
[[TYPE=internal]]
--with-pool=TYPE GFS pool read-only support: internal/shared/none
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DM_DEVICE_MODE" >&5
$as_echo "$DM_DEVICE_MODE" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking when to create device nodes" >&5
+$as_echo_n "checking when to create device nodes... " >&6; }
+
+# Check whether --with-device-nodes-on was given.
+if test "${with_device_nodes_on+set}" = set; then :
+ withval=$with_device_nodes_on; ADD_NODE=$withval
+else
+ ADD_NODE=resume
+fi
+
+case "$ADD_NODE" in
+ resume) add_on=DM_ADD_NODE_ON_RESUME;;
+ create) add_on=DM_ADD_NODE_ON_CREATE;;
+ *) as_fn_error $? "--with-device-nodes-on parameter invalid" "$LINENO" 5;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: on $ADD_NODE" >&5
+$as_echo "on $ADD_NODE" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_DM_ADD_NODE $add_on
+_ACEOF
+
+
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable lvm1 fallback" >&5
$as_echo_n "checking whether to enable lvm1 fallback... " >&6; }
DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600)
AC_MSG_RESULT($DM_DEVICE_MODE)
+AC_MSG_CHECKING(when to create device nodes)
+AC_ARG_WITH(device-nodes-on,
+ AC_HELP_STRING([--with-device-nodes-on=ON],
+ [create nodes on resume or create [[ON=resume]]]),
+ ADD_NODE=$withval, ADD_NODE=resume)
+case "$ADD_NODE" in
+ resume) add_on=DM_ADD_NODE_ON_RESUME;;
+ create) add_on=DM_ADD_NODE_ON_CREATE;;
+ *) AC_MSG_ERROR([--with-device-nodes-on parameter invalid]);;
+esac
+AC_MSG_RESULT(on $ADD_NODE)
+AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
+
################################################################################
dnl -- LVM1 tool fallback option
AC_MSG_CHECKING(whether to enable lvm1 fallback)
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
* Copyright (C) 2005-2007 NEC Corporation
*
* This file is part of the device-mapper userspace tools.
return 1;
}
+static int _set_task_add_node(struct dm_task *dmt)
+{
+ if (!dm_task_set_add_node(dmt, DEFAULT_DM_ADD_NODE))
+ return 0;
+
+ if (_switches[ADD_NODE_ON_RESUME_ARG] &&
+ !dm_task_set_add_node(dmt, DM_ADD_NODE_ON_RESUME))
+ return 0;
+
+ if (_switches[ADD_NODE_ON_CREATE_ARG] &&
+ !dm_task_set_add_node(dmt, DM_ADD_NODE_ON_CREATE))
+ return 0;
+
+ return 1;
+}
+
static int _load(int argc, char **argv, void *data __attribute__((unused)))
{
int r = 0;
udev_flags |= DM_UDEV_DISABLE_DM_RULES_FLAG |
DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG;
- if (_switches[ADD_NODE_ON_RESUME_ARG] &&
- !dm_task_set_add_node(dmt, DM_ADD_NODE_ON_RESUME))
- goto out;
- if (_switches[ADD_NODE_ON_CREATE_ARG] &&
- !dm_task_set_add_node(dmt, DM_ADD_NODE_ON_CREATE))
- goto out;
+ if (!_set_task_add_node(dmt))
+ goto out;
if (_udev_cookie) {
cookie = _udev_cookie;
if (_switches[NOLOCKFS_ARG] && !dm_task_skip_lockfs(dmt))
goto out;
+ /* FIXME: needs to coperate with udev */
+ if (!_set_task_add_node(dmt))
+ goto out;
+
if (_switches[READAHEAD_ARG] &&
!dm_task_set_read_ahead(dmt, _int_args[READAHEAD_ARG],
_read_ahead_flags))
{"remove", "[-f|--force] <device>", 0, 1, _remove},
{"remove_all", "[-f|--force]", 0, 0, _remove_all},
{"suspend", "[--noflush] <device>", 0, 1, _suspend},
- {"resume", "<device>", 0, 1, _resume},
+ {"resume", "<device> [{--addnodeonresume|--addnodeoncreate}]", 0, 1, _resume},
{"load", "<device> [<table_file>]", 0, 2, _load},
{"clear", "<device>", 0, 1, _clear},
{"reload", "<device> [<table_file>]", 0, 2, _load},