Skip to content

Commit

Permalink
CA-285194: ensure that tapdisk logs if it exits and also on opening i…
Browse files Browse the repository at this point in the history
…ts control

Signed-off-by: Mark Syms <mark.syms@citrix.com>
Reviewed-by: Stefano Panella <stefano.panella@citrix.com>
  • Loading branch information
MarkSymsCtx committed May 25, 2018
1 parent 4aa556d commit 2c3d028
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/tapdisk-log.c
Expand Up @@ -212,6 +212,7 @@ tlog_open(const char *name, int facility, int level)
return 0;

fail:
EPRINTF("tapdisk-log: failed %d\n", errno);
tlog_close();
return err;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/tapdisk-server.c
Expand Up @@ -807,6 +807,8 @@ tapdisk_server_run()

server.tlog_reopen_evid = err;

err = 0;

__tapdisk_server_run();

out:
Expand Down
5 changes: 5 additions & 0 deletions drivers/tapdisk2.c
Expand Up @@ -140,6 +140,8 @@ main(int argc, char *argv[])
goto out;
}

DPRINTF("Tapdisk running, control on %s\n", control);

fprintf(out, "%s\n", control);
fclose(out);

Expand All @@ -158,6 +160,9 @@ main(int argc, char *argv[])
err = tapdisk_server_run();

out:
if (err) {
EPRINTF("Tapdisk exiting with error %d\n", err);
}
td_metrics_stop();
tdnbd_fdreceiver_stop();
tapdisk_control_close();
Expand Down

0 comments on commit 2c3d028

Please sign in to comment.