Skip to content

Commit

Permalink
[cstor#125] Adding an option for zfs create command to take IP addres…
Browse files Browse the repository at this point in the history
…s as input

Signed-off-by: Jan Kryl <jan.kryl@cloudbyte.com>
  • Loading branch information
Jan Kryl authored and vishnuitta committed Apr 30, 2018
1 parent 638113e commit b09bcb7
Show file tree
Hide file tree
Showing 15 changed files with 1,858 additions and 1,000 deletions.
13 changes: 8 additions & 5 deletions cmd/uzfs_test/zrepl_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ zrepl_utest(void *arg)
reader_args.rebuild_test = B_FALSE;


sfd = create_and_bind(tgt_port, B_TRUE);
sfd = create_and_bind(tgt_port, B_TRUE, B_FALSE);
if (sfd == -1) {
return;
}
Expand Down Expand Up @@ -421,7 +421,7 @@ zrepl_utest(void *arg)
replica_io_addr.sin_addr.s_addr = inet_addr(mgmt_ack.ip);
replica_io_addr.sin_port = htons(mgmt_ack.port);
retry:
io_sfd = create_and_bind("", B_FALSE);
io_sfd = create_and_bind("", B_FALSE, B_FALSE);
if (io_sfd == -1) {
printf("Socket creation failed with errno:%d\n", errno);
goto start;
Expand All @@ -432,6 +432,7 @@ zrepl_utest(void *arg)
printf("Failed to connect to replica-IO port"
" with errno:%d\n", errno);
close(io_sfd);
sleep(1);
goto retry;
}
printf("Connect to replica IO port is successfully\n");
Expand Down Expand Up @@ -520,7 +521,7 @@ zrepl_rebuild_test(void *arg)
reader_args[1].max_iops = max_iops/2;
reader_args[1].rebuild_test = B_TRUE;

sfd = create_and_bind(tgt_port, B_TRUE);
sfd = create_and_bind(tgt_port, B_TRUE, B_FALSE);
if (sfd == -1) {
return;
}
Expand Down Expand Up @@ -596,7 +597,7 @@ zrepl_rebuild_test(void *arg)
replica_io_addr.sin_addr.s_addr = inet_addr(mgmt_ack->ip);
replica_io_addr.sin_port = htons(mgmt_ack->port);
retry:
io_sfd = create_and_bind("", B_FALSE);
io_sfd = create_and_bind("", B_FALSE, B_FALSE);
if (io_sfd == -1) {
printf("Socket creation failed with errno:%d\n", errno);
goto start;
Expand All @@ -607,13 +608,14 @@ zrepl_rebuild_test(void *arg)
printf("Failed to connect to replica-IO port"
" with errno:%d\n", errno);
close(io_sfd);
sleep(1);
goto retry;
}
printf("Connect to replica IO port is successfully\n");

writer_args.sfd[0] = reader_args[0].sfd[0] = io_sfd;

io_sfd1 = create_and_bind("", B_FALSE);
io_sfd1 = create_and_bind("", B_FALSE, B_FALSE);
if (io_sfd1 == -1) {
printf("Socket creation failed with errno:%d\n", errno);
goto start;
Expand All @@ -623,6 +625,7 @@ zrepl_rebuild_test(void *arg)
if (rc == -1) {
printf("Failed to connect to replica-IO port"
" with errno:%d\n", errno);
sleep(1);
close(io_sfd1);
goto retry;
}
Expand Down
6 changes: 5 additions & 1 deletion cmd/zrepl/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ DEFAULT_INCLUDES += \
sbin_PROGRAMS = zrepl

zrepl_SOURCES = \
zrepl.c
zrepl.c \
mgmt_conn.c \
data_conn.c

zrepl_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libuutil/libuutil.la \
$(top_builddir)/lib/libzpool/libzpool.la \
$(top_builddir)/lib/libzfs/libzfs.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la

EXTRA_DIST = data_conn.h mgmt_conn.h
Loading

0 comments on commit b09bcb7

Please sign in to comment.