From patchwork Thu Jun 21 14:41:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 10479991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B788860365 for ; Thu, 21 Jun 2018 14:42:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A58E32927C for ; Thu, 21 Jun 2018 14:42:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A4A529283; Thu, 21 Jun 2018 14:42:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 473642927C for ; Thu, 21 Jun 2018 14:42:34 +0000 (UTC) Received: from localhost ([::1]:55856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW0nB-0002nF-F1 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Jun 2018 10:42:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW0mR-0002KU-AM for qemu-devel@nongnu.org; Thu, 21 Jun 2018 10:41:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW0mO-0005tz-2i for qemu-devel@nongnu.org; Thu, 21 Jun 2018 10:41:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56792 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fW0mF-0005mq-3n; Thu, 21 Jun 2018 10:41:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1B1F8AA0D; Thu, 21 Jun 2018 14:41:34 +0000 (UTC) Received: from [10.10.120.169] (ovpn-120-169.rdu2.redhat.com [10.10.120.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BA9D2026D6B; Thu, 21 Jun 2018 14:41:33 +0000 (UTC) To: Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, qemu-block@nongnu.org References: <20180413143156.11409-1-vsementsov@virtuozzo.com> From: Eric Blake Organization: Red Hat, Inc. Message-ID: Date: Thu, 21 Jun 2018 09:41:33 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180413143156.11409-1-vsementsov@virtuozzo.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 21 Jun 2018 14:41:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 21 Jun 2018 14:41:34 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: Re: [Qemu-devel] [PATCH] nbd/server: introduce NBD_CMD_CACHE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, den@openvz.org, pbonzini@redhat.com, mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 > --- > 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 case NBD_CMD_WRITE: 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);