From patchwork Mon Dec 5 23:42:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 9461755 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 2898D60236 for ; Mon, 5 Dec 2016 23:43:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19E7828159 for ; Mon, 5 Dec 2016 23:43:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0ECC4282E2; Mon, 5 Dec 2016 23:43:21 +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=-6.9 required=2.0 tests=BAYES_00,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 964E928159 for ; Mon, 5 Dec 2016 23:43:20 +0000 (UTC) Received: from localhost ([::1]:45026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cE2ul-0002hd-KG for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Dec 2016 18:43:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cE2uJ-0002fz-7G for qemu-devel@nongnu.org; Mon, 05 Dec 2016 18:42:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cE2uI-0002Lm-7n for qemu-devel@nongnu.org; Mon, 05 Dec 2016 18:42:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52520) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cE2uD-0002IV-In; Mon, 05 Dec 2016 18:42:45 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14C09C0578F4; Mon, 5 Dec 2016 23:42:44 +0000 (UTC) Received: from red.redhat.com ([10.10.66.44]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB5NgfKo011715; Mon, 5 Dec 2016 18:42:42 -0500 From: Eric Blake To: nbd-general@lists.sourceforge.net Date: Mon, 5 Dec 2016 17:42:35 -0600 Message-Id: <20161205234235.5728-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 05 Dec 2016 23:42:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] doc: Propose NBD_FLAG_INIT_ZEROES extension 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: xieyingtai@huawei.com, subo7@huawei.com, qemu-block@nongnu.org, eric.fangyi@huawei.com, stefanha@gmail.com, qemu-devel@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP While not directly related to NBD_CMD_WRITE_ZEROES, the qemu team discovered that it is useful if a server can advertise whether an export is in a known-all-zeroes state at the time the client connects. Signed-off-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-By: Alex Bligh --- doc/proto.md | 5 +++++ 1 file changed, 5 insertions(+) This replaces the following qemu patch attempt: https://lists.gnu.org/archive/html/qemu-devel/2016-12/msg00357.html which tried to add NBD_CMD_HAS_ZERO_INIT with poor semantics. The semantics in this proposal should be much better. Patch is to the merge of the master branch and the extension-write-zeroes branch. By the way, qemu 2.8 is due to be released "real soon now", and implements NBD_CMD_WRITE_ZEROES, so maybe it is time to consider promoting the extension-write-zeroes branch into master. diff --git a/doc/proto.md b/doc/proto.md index afe71fc..7e4ec7f 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -697,6 +697,11 @@ The field has the following format: the export. - bit 9, `NBD_FLAG_SEND_BLOCK_STATUS`: defined by the experimental `BLOCK_STATUS` [extension](https://github.com/NetworkBlockDevice/nbd/blob/extension-blockstatus/doc/proto.md). +- bit 10, `NBD_FLAG_INIT_ZEROES`: Indicates that the server guarantees + that at the time transmission phase begins, all offsets within the + export read as zero bytes. Clients MAY use this information to + avoid writing to sections of the export that should still read as + zero after the client is done writing. Clients SHOULD ignore unknown flags.