qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: mreitz@redhat.com, kwolf@redhat.com, den@openvz.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] nbd/server: introduce NBD_CMD_CACHE
Date: Thu, 21 Jun 2018 09:41:33 -0500	[thread overview]
Message-ID: <c7cb351c-4215-3937-37fa-ad704dcf95c8@redhat.com> (raw)
In-Reply-To: <20180413143156.11409-1-vsementsov@virtuozzo.com>

On 04/13/2018 09:31 AM, Vladimir Sementsov-Ogievskiy wrote:
> Handle nbd CACHE command. Just do read, without sending read data back.
> Cache mechanism should be done by exported node driver chain.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   include/block/nbd.h |  3 ++-
>   nbd/server.c        | 10 ++++++----
>   2 files changed, 8 insertions(+), 5 deletions(-)

Missing a change to nbd/common.c nbd_cmd_lookup().

> @@ -1911,7 +1913,7 @@ static coroutine_fn int nbd_do_cmd_read(NBDClient *client, NBDRequest *request,
>       int ret;
>       NBDExport *exp = client->exp;
>   
> -    assert(request->type == NBD_CMD_READ);
> +    assert(request->type == NBD_CMD_READ || request->type == NBD_CMD_CACHE);

Also, missing a call into this function for NBD_CMD_CACHE.

Squashing the following, then adding to my NBD queue, with:

Reviewed-by: Eric Blake <eblake@redhat.com>

diff --git i/nbd/common.c w/nbd/common.c
index 8c95c1d606e..41f5ed8d9fa 100644
--- i/nbd/common.c
+++ w/nbd/common.c
@@ -148,6 +148,8 @@ const char *nbd_cmd_lookup(uint16_t cmd)
          return "flush";
      case NBD_CMD_TRIM:
          return "trim";
+    case NBD_CMD_CACHE:
+        return "cache";
      case NBD_CMD_WRITE_ZEROES:
          return "write zeroes";
      case NBD_CMD_BLOCK_STATUS:
diff --git i/nbd/server.c w/nbd/server.c
index 323c6d84004..274604609f4 100644
--- i/nbd/server.c
+++ w/nbd/server.c
@@ -2173,6 +2173,7 @@ static coroutine_fn int 
nbd_handle_request(NBDClient *client,

      switch (request->type) {
      case NBD_CMD_READ:
+    case NBD_CMD_CACHE:
          return nbd_do_cmd_read(client, request, data, errp);

      case NBD_CMD_WRITE:


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

      parent reply	other threads:[~2018-06-21 14:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13 14:31 [Qemu-devel] [PATCH] nbd/server: introduce NBD_CMD_CACHE Vladimir Sementsov-Ogievskiy
2018-04-13 14:43 ` Vladimir Sementsov-Ogievskiy
2018-04-18 16:37 ` Eric Blake
2018-04-19  8:36   ` Vladimir Sementsov-Ogievskiy
2018-04-19 15:59     ` Eric Blake
2018-05-17  9:52 ` Vladimir Sementsov-Ogievskiy
2018-05-17 13:34   ` Eric Blake
2018-05-29 15:27     ` Vladimir Sementsov-Ogievskiy
2018-06-21 13:13     ` Vladimir Sementsov-Ogievskiy
2018-06-21 14:41 ` Eric Blake [this message]

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=c7cb351c-4215-3937-37fa-ad704dcf95c8@redhat.com \
    --to=eblake@redhat.com \
    --cc=den@openvz.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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).