diff options
author | Karel Zak | 2012-01-09 23:22:04 +0100 |
---|---|---|
committer | Karel Zak | 2012-01-09 23:28:50 +0100 |
commit | d356c5d238a40c45968550bfb7714297dd0e4461 (patch) | |
tree | 9bf3d3969e39a8011902d86cb02be286d76130b3 /lib | |
parent | loopdev: support LO_FLAGS_PARTSCAN flag (kernel 3.2) (diff) | |
download | kernel-qcow2-util-linux-d356c5d238a40c45968550bfb7714297dd0e4461.tar.gz kernel-qcow2-util-linux-d356c5d238a40c45968550bfb7714297dd0e4461.tar.xz kernel-qcow2-util-linux-d356c5d238a40c45968550bfb7714297dd0e4461.zip |
loopdev: improve debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/loopdev.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c index d83124032..2035d2314 100644 --- a/lib/loopdev.c +++ b/lib/loopdev.c @@ -110,11 +110,10 @@ int loopcxt_set_device(struct loopdev_cxt *lc, const char *device) strncpy(lc->device, device, sizeof(lc->device)); lc->device[sizeof(lc->device) - 1] = '\0'; } + DBG(lc, loopdev_debug("%s successfully assigned", device)); } sysfs_deinit(&lc->sysfs); - - DBG(lc, loopdev_debug("%s successfully set", device)); return 0; } @@ -1061,6 +1060,7 @@ int loopcxt_setup_device(struct loopdev_cxt *lc) return -errno; } } + DBG(lc, loopdev_debug("setup: backing file open: OK")); if (lc->fd != -1 && lc->mode != mode) { close(lc->fd); @@ -1083,6 +1083,8 @@ int loopcxt_setup_device(struct loopdev_cxt *lc) goto err; } + DBG(lc, loopdev_debug("setup: device open: OK")); + /* * Set FD */ @@ -1091,6 +1093,9 @@ int loopcxt_setup_device(struct loopdev_cxt *lc) DBG(lc, loopdev_debug("LOOP_SET_FD failed: %m")); goto err; } + + DBG(lc, loopdev_debug("setup: LOOP_SET_FD: OK")); + close(file_fd); file_fd = -1; @@ -1098,6 +1103,9 @@ int loopcxt_setup_device(struct loopdev_cxt *lc) DBG(lc, loopdev_debug("LOOP_SET_STATUS64 failed: %m")); goto err; } + + DBG(lc, loopdev_debug("setup: LOOP_SET_STATUS64: OK")); + memset(&lc->info, 0, sizeof(lc->info)); lc->has_info = 0; lc->info_failed = 0; |