Re: [Qemu-block] [PATCH 8/9] mirror: use synch scheme for drive mirror

2016-06-14 Thread Eric Blake
On 06/14/2016 09:25 AM, Denis V. Lunev wrote: > Block commit of the active image to the backing store on a slow disk > could never end. For example with the guest with the following loop > inside > while true; do > dd bs=1k count=1 if=/dev/zero of=x > done > running above slow

Re: [Qemu-block] [PATCH 7/9] mirror: allow to save buffer for QEMUIOVector in MirrorOp

2016-06-14 Thread Eric Blake
On 06/14/2016 09:25 AM, Denis V. Lunev wrote: In the subject: 'allow to save buffer' is not idiomatic English; better would be 'allow saving the buffer' or simply 'save the buffer' > Properly cook MirrorOp initialization/deinitialization. The field is not > yet used actually. Another "what" but

Re: [Qemu-block] [PATCH 6/9] block: pass qiov into before_write notifier

2016-06-14 Thread Eric Blake
On 06/14/2016 09:25 AM, Denis V. Lunev wrote: > Signed-off-by: Denis V. Lunev The commit message says what, but not why. It's useful to give reviewers a hint as to why a patch makes sense (such as a future patch being able to use the write notifier to make mirroring more

Re: [Qemu-block] [PATCH 5/9] mirror: improve performance of mirroring of empty disk

2016-06-14 Thread Eric Blake
On 06/14/2016 09:25 AM, Denis V. Lunev wrote: > We should not take into account zero blocks for delay calculations. > They are not read and thus IO throttling is not required. In the > other case VM migration with 16 Tb QCOW2 disk with 4 Gb of data takes > days. > > Signed-off-by: Denis V. Lunev

Re: [Qemu-block] [PATCH 4/9] mirror: efficiently zero out target

2016-06-14 Thread Eric Blake
On 06/14/2016 09:25 AM, Denis V. Lunev wrote: > With a bdrv_co_write_zeroes method on a target BDS zeroes will not be placed > into the wire. Thus the target could be very efficiently zeroed out. This > is should be done with the largest chunk possible. > > This improves the performance of the

Re: [Qemu-block] [PATCH 3/9] mirror: optimize dirty bitmap filling in mirror_run a bit

2016-06-14 Thread Eric Blake
On 06/14/2016 09:25 AM, Denis V. Lunev wrote: > There is no need to scan allocation tables if we have mark_all_dirty flag > set. Just mark it all dirty. > > Signed-off-by: Denis V. Lunev > Reviewed-by: Vladimir Sementsov-Ogievskiy > CC: Stefan Hajnoczi

Re: [Qemu-block] [PATCH 2/9] mirror: create mirror_dirty_init helper for mirror_run

2016-06-14 Thread Eric Blake
On 06/14/2016 09:25 AM, Denis V. Lunev wrote: > The code inside the helper will be extended in the next patch. mirror_run > itself is overbloated at the moment. > > Signed-off-by: Denis V. Lunev > Reviewed-by: Vladimir Sementsov-Ogievskiy > CC: Stefan

Re: [Qemu-block] [PATCH] backup: Fail early if cannot determine cluster size

2016-06-14 Thread Fam Zheng
On Tue, 06/14 16:49, Max Reitz wrote: > On 18.05.2016 07:53, Fam Zheng wrote: > > Otherwise the job is orphaned and block_job_cancel_sync in > > bdrv_close_all() when quiting will hang. > > > > A simple reproducer is running blockdev-backup from null-co:// to > > null-co://. > > > > Cc:

Re: [Qemu-block] [PATCH] backup: Fail early if cannot determine cluster size

2016-06-14 Thread Fam Zheng
On Tue, 06/14 16:49, Max Reitz wrote: > On 18.05.2016 07:53, Fam Zheng wrote: > > Otherwise the job is orphaned and block_job_cancel_sync in > > bdrv_close_all() when quiting will hang. > > > > A simple reproducer is running blockdev-backup from null-co:// to > > null-co://. > > > > Cc:

Re: [Qemu-block] [PATCH v3 08/14] block/nbd: Accept SocketAddress

2016-06-14 Thread Eric Blake
On 04/06/2016 12:28 PM, Max Reitz wrote: > Add a new option "address" to the NBD block driver which accepts a > SocketAddress. > > "path", "host" and "port" are still supported as legacy options and are > mapped to their corresponding SocketAddress representation. The back-compat work is pretty

Re: [Qemu-block] [PATCH v3 07/14] block/nbd: "address" in nbd_refresh_filename()

2016-06-14 Thread Eric Blake
On 04/06/2016 12:28 PM, Max Reitz wrote: > As of a future patch, the NBD block driver will accept a SocketAddress > structure for a new "address" option. In order to support this, > nbd_refresh_filename() needs some changes. > > The two TODOs introduced by this patch will be removed in the very

Re: [Qemu-block] [PATCH v3 06/14] block/nbd: Add nbd_has_filename_options_conflict()

