qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block/sheepdog: add error handling to sd_snapshot_delete()
@ 2016-03-18  8:54 Takashi Menjo
  2016-03-18 16:17 ` Jeff Cody
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Menjo @ 2016-03-18  8:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: Hitoshi Mitake, Takashi Menjo, Jeff Cody, sheepdog,
	Vasiliy Tolstov

Errors have been ignored in some code paths in sd_snapshot_delete().
This patch adds error handling.

Signed-off-by: Takashi Menjo <menjo.takashi@lab.ntt.co.jp>
---
 block/sheepdog.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index a3aeae4..6492405 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2565,6 +2565,7 @@ static int sd_snapshot_delete(BlockDriverState *bs,
     SheepdogVdiRsp *rsp = (SheepdogVdiRsp *)&hdr;
 
     if (!remove_objects(s)) {
+        error_report("failed to discard snapshot inode");
         return -1;
     }
 
@@ -2588,6 +2589,7 @@ static int sd_snapshot_delete(BlockDriverState *bs,
     ret = find_vdi_name(s, s->name, snap_id, snap_tag, &vid, true,
                         &local_err);
     if (ret) {
+        error_report_err(local_err);
         return ret;
     }
 
@@ -2601,6 +2603,7 @@ static int sd_snapshot_delete(BlockDriverState *bs,
                  buf, &wlen, &rlen);
     closesocket(fd);
     if (ret) {
+        error_setg_errno(errp, -ret, "failed to delete %s", s->name);
         return ret;
     }
 
-- 
2.7.4.windows.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-22  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18  8:54 [Qemu-devel] [PATCH] block/sheepdog: add error handling to sd_snapshot_delete() Takashi Menjo
2016-03-18 16:17 ` Jeff Cody
2016-03-22  3:59   ` MENJO, Takashi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).