qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/1] nbd: fix block-mirror NBD target


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH 1/1] nbd: fix block-mirror NBD target
Date: Wed, 17 Feb 2016 19:28:11 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

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 <address@hidden>
CC: Paolo Bonzini <address@hidden>
---
  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 via email to

[Prev in Thread] Current Thread [Next in Thread]