2016-06-14 Thread Eric Blake
On 04/06/2016 12:28 PM, Max Reitz wrote: > Right now, we have four possible options that conflict with specifying > an NBD filename, and a future patch will add another one ("address"). > This future option is a nested QDict that is flattened at this point, > requiring as to test each option

Re: [Qemu-block] [PATCH 1/9] mirror: fix calling of blk_aio_pwritev/blk_aio_preadv

2016-06-14 Thread Eric Blake
On 06/14/2016 09:25 AM, Denis V. Lunev wrote: > 4th argument is flags rather than size. Fortunately flags occupies > 5 less significant bits and they are always zero due to alignment. > > Signed-off-by: Denis V. Lunev > Reviewed-by: Vladimir

Re: [Qemu-block] [PATCH v3 for-2.7 00/14] qapi: Allow blockdev-add for NBD

2016-06-14 Thread Eric Blake
On 05/03/2016 09:23 AM, Kevin Wolf wrote: > Am 06.04.2016 um 20:28 hat Max Reitz geschrieben: >> Turns out NBD is not so simple to do if you do it right. Anyway, this >> series adds blockdev-add support for NBD clients. > > What the series does seems to make sense to me, though things would be a

Re: [Qemu-block] [PATCH v3 05/14] block/nbd: Use qdict_put()

2016-06-14 Thread Eric Blake
On 04/06/2016 12:28 PM, Max Reitz wrote: > Instead of inlining this nice macro (i.e. resorting to > qdict_put_obj(..., QOBJECT(...))), use it. > > Signed-off-by: Max Reitz > --- > block/nbd.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) Reviewed-by:

Re: [Qemu-block] [PATCH v3 04/14] block/nbd: Default port in nbd_refresh_filename()

2016-06-14 Thread Eric Blake
On 04/06/2016 12:28 PM, Max Reitz wrote: > Instead of not emitting the port in nbd_refresh_filename(), just set it > to the default if the user did not specify it. This makes the logic a > bit simpler. > > Signed-off-by: Max Reitz > --- > block/nbd.c | 18 +++--- >

Re: [Qemu-block] [PATCH v4 04/11] nbd: Improve server handling of bogus commands

2016-06-14 Thread Paolo Bonzini
On 14/06/2016 17:59, Alex Bligh wrote: > >> On 14 Jun 2016, at 16:11, Paolo Bonzini wrote: >> >>> To illustrate the problem, look consider what qemu itself would do as >>> a server if it can't buffer the entire read issued to it. >> >> Return ENOMEM? > > Well OK, qemu

Re: [Qemu-block] [PATCH v3 01/14] qdict: Add qdict_change_key()

2016-06-14 Thread Eric Blake
On 04/06/2016 12:28 PM, Max Reitz wrote: > This is a shorthand function for changing a QDict's entry's key. > > Signed-off-by: Max Reitz > --- > include/qapi/qmp/qdict.h | 1 + > qobject/qdict.c | 23 +++ > 2 files changed, 24 insertions(+)

Re: [Qemu-block] [PATCH v3 02/14] block/nbd: Drop trailing "." in error messages

2016-06-14 Thread Eric Blake
On 04/06/2016 12:28 PM, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > block/nbd.c | 4 ++-- > tests/qemu-iotests/051.out| 4 ++-- > tests/qemu-iotests/051.pc.out | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) Reviewed-by: Eric Blake

Re: [Qemu-block] [PATCH 1/7] doc: move text describing --trace to specific .texi file

2016-06-14 Thread Eric Blake
On 06/14/2016 03:49 PM, Eric Blake wrote: > On 06/14/2016 04:08 AM, Denis V. Lunev wrote: >> This text will be included to qemu-nbd/qemu-img mans in the next patches. >> >> Signed-off-by: Denis V. Lunev >> CC: Eric Blake >> CC: Paolo Bonzini

Re: [Qemu-block] [PATCH 5/7] trace: enable tracing in qemu-nbd

2016-06-14 Thread Eric Blake
On 06/14/2016 04:08 AM, Denis V. Lunev wrote: > Please note, trace_init_backends() must be called in the final process, > i.e. after daemonization. This is necessary to keep tracing thread in > the proper process. > > Signed-off-by: Denis V. Lunev > CC: Eric Blake

Re: [Qemu-block] [PATCH 7/7] trace: enable tracing in qemu-img

2016-06-14 Thread Eric Blake
On 06/14/2016 04:08 AM, Denis V. Lunev wrote: > The command will work this way: > qemu-img --trace qcow2* create -f qcow2 1.img 64G > > Signed-off-by: Denis V. Lunev > Suggested by: Daniel P. Berrange > CC: Eric Blake > CC: Paolo

Re: [Qemu-block] [PATCH 1/7] doc: move text describing --trace to specific .texi file

2016-06-14 Thread Eric Blake
On 06/14/2016 04:08 AM, Denis V. Lunev wrote: > This text will be included to qemu-nbd/qemu-img mans in the next patches. > > Signed-off-by: Denis V. Lunev > CC: Eric Blake > CC: Paolo Bonzini > CC: Stefan Hajnoczi

[Qemu-block] [PATCH v2 17/17] block: Move request_alignment into BlockLimit

