qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: Max Reitz <mreitz@redhat.com>
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 19:28:11 +0300	[thread overview]
Message-ID: <56C49F9B.8090902@openvz.org> (raw)
In-Reply-To: <56C48FEC.7010901@redhat.com>

On 02/17/2016 06:21 PM, Max Reitz wrote:
> 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(+)
>
This sounds not that good. OK. At least there is correct
lengthy way for this. White-outs must be supported
by the protocol.

Den

      reply	other threads:[~2016-02-17 16:28 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
2016-02-17 16:28   ` Denis V. Lunev [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=56C49F9B.8090902@openvz.org \
    --to=den@openvz.org \
    --cc=mreitz@redhat.com \
    --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).