Permalink
Browse files

Merge pull request #12 from tmakatos/master

print error message instead of error number
  • Loading branch information...
2 parents e43e8a6 + 1165f1f commit 2a515138cb98145c105f20cab23e1974535f3a4e @andreil andreil committed Jul 24, 2012
Showing with 20 additions and 5 deletions.
  1. +12 −0 .gitignore
  2. +1 −1 control/tap-ctl-ipc.c
  3. +5 −2 drivers/tapdisk-control.c
  4. +2 −2 drivers/tapdisk-vbd.c
View
@@ -55,3 +55,15 @@ Makefile.in
# dist output
/blktap-*.tar.*
/blktap-*/
+
+# doxygen
+/html/
+
+# ctags
+tags
+
+# vim swap files
+*.swp
+
+# diff/patch
+*.orig
@@ -178,7 +178,7 @@ tap_ctl_connect(const char *name, int *sfd)
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd == -1) {
- EPRINTF("couldn't create socket for %s: %d\n", name, errno);
+ EPRINTF("couldn't create socket for %s: %s\n", name, strerror(errno));
return -errno;
}
@@ -814,15 +814,18 @@ tapdisk_control_close_image(struct tapdisk_ctl_conn *conn,
goto out;
}
+ if (td_flag_test(vbd->state, TD_VBD_PAUSED))
+ EPRINTF("warning: closing paused VBD %s", vbd->name);
+
if(vbd->nbdserver) {
tapdisk_nbdserver_pause(vbd->nbdserver);
}
do {
err = tapdisk_blktap_remove_device(vbd->tap);
- if (err == -EBUSY)
- tlog_write(TLOG_WARN, "device still open\n");
+ if (err == -EBUSY)
+ EPRINTF("device %s still open\n", vbd->name);
if (!err || err != -EBUSY)
break;
@@ -1017,10 +1017,10 @@ __tapdisk_vbd_complete_td_request(td_vbd_t *vbd, td_vbd_request_t *vreq,
if (!vreq->error &&
err != vreq->prev_error)
tlog_drv_error(image->driver, err,
- "req %s: %s 0x%04x secs @ 0x%08"PRIx64,
+ "req %s: %s 0x%04x secs @ 0x%08"PRIx64" - %s",
vreq->name,
(treq.op == TD_OP_WRITE ? "write" : "read"),
- treq.secs, treq.sec);
+ treq.secs, treq.sec, strerror(abs(err)));
vbd->errors++;
}
vreq->error = (vreq->error ? : err);

0 comments on commit 2a51513

Please sign in to comment.