qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] nbd: fix block-mirror NBD target
Date: Wed, 17 Feb 2016 16:21:16 +0100	[thread overview]
Message-ID: <56C48FEC.7010901@redhat.com> (raw)
In-Reply-To: <1455721691-14802-1-git-send-email-den@openvz.org>

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

On 17.02.2016 16:08, Denis V. Lunev wrote:
> There is VM with 8 GB QCOW2 storage. Real size of the image file is 2 GB.
> 'drive-mirror' redirected to NBD target creates 8 GB image at destination.
> The situation is even worse as zeroes are sent through the channel.
> 
> The patch simply adds .bdrv_co_write_zeroes callback to NBD block driver
> which works though NBD_TRIM to avoid transfer of zeroes.

The specification[1] says the following about TRIM:

> After issuing this command, a client MUST NOT make any assumptions
> about the contents of the export affected by this command, until
> overwriting it again with NBD_CMD_WRITE.

So I don't think this is correct.

The correct solution would probably to introduce a specific command to
write zeroes, or at least to use detect-zeroes on the NBD server side
(but this will still lead to the zeroes being sent over the line).

Max

[1] https://github.com/yoe/nbd/blob/master/doc/proto.md

> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block/nbd-client.c | 10 ++++++++++
>  block/nbd-client.h |  2 ++
>  block/nbd.c        |  9 +++++++++
>  3 files changed, 21 insertions(+)



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-02-17 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 15:08 [Qemu-devel] [PATCH 1/1] nbd: fix block-mirror NBD target Denis V. Lunev
2016-02-17 15:21 ` Max Reitz [this message]
2016-02-17 16:28   ` 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=56C48FEC.7010901@redhat.com \
    --to=mreitz@redhat.com \
    --cc=den@openvz.org \
    --cc=pbonzini@redhat.com \
    --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 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).