#include "alias.h"
#include "prio.h"
#include "util.h"
+#include "uxsock.h"
extern int
setup_map (struct multipath * mpp, char * params, int params_size)
return 1; /* dead */
}
+int check_daemon(void)
+{
+ int fd;
+ char *reply;
+ size_t len;
+ int ret = 0;
+
+ fd = ux_socket_connect(DEFAULT_SOCKET);
+ if (fd == -1)
+ return 0;
+
+ if (send_packet(fd, "show daemon", 12) != 0)
+ goto out;
+ if (recv_packet(fd, &reply, &len) != 0)
+ goto out;
+
+ if (strstr(reply, "shutdown"))
+ goto out_free;
+
+ ret = 1;
+
+out_free:
+ FREE(reply);
+out:
+ close(fd);
+ return ret;
+}
+
extern int
coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, int force_reload)
{
if (r == DOMAP_DRY)
continue;
- if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF) {
+ if (!conf->daemon && !conf->allow_queueing && !check_daemon()) {
+ if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF &&
+ mpp->no_path_retry != NO_PATH_RETRY_FAIL)
+ condlog(3, "%s: multipathd not running, unset "
+ "queue_if_no_path feature", mpp->alias);
+ if (!dm_queue_if_no_path(mpp->alias, 0))
+ remove_feature(&mpp->features,
+ "queue_if_no_path");
+ }
+ else if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF) {
if (mpp->no_path_retry == NO_PATH_RETRY_FAIL) {
condlog(3, "%s: unset queue_if_no_path feature",
mpp->alias);
{
fprintf (stderr, VERSION_STRING);
fprintf (stderr, "Usage:\n");
- fprintf (stderr, " %s [-d] [-r] [-v lvl] [-p pol] [-b fil] [dev]\n", progname);
+ fprintf (stderr, " %s [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);
fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname);
fprintf (stderr, " %s -F [-v lvl]\n", progname);
fprintf (stderr, " %s -t\n", progname);
" -ll show multipath topology (maximum info)\n" \
" -f flush a multipath device map\n" \
" -F flush all multipath device maps\n" \
+ " -q allow queue_if_no_path when multipathd is not running\n"\
" -d dry run, do not create or update devmaps\n" \
" -t dump internal hardware table\n" \
" -r force devmap reload\n" \
condlog(0, "multipath tools need sysfs mounted");
exit(1);
}
- while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:Brt")) != EOF ) {
+ while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:Brtq")) != EOF ) {
switch(arg) {
case 1: printf("optarg : %s\n",optarg);
break;
case 'B':
conf->bindings_read_only = 1;
break;
+ case 'q':
+ conf->allow_queueing = 1;
+ break;
case 'd':
conf->dry_run = 1;
break;