qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Liu Yuan <namei.unix@gmail.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	Michael Tokarev <mjt@tls.msk.ru>,
	qemu-devel@nongnu.org,
	MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Subject: Re: [Qemu-devel] [PATCH v3] sheepdog: implement SD_OP_FLUSH_VDI operation
Date: Tue, 03 Apr 2012 11:12:51 +0200	[thread overview]
Message-ID: <4F7ABF13.4060305@redhat.com> (raw)
In-Reply-To: <1333442100-29240-1-git-send-email-namei.unix@gmail.com>

Am 03.04.2012 10:35, schrieb Liu Yuan:
> From: Liu Yuan <tailai.ly@taobao.com>
> 
> Flush operation is supposed to flush the write-back cache of
> sheepdog cluster.
> 
> By issuing flush operation, we can assure the Guest of data
> reaching the sheepdog cluster storage.
> 
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Michael Tokarev <mjt@tls.msk.ru>
> Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
> Cc: Stefan Hajnoczi <stefanha@gmail.com>
> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
> ---
>  v2 -> v3:
>  address Stefan Hajnoczi comments. Thanks !
>   - use qemu_co_send/recv to send/revc msg
> 
>  v1 -> v2:
>  address Michael Tokarev comments. Thanks !
>   - use per-device flag
>   - use bs->fd instead of 'connect_to_sdog()'

This version looks okay to me now. Waiting for Kazutaka's Acked-by.

> +static int send_co_req(int sockfd, SheepdogReq *hdr, void *data,
> +                       unsigned int *wlen)
> +{
> +    int ret;
> +
> +    ret = qemu_co_send(sockfd, hdr, sizeof(*hdr));
> +    if (ret < sizeof(*hdr)) {
> +        error_report("failed to send a req, %s", strerror(errno));
> +    }
> +
> +    ret = qemu_co_send(sockfd, data, *wlen);
> +    if (ret < *wlen) {
> +        error_report("failed to send a req, %s", strerror(errno));
> +    }
> +
> +    return ret;
> +}

If sending the header fails, why do we still send the data? In fact, if
sending the data succeeds then (which is unlikely, but who knows), we'll
even return success.

This only copies the logic of the existing send_req(), so if it needs to
be fixed, another patch on top that fixes both instances would be okay.

Kevin

  reply	other threads:[~2012-04-03  9:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 17:35 [Qemu-devel] [PATCH] sheepdog: implement SD_OP_FLUSH_VDI operation Liu Yuan
2012-04-02 20:01 ` Michael Tokarev
2012-04-03  5:14   ` Liu Yuan
2012-04-03  5:15   ` [Qemu-devel] [PATCH v2] " Liu Yuan
2012-04-03  7:23     ` Stefan Hajnoczi
2012-04-03  8:35       ` [Qemu-devel] [PATCH v3] " Liu Yuan
2012-04-03  9:12         ` Kevin Wolf [this message]
2012-04-03 10:04           ` [Qemu-devel] RE. [PATCH] sheepdog: fix send req helpers Liu Yuan
2012-04-03 11:13             ` MORITA Kazutaka
2012-04-03 11:34               ` Kevin Wolf
2012-04-03  9:52         ` [Qemu-devel] [PATCH v3] sheepdog: implement SD_OP_FLUSH_VDI operation MORITA Kazutaka
2012-04-03  9:58           ` [Qemu-devel] [PATCH v4] " Liu Yuan
2012-04-03 10:08             ` [Qemu-devel] [PATCH v4 UPDATE] " Liu Yuan
2012-04-03 10:32               ` MORITA Kazutaka
2012-04-03 10:30                 ` Kevin Wolf
2012-04-03 20:03                   ` [Qemu-devel] [PATCH v5] " Liu Yuan
2012-04-04  8:53                     ` Kevin Wolf
2012-04-04  8:58                       ` Liu Yuan
2012-04-04  9:20                         ` Kevin Wolf

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=4F7ABF13.4060305@redhat.com \
    --to=kwolf@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=morita.kazutaka@lab.ntt.co.jp \
    --cc=namei.unix@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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).