qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Menjo <menjo.takashi@lab.ntt.co.jp>
To: qemu-devel@nongnu.org
Cc: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>,
	Takashi Menjo <menjo.takashi@lab.ntt.co.jp>,
	Jeff Cody <jcody@redhat.com>,
	sheepdog@lists.wpkg.org, Vasiliy Tolstov <v.tolstov@selfip.ru>
Subject: [Qemu-devel] [PATCH] block/sheepdog: add error handling to sd_snapshot_delete()
Date: Fri, 18 Mar 2016 17:54:38 +0900	[thread overview]
Message-ID: <1458291278-5460-1-git-send-email-menjo.takashi@lab.ntt.co.jp> (raw)

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

             reply	other threads:[~2016-03-18  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18  8:54 Takashi Menjo [this message]
2016-03-18 16:17 ` [Qemu-devel] [PATCH] block/sheepdog: add error handling to sd_snapshot_delete() Jeff Cody
2016-03-22  3:59   ` MENJO, Takashi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458291278-5460-1-git-send-email-menjo.takashi@lab.ntt.co.jp \
    --to=menjo.takashi@lab.ntt.co.jp \
    --cc=jcody@redhat.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=qemu-devel@nongnu.org \
    --cc=sheepdog@lists.wpkg.org \
    --cc=v.tolstov@selfip.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).