diff mbox

[PULL,7/8] block/nfs: report errors from libnfs

Message ID 1395234727-6841-8-git-send-email-kwolf@redhat.com
State New
Headers show

Commit Message

Kevin Wolf March 19, 2014, 1:12 p.m. UTC
From: Peter Lieven <pl@kamp.de>

if an NFS operation fails we should report what libnfs knows
about the failure. It is likely more than just an error code.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/nfs.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/block/nfs.c b/block/nfs.c
index ef731f0..98aa363 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -112,6 +112,9 @@  nfs_co_generic_cb(int ret, struct nfs_context *nfs, void *data,
     if (task->ret == 0 && task->st) {
         memcpy(task->st, data, sizeof(struct stat));
     }
+    if (task->ret < 0) {
+        error_report("NFS Error: %s", nfs_get_error(nfs));
+    }
     if (task->co) {
         task->bh = qemu_bh_new(nfs_co_generic_bh_cb, task);
         qemu_bh_schedule(task->bh);