From: MORITA Kazutaka <morita.kazutaka@gmail.com>
To: Liu Yuan <namei.unix@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
sheepdog@lists.wpkg.org, qemu-devel@nongnu.org,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [sheepdog] [PATCH v3] sheepdog: fix loadvm operation
Date: Thu, 25 Apr 2013 18:40:55 +0900 [thread overview]
Message-ID: <m2sj2f2biw.wl%morita.kazutaka@gmail.com> (raw)
In-Reply-To: <1366879354-5120-1-git-send-email-namei.unix@gmail.com>
At Thu, 25 Apr 2013 16:42:34 +0800,
Liu Yuan wrote:
>
> +/* Delete current working VDI on the snapshot chain */
> +static bool sd_delete(BDRVSheepdogState *s)
> +{
> + unsigned int wlen = SD_MAX_VDI_LEN, rlen = 0;
> + SheepdogVdiReq hdr = {
> + .opcode = SD_OP_DEL_VDI,
> + .vdi_id = s->inode.vdi_id,
> + .data_length = wlen,
> + .flags = SD_FLAG_CMD_WRITE,
> + };
> + SheepdogVdiRsp *rsp = (SheepdogVdiRsp *)&hdr;
> + int fd, ret;
> +
> + fd = connect_to_sdog(s);
> + if (fd < 0) {
> + return false;
> + }
> +
> + ret = do_req(fd, (SheepdogReq *)&hdr, s->name, &wlen, &rlen);
> + closesocket(fd);
> + if (ret || (rsp->result != SD_RES_SUCCESS &&
> + rsp->result != SD_RES_NO_VDI)) {
> + error_report("%s, %s", sd_strerror(rsp->result), s->name);
> + return false;
> + }
> +
> + return true;
> +}
Isn't it better to show an error message when the result code is
SD_RES_NO_VDI?
Thanks,
Kazutaka
next prev parent reply other threads:[~2013-04-25 9:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 16:47 [Qemu-devel] [PATCH v2] sheepdog: fix loadvm operation Liu Yuan
2013-04-25 4:12 ` Liu Yuan
2013-04-25 8:11 ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-25 8:27 ` Liu Yuan
2013-04-25 8:42 ` [Qemu-devel] [PATCH v3] " Liu Yuan
2013-04-25 9:40 ` MORITA Kazutaka [this message]
2013-04-25 9:44 ` [Qemu-devel] [sheepdog] " Liu Yuan
2013-04-25 10:03 ` MORITA Kazutaka
2013-04-25 12:32 ` Liu Yuan
2013-04-25 12:49 ` [Qemu-devel] [PATCH v4] " Liu Yuan
2013-04-25 13:06 ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-26 9:04 ` Liu Yuan
2013-04-26 11:39 ` Stefan Hajnoczi
2013-04-26 11:48 ` Liu Yuan
2013-04-26 11:41 ` [Qemu-devel] " Stefan Hajnoczi
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=m2sj2f2biw.wl%morita.kazutaka@gmail.com \
--to=morita.kazutaka@gmail.com \
--cc=kwolf@redhat.com \
--cc=namei.unix@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=sheepdog@lists.wpkg.org \
--cc=stefanha@redhat.com \
/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).