All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
Cc: nbd-general@lists.sourceforge.net,
	"Denis V. Lunev" <den@openvz.org>,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] [RFC 1/1] nbd (specification): add NBD_CMD_WRITE_ZEROES command
Date: Wed, 17 Feb 2016 21:10:53 +0300	[thread overview]
Message-ID: <1455732653-3106-1-git-send-email-den@openvz.org> (raw)

This patch proposes a new command to reduce the amount of data passed
through the wire when it is known that the data is all zeroes. This
functionality is generally useful for mirroring or backup operations.

Currently available NBD_CMD_TRIM command can not be used as the
specification explicitely says that "a client MUST NOT make any
assumptions about the contents of the export affected by this
[NBD_CMD_TRIM] command, until overwriting it again with `NBD_CMD_WRITE`"

Particular use case could be the following:

QEMU project uses own implementation of NBD server to transfer data
in between different instances of QEMU. Typically we tranfer VM virtual
disks over this channel. VM virtual disks are sparse and thus the
efficiency of backup and mirroring operations could be improved a lot.

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 doc/proto.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/doc/proto.md b/doc/proto.md
index 43065b7..c94751a 100644
--- a/doc/proto.md
+++ b/doc/proto.md
@@ -241,6 +241,8 @@ immediately after the global flags field in oldstyle negotiation:
   schedule I/O accesses as for a rotational medium
 - bit 5, `NBD_FLAG_SEND_TRIM`; should be set to 1 if the server supports
   `NBD_CMD_TRIM` commands
+- bit 6, `NBD_FLAG_SEND_WRITE_ZEROES`; should be set to 1 if the server
+  supports `NBD_CMD_WRITE_ZEROES` commands
 
 ##### Client flags
 
@@ -446,6 +448,11 @@ The following request types exist:
     about the contents of the export affected by this command, until
     overwriting it again with `NBD_CMD_WRITE`.
 
+* `NBD_CMD_WRITE_ZEROES` (6)
+
+    A request to write zeroes. The command is functional equivalent of
+    the NBD_WRITE_COMMAND but without payload sent through the channel.
+
 * Other requests
 
     Some third-party implementations may require additional protocol
-- 
2.1.4

             reply	other threads:[~2016-02-17 18:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 18:10 Denis V. Lunev [this message]
2016-02-17 20:58 ` [Qemu-devel] [RFC 1/1] nbd (specification): add NBD_CMD_WRITE_ZEROES command Eric Blake
2016-02-18  4:46   ` Denis V. Lunev
2016-02-18  8:30     ` Denis V. Lunev
2016-02-18  9:18   ` Roman Kagan
2016-02-18 10:36     ` Denis V. Lunev
2016-02-18 16:35     ` Eric Blake
2016-02-18 17:23       ` [Qemu-devel] SUMMARY: " Denis V. Lunev
2016-02-18 17:55         ` Eric Blake
2016-02-18 19:29         ` [Qemu-devel] [Nbd] " Alex Bligh
2016-02-19  7:12         ` [Qemu-devel] " Denis V. Lunev
2016-02-19  8:56           ` Vladimir Sementsov-Ogievskiy
2016-02-19  9:11           ` Daniel P. Berrange
2016-02-18 12:14   ` [Qemu-devel] " Daniel P. Berrange
2016-02-18 14:05     ` Denis V. Lunev
2016-02-18  8:09 ` Alex Bligh
2016-02-18  8:34   ` Denis V. Lunev
2016-03-04  8:49     ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-03-04  9:54       ` Kevin Wolf
2016-03-04 14:03         ` Paolo Bonzini
2016-03-06 10:28           ` Wouter Verhelst
2016-03-06 18:54             ` Denis V. Lunev

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=1455732653-3106-1-git-send-email-den@openvz.org \
    --to=den@openvz.org \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.