[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/12] nbd: add support for NBD_CMD_FLUSH
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 04/12] nbd: add support for NBD_CMD_FLUSH |
Date: |
Tue, 13 Sep 2011 15:52:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
Am 08.09.2011 17:24, schrieb Paolo Bonzini:
> Note for the brace police: the style in this commit and the following
> is consistent with the rest of the file. It is then fixed together with
> the introduction of coroutines.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> block/nbd.c | 31 +++++++++++++++++++++++++++++++
> nbd.c | 14 +++++++++++++-
> 2 files changed, 44 insertions(+), 1 deletions(-)
>
> diff --git a/block/nbd.c b/block/nbd.c
> index ffc57a9..4a195dc 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -237,6 +237,36 @@ static int nbd_write(BlockDriverState *bs, int64_t
> sector_num,
> return 0;
> }
>
> +static int nbd_flush(BlockDriverState *bs)
> +{
> + BDRVNBDState *s = bs->opaque;
> + struct nbd_request request;
> + struct nbd_reply reply;
> +
> + if (!(s->nbdflags & NBD_FLAG_SEND_FLUSH)) {
> + return 0;
> + }
> +
> + request.type = NBD_CMD_FLUSH;
> + request.handle = (uint64_t)(intptr_t)bs;
> + request.from = 0;
> + request.len = 0;
> +
> + if (nbd_send_request(s->sock, &request) == -1)
> + return -errno;
> +
> + if (nbd_receive_reply(s->sock, &reply) == -1)
> + return -errno;
> +
> + if (reply.error !=0)
Missing space (this is not for consistency, right?)
> @@ -682,6 +683,18 @@ int nbd_trip(BlockDriverState *bs, int csock, off_t
> size, uint64_t dev_offset,
> TRACE("Request type is DISCONNECT");
> errno = 0;
> return 1;
> + case NBD_CMD_FLUSH:
> + TRACE("Request type is FLUSH");
> +
> + if (bdrv_flush(bs) == -1) {
bdrv_flush is supposed to return -errno, so please check for < 0. (I see
that raw-posix needs to be fixed, but other block drivers already return
error values other than -1)
Kevin
- [Qemu-devel] [PATCH 09/12] sheepdog: move coroutine send/recv function to generic code, (continued)
- [Qemu-devel] [PATCH 09/12] sheepdog: move coroutine send/recv function to generic code, Paolo Bonzini, 2011/09/08
- Re: [Qemu-devel] [PATCH 09/12] sheepdog: move coroutine send/recv function to generic code, MORITA Kazutaka, 2011/09/09
- [Qemu-devel] [PATCH v2 09/12] sheepdog: move coroutine send/recv function to generic code, Paolo Bonzini, 2011/09/09
- Re: [Qemu-devel] [PATCH v2 09/12] sheepdog: move coroutine send/recv function to generic code, MORITA Kazutaka, 2011/09/12
- Re: [Qemu-devel] [PATCH v2 09/12] sheepdog: move coroutine send/recv function to generic code, Kevin Wolf, 2011/09/13
- Re: [Qemu-devel] [PATCH v2 09/12] sheepdog: move coroutine send/recv function to generic code, Paolo Bonzini, 2011/09/13
- Re: [Qemu-devel] [PATCH v2 09/12] sheepdog: move coroutine send/recv function to generic code, Kevin Wolf, 2011/09/13
- Re: [Qemu-devel] [PATCH v2 09/12] sheepdog: move coroutine send/recv function to generic code, Paolo Bonzini, 2011/09/13
[Qemu-devel] [PATCH 10/12] block: add bdrv_co_flush support, Paolo Bonzini, 2011/09/08
[Qemu-devel] [PATCH 04/12] nbd: add support for NBD_CMD_FLUSH, Paolo Bonzini, 2011/09/08
- Re: [Qemu-devel] [PATCH 04/12] nbd: add support for NBD_CMD_FLUSH,
Kevin Wolf <=
[Qemu-devel] [PATCH 07/12] sheepdog: add coroutine_fn markers, Paolo Bonzini, 2011/09/08
[Qemu-devel] [PATCH 05/12] nbd: add support for NBD_CMD_FLAG_FUA, Paolo Bonzini, 2011/09/08
Re: [Qemu-devel] [PATCH 00/12] nbd improvements, Kevin Wolf, 2011/09/09