2016-06-14 Thread Eric Blake
It makes more sense to have ALL block size limit constraints in the same struct. Improve the documentation while at it. Signed-off-by: Eric Blake --- v2: drop hacks for save/restore of alignment, now that earlier patches handled setting up BlockLimits more sanely ---

[Qemu-block] [PATCH v2 14/17] block: Switch transfer length bounds to byte-based

2016-06-14 Thread Eric Blake
Sector-based limits are awkward to think about; in our on-going quest to move to byte-based interfaces, convert max_transfer_length and opt_transfer_length. Rename them (dropping the _length suffix) so that the compiler will help us catch the change in semantics across any rebased code, and

[Qemu-block] [PATCH v2 15/17] block: Switch discard length bounds to byte-based

2016-06-14 Thread Eric Blake
Sector-based limits are awkward to think about; in our on-going quest to move to byte-based interfaces, convert max_discard and discard_alignment. Rename them, using 'pdiscard' as an aid to track which remaining discard interfaces need conversion, and so that the compiler will help us catch the

[Qemu-block] [PATCH v2 16/17] block: Split bdrv_merge_limits() from bdrv_refresh_limits()

2016-06-14 Thread Eric Blake
The raw block driver was blindly copying all limits from bs->file, even though: 1. the main bdrv_refresh_limits() already does this for many of gthe limits, and 2. blindly copying from the children can weaken any stricter limits that were already inherited from the backing dhain during the main

[Qemu-block] [PATCH v2 08/17] blkdebug: Set request_alignment during .bdrv_refresh_limits()

2016-06-14 Thread Eric Blake
We want to eventually stick request_alignment alongside other BlockLimits, but first, we must ensure it is populated at the same time as all other limits, rather than being a special case that is set only when a block is first opened. qemu-iotests 77 is particularly sensitive to the fact that we

[Qemu-block] [PATCH v2 13/17] block: Set default request_alignment during bdrv_refresh_limits()

2016-06-14 Thread Eric Blake
We want to eventually stick request_alignment alongside other BlockLimits, but first, we must ensure it is populated at the same time as all other limits, rather than being a special case that is set only when a block is first opened. Now that all drivers have been updated to supply an override

[Qemu-block] [PATCH v2 03/17] block: Fix harmless off-by-one in bdrv_aligned_preadv()

2016-06-14 Thread Eric Blake
If the amount of data to read ends exactly on the total size of the bs, then we were wasting time creating a local qiov to read the data in preparation for what would normally be appending zeroes beyond the end, even though this corner case has nothing further to do. Signed-off-by: Eric Blake

[Qemu-block] [PATCH v2 12/17] block: Set request_alignment during .bdrv_refresh_limits()

2016-06-14 Thread Eric Blake
We want to eventually stick request_alignment alongside other BlockLimits, but first, we must ensure it is populated at the same time as all other limits, rather than being a special case that is set only when a block is first opened. Add a .bdrv_refresh_limits() to all four of our legacy devices

[Qemu-block] [PATCH v2 10/17] qcow2: Set request_alignment during .bdrv_refresh_limits()

2016-06-14 Thread Eric Blake
We want to eventually stick request_alignment alongside other BlockLimits, but first, we must ensure it is populated at the same time as all other limits, rather than being a special case that is set only when a block is first opened. Signed-off-by: Eric Blake --- v2: new

[Qemu-block] [PATCH v2 11/17] raw-win32: Set request_alignment during .bdrv_refresh_limits()

2016-06-14 Thread Eric Blake
We want to eventually stick request_alignment alongside other BlockLimits, but first, we must ensure it is populated at the same time as all other limits, rather than being a special case that is set only when a block is first opened. In this case, raw_probe_alignment() already did what we

[Qemu-block] [PATCH v2 06/17] iscsi: Advertise realistic limits to block layer

2016-06-14 Thread Eric Blake
The function sector_limits_lun2qemu() returns a value in units of the block layer's 512-byte sector, and can be as large as 0x4000, which is much larger than the block layer's inherent limit of BDRV_REQUEST_MAX_SECTORS. The block layer already handles '0' as a synonym to the inherent limit,

[Qemu-block] [PATCH v2 01/17] block: Tighter assertions on bdrv_aligned_pwritev()

2016-06-14 Thread Eric Blake
For symmetry with bdrv_aligned_preadv(), assert that the caller really has aligned things properly. This requires adding an align parameter, which is used now only in the new asserts, but will come in handy in a later patch that adds auto-fragmentation to the max transfer size, since that value

[Qemu-block] [PATCH v2 04/17] nbd: Allow larger requests

2016-06-14 Thread Eric Blake
The NBD layer was breaking up request at a limit of 2040 sectors (just under 1M) to cater to old qemu-nbd. But the server limit was raised to 32M in commit 2d8214885 to match the kernel, more than three years ago; and the upstream NBD Protocol is proposing documentation that without any explicit

[Qemu-block] [PATCH v2 00/17] Byte-based block limits

2016-06-14 Thread Eric Blake
BlockLimits is currently an ugly mix of byte limits vs. sector limits. Unify it. Fix some bugs I found in bdrv_aligned_preadv() while at it. Prequisite: Kevin's ongoing work to migrate bdrv_aligned_preadv() to be byte-based (commit 3de06b2 on his vmstate branch at the time of this email, but

[Qemu-block] [PATCH v2 02/17] block: Document supported flags during bdrv_aligned_preadv()

2016-06-14 Thread Eric Blake
We don't pass any flags on to drivers to handle. Tighten an assert to explain why we pass 0 to bdrv_driver_preadv(), and add some comments on things to be aware of if we want to turn on per-BDS BDRV_REQ_FUA support during reads in the future. Also, document that we may want to consider using

Re: [Qemu-block] [Qemu-devel] [PATCH] macio: Use blk_drain instead of blk_drain_all

2016-06-14 Thread John Snow
On 06/13/2016 09:21 PM, Fam Zheng wrote: > On Mon, 06/13 17:33, John Snow wrote: >> >> >> On 06/12/2016 02:56 AM, Fam Zheng wrote: >>> We only care about the associated backend, so blk_drain is more >>> appropriate here. >>> >>> Signed-off-by: Fam Zheng >>> --- >>>

Re: [Qemu-block] [PATCH v4 04/11] nbd: Improve server handling of bogus commands

2016-06-14 Thread Eric Blake
On 06/13/2016 06:19 AM, Paolo Bonzini wrote: > > > On 12/05/2016 00:39, Eric Blake wrote: >> We have a few bugs in how we handle invalid client commands: >> >> - A client can send an NBD_CMD_DISC where from + len overflows, >> convincing us to reply with an error and stay connected, even >>

Re: [Qemu-block] [Qemu-devel] [PATCH v3 0/3] coccinelle: Clean up error checks and return value variables

2016-06-14 Thread Eduardo Habkost
On Tue, Jun 14, 2016 at 11:03:20AM +0200, Markus Armbruster wrote: [...] > > * Manual fixups > > With the commit message of 3/3 amended, series > Reviewed-by: Markus Armbruster > > My other suggested touch ups are optional. If you don't object, I'll do > them, and take the

Re: [Qemu-block] [Qemu-devel] [PATCH v3 0/3] coccinelle: Clean up error checks and return value variables

2016-06-14 Thread Markus Armbruster
Markus Armbruster writes: > Eduardo Habkost writes: > >> Changes v1 -> v2: >> * The Coccinelle scripts were simplified by using "when" >> constraints to detect when a variable is not used elsewhere >> inside the function. >> * Added script to remove

Re: [Qemu-block] [PATCH v2] rbd:change error_setg() to error_setg_errno()

2016-06-14 Thread Vikhyat Umrao
On Tue, Jun 14, 2016 at 8:12 PM, Max Reitz wrote: > On 09.05.2016 09:51, Vikhyat Umrao wrote: > > Ceph RBD block driver does not use error_setg_errno() where > > it is possible to use. This patch replaces error_setg() > > from error_setg_errno(). > > > > Signed-off-by: Vikhyat

Re: [Qemu-block] [PATCH v3 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Max Reitz
On 14.06.2016 18:24, Daniel P. Berrange wrote: > The qemu-img info command has the ability to expose format > specific metadata about volumes. Wire up this facility for > the LUKS driver to report on cipher configuration and key > slot usage. > > $ qemu-img info ~/VirtualMachines/demo.luks >

[Qemu-block] [PATCH v3 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Daniel P. Berrange
The qemu-img info command has the ability to expose format specific metadata about volumes. Wire up this facility for the LUKS driver to report on cipher configuration and key slot usage. $ qemu-img info ~/VirtualMachines/demo.luks image: /home/berrange/VirtualMachines/demo.luks file

Re: [Qemu-block] [PATCH] block-backend: allow flush on devices with open tray

2016-06-14 Thread Max Reitz
On 14.06.2016 17:54, John Snow wrote: > > > On 06/14/2016 09:19 AM, Max Reitz wrote: >> On 10.06.2016 23:59, John Snow wrote: >>> If a device still has an attached BDS because the medium has not yet >>> been removed, we will be unable to migrate to a new host because >>> blk_flush will return an

Re: [Qemu-block] [PATCH v4 00/11] nbd: tighter protocol compliance

2016-06-14 Thread Paolo Bonzini
On 13/06/2016 18:49, Eric Blake wrote: >>> >> 004/11:[] [--] 'nbd: Improve server handling of bogus commands' >> > >> > Applied with some changes, see reply to individual patch. > Not sure I agree with all of your comments on that patch regarding > behavior on read errors, but further

[Qemu-block] [PATCH v3 0/2] Report format specific info for LUKS block driver

2016-06-14 Thread Daniel P. Berrange
This is a followup to: v1: https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01723.html v2: https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg03642.html The 'qemu-img info' tool has ability to print format specific information, eg with qcow2 it reports two extra items: $

Re: [Qemu-block] [PATCH v3 1/2] crypto: add support for querying parameters for block encryption

2016-06-14 Thread Max Reitz
On 14.06.2016 18:24, Daniel P. Berrange wrote: > When creating new block encryption volumes, we accept a list of > parameters to control the formatting process. It is useful to > be able to query what those parameters were for existing block > devices. Add a qcrypto_block_get_info() method which

[Qemu-block] [PATCH v3 1/2] crypto: add support for querying parameters for block encryption

2016-06-14 Thread Daniel P. Berrange
When creating new block encryption volumes, we accept a list of parameters to control the formatting process. It is useful to be able to query what those parameters were for existing block devices. Add a qcrypto_block_get_info() method which returns a QCryptoBlockInfo instance to report this data.

Re: [Qemu-block] [PATCH] block-backend: allow flush on devices with open tray

2016-06-14 Thread John Snow
On 06/14/2016 09:19 AM, Max Reitz wrote: > On 10.06.2016 23:59, John Snow wrote: >> If a device still has an attached BDS because the medium has not yet >> been removed, we will be unable to migrate to a new host because >> blk_flush will return an error for that backend. >> >> Replace the call

Re: [Qemu-block] [PATCH v3 0/5] block/mirror: Fix (?) target backing BDS

2016-06-14 Thread Max Reitz
On 10.06.2016 20:57, Max Reitz wrote: > Issue #1: If the target image does not have a backing BDS before mirror > completion, qemu tries really hard to give it a backing BDS. If the > source has a backing BDS, it will actually always "succeed". > In some cases, the target is not supposed to have a

Re: [Qemu-block] [PATCH v2 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Max Reitz
On 14.06.2016 12:56, Daniel P. Berrange wrote: > The qemu-img info command has the ability to expose format > specific metadata about volumes. Wire up this facility for > the LUKS driver to report on cipher configuration and key > slot usage. > > $ qemu-img info ~/VirtualMachines/demo.luks >

Re: [Qemu-block] [Qemu-devel] [PATCH v7 08/15] block: Simplify block_set_io_throttle

2016-06-14 Thread Markus Armbruster
Eric Blake writes: > Now that we can support boxed commands, use it to greatly > reduce the number of parameters (and likelihood of getting > out of sync) when adjusting throttle parameters. > > Signed-off-by: Eric Blake > > --- > v7: new patch > --- >

Re: [Qemu-block] [PATCH v2 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Max Reitz
On 14.06.2016 17:47, Daniel P. Berrange wrote: > On Tue, Jun 14, 2016 at 05:38:36PM +0200, Max Reitz wrote: >> On 14.06.2016 12:56, Daniel P. Berrange wrote: >>> The qemu-img info command has the ability to expose format >>> specific metadata about volumes. Wire up this facility for >>> the LUKS

[Qemu-block] [PATCH 6/9] block: pass qiov into before_write notifier

2016-06-14 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Stefan Hajnoczi CC: Fam Zheng CC: Kevin Wolf CC: Max Reitz CC: Jeff Cody CC:

[Qemu-block] [PATCH 8/9] mirror: use synch scheme for drive mirror

2016-06-14 Thread Denis V. Lunev
Block commit of the active image to the backing store on a slow disk could never end. For example with the guest with the following loop inside while true; do dd bs=1k count=1 if=/dev/zero of=x done running above slow storage could not complete the operation with a resonable amount

Re: [Qemu-block] [PATCH v2 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Daniel P. Berrange
On Tue, Jun 14, 2016 at 05:49:24PM +0200, Max Reitz wrote: > On 14.06.2016 17:47, Daniel P. Berrange wrote: > > On Tue, Jun 14, 2016 at 05:38:36PM +0200, Max Reitz wrote: > >> On 14.06.2016 12:56, Daniel P. Berrange wrote: > >>> The qemu-img info command has the ability to expose format > >>>

Re: [Qemu-block] [PATCH v4 04/11] nbd: Improve server handling of bogus commands

2016-06-14 Thread Paolo Bonzini
On 14/06/2016 17:02, Alex Bligh wrote: > > On 14 Jun 2016, at 14:32, Paolo Bonzini wrote: > >> >> On 13/06/2016 23:41, Alex Bligh wrote: >>> That's one of the reasons that there is a proposal to add >>> STRUCTURED_READ to the spec (although I still haven't had time to >>>

Re: [Qemu-block] [PATCH] m25p80: fix test on blk_pread() return value

2016-06-14 Thread Cédric Le Goater
On 06/14/2016 10:38 AM, Kevin Wolf wrote: > Am 14.06.2016 um 10:02 hat Cédric Le Goater geschrieben: #4 0x7fa81c6694ac in bdrv_aligned_pwritev (bs=0x7fa81d4dd050, req=, offset=30878208, bytes=512, qiov=0x7fa7f47fee60, flags=0) at

[Qemu-block] [PATCH 4/9] mirror: efficiently zero out target

2016-06-14 Thread Denis V. Lunev
With a bdrv_co_write_zeroes method on a target BDS zeroes will not be placed into the wire. Thus the target could be very efficiently zeroed out. This is should be done with the largest chunk possible. This improves the performance of the live migration of the empty disk by 150 times if NBD

[Qemu-block] [PATCH 1/9] mirror: fix calling of blk_aio_pwritev/blk_aio_preadv

2016-06-14 Thread Denis V. Lunev
4th argument is flags rather than size. Fortunately flags occupies 5 less significant bits and they are always zero due to alignment. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Stefan Hajnoczi CC:

Re: [Qemu-block] [PATCH v4 04/11] nbd: Improve server handling of bogus commands

2016-06-14 Thread Alex Bligh
> On 14 Jun 2016, at 16:11, Paolo Bonzini wrote: > >> To illustrate the problem, look consider what qemu itself would do as >> a server if it can't buffer the entire read issued to it. > > Return ENOMEM? Well OK, qemu then 'works' on the basis it breaks another part of

Re: [Qemu-block] [PATCH v2 1/2] crypto: add support for querying parameters for block encryption

2016-06-14 Thread Max Reitz
On 14.06.2016 12:56, Daniel P. Berrange wrote: > When creating new block encryption volumes, we accept a list of > parameters to control the formatting process. It is useful to > be able to query what those parameters were for existing block > devices. Add a qcrypto_block_get_info() method which

Re: [Qemu-block] [PATCH v2 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Daniel P. Berrange
On Tue, Jun 14, 2016 at 05:38:36PM +0200, Max Reitz wrote: > On 14.06.2016 12:56, Daniel P. Berrange wrote: > > The qemu-img info command has the ability to expose format > > specific metadata about volumes. Wire up this facility for > > the LUKS driver to report on cipher configuration and key >

[Qemu-block] [PATCH 0/9] major rework of drive-mirror

2016-06-14 Thread Denis V. Lunev
Block commit of the active image to the backing store on a slow disk could never end. For example with the guest with the following loop inside while true; do dd bs=1k count=1 if=/dev/zero of=x done running above slow storage could not complete the operation with a resonable amount

[Qemu-block] [PATCH 9/9] mirror: replace bdrv_dirty_bitmap with plain hbitmap

2016-06-14 Thread Denis V. Lunev
We have replaced the mechanics of syncing new writes in the previous patch and thus do not need to track dirty changes anymore. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Stefan Hajnoczi CC: Fam

[Qemu-block] [PATCH 5/9] mirror: improve performance of mirroring of empty disk

2016-06-14 Thread Denis V. Lunev
We should not take into account zero blocks for delay calculations. They are not read and thus IO throttling is not required. In the other case VM migration with 16 Tb QCOW2 disk with 4 Gb of data takes days. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir

Re: [Qemu-block] [Qemu-devel] [PATCH v7 09/15] block: Simplify drive-mirror

2016-06-14 Thread Markus Armbruster
Eric Blake writes: > Now that we can support boxed commands, use it to greatly > reduce the number of parameters (and likelihood of getting > out of sync) when adjusting drive-mirror parameters. > > Signed-off-by: Eric Blake > > --- > v7: new patch > --- >

[Qemu-block] [PATCH 3/9] mirror: optimize dirty bitmap filling in mirror_run a bit

2016-06-14 Thread Denis V. Lunev
There is no need to scan allocation tables if we have mark_all_dirty flag set. Just mark it all dirty. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Stefan Hajnoczi CC: Fam Zheng CC:

Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit

2016-06-14 Thread Kevin Wolf
Am 14.06.2016 um 16:47 hat Eric Blake geschrieben: > On 06/14/2016 02:05 AM, Kevin Wolf wrote: > > static void raw_refresh_limits(BlockDriverState *bs, Error **errp) > { > +/* Inherit all limits except for request_alignment */ > +int request_alignment =

[Qemu-block] [PATCH 7/9] mirror: allow to save buffer for QEMUIOVector in MirrorOp

2016-06-14 Thread Denis V. Lunev
Properly cook MirrorOp initialization/deinitialization. The field is not yet used actually. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Stefan Hajnoczi CC: Fam Zheng CC: Kevin Wolf

[Qemu-block] [PATCH 2/9] mirror: create mirror_dirty_init helper for mirror_run

2016-06-14 Thread Denis V. Lunev
The code inside the helper will be extended in the next patch. mirror_run itself is overbloated at the moment. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Stefan Hajnoczi CC: Fam Zheng

Re: [Qemu-block] [PATCH v4 04/11] nbd: Improve server handling of bogus commands

2016-06-14 Thread Alex Bligh
On 14 Jun 2016, at 14:32, Paolo Bonzini wrote: > > On 13/06/2016 23:41, Alex Bligh wrote: >> That's one of the reasons that there is a proposal to add >> STRUCTURED_READ to the spec (although I still haven't had time to >> implement that for qemu), so that we have a newer

Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit

2016-06-14 Thread Eric Blake
On 06/14/2016 02:05 AM, Kevin Wolf wrote: static void raw_refresh_limits(BlockDriverState *bs, Error **errp) { +/* Inherit all limits except for request_alignment */ +int request_alignment = bs->bl.request_alignment; + bs->bl = bs->file->bs->bl; +

Re: [Qemu-block] [PATCH] backup: Fail early if cannot determine cluster size

2016-06-14 Thread Max Reitz
On 18.05.2016 07:53, Fam Zheng wrote: > Otherwise the job is orphaned and block_job_cancel_sync in > bdrv_close_all() when quiting will hang. > > A simple reproducer is running blockdev-backup from null-co:// to > null-co://. > > Cc: qemu-sta...@nongnu.org > Signed-off-by: Fam Zheng

Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/11] qom: support arbitrary non-scalar properties with -object

2016-06-14 Thread Daniel P. Berrange
On Thu, Jun 09, 2016 at 04:43:35PM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > The current -object command line syntax only allows for > > creation of objects with scalar properties, or a list > > with a fixed scalar element type. Objects which have

Re: [Qemu-block] [PATCH v2] rbd:change error_setg() to error_setg_errno()

2016-06-14 Thread Max Reitz
On 09.05.2016 09:51, Vikhyat Umrao wrote: > Ceph RBD block driver does not use error_setg_errno() where > it is possible to use. This patch replaces error_setg() > from error_setg_errno(). > > Signed-off-by: Vikhyat Umrao > --- > block/rbd.c | 38

Re: [Qemu-block] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev

2016-06-14 Thread Eric Blake
On 06/14/2016 07:32 AM, Kevin Wolf wrote: > The raw-posix block driver actually supports byte-aligned requests now > on non-O_DIRECT images, like it already (and previously incorrectly) > claimed in bs->request_alignment. > > For some block drivers this means that a RMW cycle can be avoided when

Re: [Qemu-block] [PATCH v2 4/6] raw-posix: Switch to bdrv_co_* interfaces

2016-06-14 Thread Eric Blake
On 06/14/2016 07:32 AM, Kevin Wolf wrote: > In order to use the modern byte-based .bdrv_co_preadv/pwritev() > interface, this patch switches raw-posix to coroutine-based interfaces > as a first step. In terms of semantics and performance, it doesn't make > a difference with the existing code

Re: [Qemu-block] [PATCH v1 0/6] Report format specific info for LUKS block driver

2016-06-14 Thread Daniel P. Berrange
On Tue, Jun 14, 2016 at 03:56:30PM +0200, Max Reitz wrote: > On 07.06.2016 12:11, Daniel P. Berrange wrote: > > The 'qemu-img info' tool has ability to print format specific > > information, eg with qcow2 it reports two extra items: > > > > $ qemu-img info ~/VirtualMachines/demo.qcow2 > >

[Qemu-block] [PATCH v2 3/6] block: Prepare bdrv_aligned_pwritev() for byte-aligned requests

2016-06-14 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/io.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/block/io.c b/block/io.c index e75bce2..b261cc6 100644 ---

[Qemu-block] [PATCH v2 1/6] block: Byte-based bdrv_co_do_copy_on_readv()

2016-06-14 Thread Kevin Wolf
In a first step to convert the common I/O path to work on bytes rather than sectors, this converts the copy-on-read logic that is used by bdrv_aligned_preadv(). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH] qemu-img bench: Fix uninitialised writethrough mode

2016-06-14 Thread Max Reitz
On 14.06.2016 11:33, Kevin Wolf wrote: > If no -t option is specified, bool writethrough stayed uninitialised. > Initialise it as false, which makes cache=writeback the default cache > mode. > > Signed-off-by: Kevin Wolf > --- > qemu-img.c | 2 +- > 1 file changed, 1

[Qemu-block] [PATCH v2 4/6] raw-posix: Switch to bdrv_co_* interfaces

2016-06-14 Thread Kevin Wolf
In order to use the modern byte-based .bdrv_co_preadv/pwritev() interface, this patch switches raw-posix to coroutine-based interfaces as a first step. In terms of semantics and performance, it doesn't make a difference with the existing code whether we go from a coroutine to a callback-based

[Qemu-block] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev

2016-06-14 Thread Kevin Wolf
The raw-posix block driver actually supports byte-aligned requests now on non-O_DIRECT images, like it already (and previously incorrectly) claimed in bs->request_alignment. For some block drivers this means that a RMW cycle can be avoided when they write sub-sector metadata e.g. for cluster

Re: [Qemu-block] [Qemu-devel] [PATCH v5 02/11] qapi: allow QmpInputVisitor to auto-cast types

2016-06-14 Thread Daniel P. Berrange
On Thu, Jun 09, 2016 at 04:03:50PM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > Currently the QmpInputVisitor assumes that all scalar > > values are directly represented as their final types. > > ie it assumes an 'int' is using QInt, and a 'bool' is >

[Qemu-block] [PATCH v2 2/6] block: Prepare bdrv_aligned_preadv() for byte-aligned requests

2016-06-14 Thread Kevin Wolf
This patch makes bdrv_aligned_preadv() ready to accept byte-aligned requests. Note that this doesn't mean that such requests are actually made. The caller still ensures that all requests are aligned to at least 512 bytes. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake

Re: [Qemu-block] [PATCH v4 04/11] nbd: Improve server handling of bogus commands

2016-06-14 Thread Paolo Bonzini
On 13/06/2016 23:41, Alex Bligh wrote: > That's one of the reasons that there is a proposal to add > STRUCTURED_READ to the spec (although I still haven't had time to > implement that for qemu), so that we have a newer approach that allows > for proper error handling without ambiguity on whether

[Qemu-block] [PATCH v2 6/6] block: Don't enforce 512 byte minimum alignment

2016-06-14 Thread Kevin Wolf
If block drivers say that they can do an alignment < 512 bytes, let's just suppose they mean it. raw-posix used to be an offender with respect to this, but it can actually deal with byte-aligned requests now. The default is still 512 bytes for any drivers that only implement sector-based

[Qemu-block] [PATCH v2 0/6] block: Enable byte granularity I/O

2016-06-14 Thread Kevin Wolf
Previous series have already converted some block drivers to byte-based rather than sector-based interfaces. However, the common I/O path as well as raw-posix still enforced a minimum alignment of 512 bytes because some sector-based logic was involved. This patch series removes these limitations

Re: [Qemu-block] [PATCH] block-backend: allow flush on devices with open tray

2016-06-14 Thread Max Reitz
On 10.06.2016 23:59, John Snow wrote: > If a device still has an attached BDS because the medium has not yet > been removed, we will be unable to migrate to a new host because > blk_flush will return an error for that backend. > > Replace the call to blk_is_available to blk_is_inserted to weaken

Re: [Qemu-block] [PATCH 6/6] block: Don't enforce 512 byte minimum alignment

2016-06-14 Thread Kevin Wolf
Am 14.06.2016 um 14:09 hat Stefan Hajnoczi geschrieben: > On Wed, Jun 08, 2016 at 04:10:11PM +0200, Kevin Wolf wrote: > > diff --git a/block.c b/block.c > > index f54bc25..3d850a2 100644 > > --- a/block.c > > +++ b/block.c > > @@ -937,7 +937,7 @@ static int bdrv_open_common(BlockDriverState *bs,

Re: [Qemu-block] [PATCH v3 3/5] block/null: Implement bdrv_refresh_filename()

2016-06-14 Thread Max Reitz
On 12.06.2016 06:08, Fam Zheng wrote: > On Fri, 06/10 20:57, Max Reitz wrote: >> Signed-off-by: Max Reitz > > The commit message could go a little more informative. Seems nothing special > in > the added callback, aren't things supposed to just work without this patch? > What

Re: [Qemu-block] [PATCH v3 4/5] iotests: Add test for post-mirror backing chains

2016-06-14 Thread Max Reitz
On 12.06.2016 06:17, Fam Zheng wrote: > On Fri, 06/10 20:57, Max Reitz wrote: >> +import os >> +import stat >> +import time > > Unused import 'stat' and 'time'? That happens when you copy old tests and don't check stuff like this... Well, it won't hurt, but I guess now I may have enough reason

Re: [Qemu-block] [PATCH 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev

2016-06-14 Thread Stefan Hajnoczi
On Wed, Jun 08, 2016 at 04:10:10PM +0200, Kevin Wolf wrote: > The raw-posix block driver actually supports byte-aligned requests now > on non-O_DIRECT images, like it already (and previously incorrectly) > claimed in bs->request_alignment. > > For some block drivers this means that a RMW cycle

Re: [Qemu-block] [PATCH 2/6] block: Prepare bdrv_aligned_preadv() for byte-aligned requests

2016-06-14 Thread Stefan Hajnoczi
On Wed, Jun 08, 2016 at 04:10:07PM +0200, Kevin Wolf wrote: > This patch makes bdrv_aligned_preadv() ready to accept byte-aligned > requests. Note that this doesn't mean that such requests are actually > made. The caller still ensures that all requests are aligned to at least > 512 bytes. > >

Re: [Qemu-block] [PATCH 3/6] block: Prepare bdrv_aligned_pwritev() for byte-aligned requests

2016-06-14 Thread Stefan Hajnoczi
On Wed, Jun 08, 2016 at 04:10:08PM +0200, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/io.c | 13 + > 1 file changed, 5 insertions(+), 8 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [Qemu-block] [PATCH 0/6] block: Enable byte granularity I/O

2016-06-14 Thread Stefan Hajnoczi
On Mon, Jun 13, 2016 at 03:43:06PM +0200, Kevin Wolf wrote: > Am 13.06.2016 um 15:27 hat Stefan Hajnoczi geschrieben: > > On Wed, Jun 08, 2016 at 04:10:05PM +0200, Kevin Wolf wrote: > > > Previous series have already converted some block drivers to byte-based > > > rather > > > than sector-based

Re: [Qemu-block] [PATCH 1/6] block: Byte-based bdrv_co_do_copy_on_readv()

2016-06-14 Thread Stefan Hajnoczi
On Wed, Jun 08, 2016 at 04:10:06PM +0200, Kevin Wolf wrote: > In a first step to convert the common I/O path to work on bytes rather > than sectors, this converts the copy-on-read logic that is used by > bdrv_aligned_preadv(). > > Signed-off-by: Kevin Wolf > --- > block/io.c

  1   2   >