Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/3] error: Remove unnecessary local_err variables

2016-06-14 Thread Markus Armbruster
Eduardo Habkost writes: > On Mon, Jun 13, 2016 at 08:49:37PM +0200, Markus Armbruster wrote: >> Eric Blake writes: > [...] >> >> >> >> See, e.g.: >> >> >> >> void qmp_guest_suspend_disk(Error **errp) >> >> { >> >> Error *local_err = NULL; >> >>

[Qemu-block] [PATCH 4/7] trace: enable tracing in qemu-io

2016-06-14 Thread Denis V. Lunev
Moving trace_init_backends() into trace_opt_parse() is not possible. This should be called after daemonize() in vl.c. Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake CC: Paolo Bonzini CC: Stefan Hajnoczi CC:

[Qemu-block] [PATCH 6/7] qemu-img: move common options parsing before commands processing

2016-06-14 Thread Denis V. Lunev
This is necessary to enable creation of common qemu-img options which will be specified before command. The patch also enables '-V' alias to '--version' (exactly like in other block utilities) and documents this change. Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake

[Qemu-block] [PATCH v20 Resend 05/10] docs: block replication's description

2016-06-14 Thread Changlong Xie
From: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Changlong Xie --- docs/block-replication.txt |

[Qemu-block] [PATCH v20 Resend 10/10] support replication driver in blockdev-add

2016-06-14 Thread Changlong Xie
From: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Changlong Xie Reviewed-by: Eric Blake

[Qemu-block] [PATCH v20 Resend 07/10] Introduce new APIs to do replication operation

2016-06-14 Thread Changlong Xie
This commit introduces six replication interfaces(for block, network etc). Firstly we can use replication_(new/remove) to create/destroy replication instances, then in migration we can use replication_(start/stop/do_checkpoint /get_error)_all to handle all replication operations. More detail

Re: [Qemu-block] [PATCH 3/5] block: Switch transfer length bounds to byte-based

2016-06-14 Thread Kevin Wolf
Am 12.06.2016 um 00:06 hat Eric Blake geschrieben: > On 06/07/2016 06:45 AM, Kevin Wolf wrote: > > Am 03.06.2016 um 19:03 hat Eric Blake geschrieben: > >> Sector-based limits are awkward to think about; in our on-going > >> quest to move to byte-based interfaces, convert max_transfer_length > >>

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

2016-06-14 Thread Stefan Hajnoczi
On Mon, Jun 13, 2016 at 11:39:48AM +0200, Kevin Wolf wrote: > Am 12.06.2016 um 08:56 hat Fam Zheng geschrieben: > > We only care about the associated backend, so blk_drain is more > > appropriate here. > > > > Signed-off-by: Fam Zheng > > [ Cc: John ] > > > --- > >

[Qemu-block] [PATCH v20 Resend 08/10] Implement new driver for block replication

2016-06-14 Thread Changlong Xie
From: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Changlong Xie --- block/Makefile.objs | 1 +

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

2016-06-14 Thread Markus Armbruster
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 unnecessary variables for function > return value. > *

[Qemu-block] [PATCH 6/7] qemu-img: move common options parsing before commands processing

2016-06-14 Thread Denis V. Lunev
This is necessary to enable creation of common qemu-img options which will be specified before command. The patch also enables '-V' alias to '--version' (exactly like in other block utilities) and documents this change. Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake

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

2016-06-14 Thread Denis V. Lunev
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 CC: Paolo Bonzini CC: Stefan

[Qemu-block] [PATCH v6 0/7] trace: enable tracing in qemu-io/qemu-nbd/qemu-img

2016-06-14 Thread Denis V. Lunev
Changes from v5: - added missed hunk into patch #7 Changes from v4: - synced help descriprion for --trace with man for qemu.1/qemu-img.1/qemu-nbd.8 - moved @findex from qemu-option-trace.texi Changes from v3: - fixed difference in help/man for qemu-img/qemu-nbd - created separate .texi to

[Qemu-block] [PATCH v20 Resend 09/10] tests: add unit test case for replication

2016-06-14 Thread Changlong Xie
Signed-off-by: Wen Congyang Signed-off-by: Changlong Xie --- tests/.gitignore | 1 + tests/Makefile | 4 + tests/test-replication.c | 555 +++ 3 files changed, 560 insertions(+)

[Qemu-block] [PATCH 2/7] doc: sync help descriprion for --trace with man for qemu.1

2016-06-14 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Paolo Bonzini CC: Stefan Hajnoczi CC: Kevin Wolf --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-block] [PATCH v20 Resend 02/10] Backup: clear all bitmap when doing block checkpoint

2016-06-14 Thread Changlong Xie
From: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by: Changlong Xie --- block/backup.c |

[Qemu-block] [PATCH v20 Resend 06/10] auto complete active commit

2016-06-14 Thread Changlong Xie
From: Wen Congyang Auto complete mirror job in background to prevent from blocking synchronously Signed-off-by: Wen Congyang Signed-off-by: Changlong Xie --- block/mirror.c| 13 + blockdev.c

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

2016-06-14 Thread Denis V. Lunev
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 CC: Paolo Bonzini CC: Stefan

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

2016-06-14 Thread Kevin Wolf
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 insertion(+), 1 deletion(-) diff --git a/qemu-img.c

Re: [Qemu-block] [PATCH v2 0/2] Fix incomplete aio_preadv byte conversion in mirroring

2016-06-14 Thread Kevin Wolf
Am 13.06.2016 um 20:56 hat Eric Blake geschrieben: > v2: Split the bug fix from the addition of assertions, add a > BDRV_REQ_MASK constant [famz], stick assertions at the more > common entry points Thanks, applied to the block branch. Kevin

[Qemu-block] [PATCH 3/7] trace: move qemu_trace_opts to trace/control.c

2016-06-14 Thread Denis V. Lunev
The patch also creates trace_opt_parse() helper in trace/control.c to reuse this code in next patches for qemu-nbd and qemu-io. The patch also makes trace_init_events() static, as this call is not used outside the module anymore. Signed-off-by: Denis V. Lunev Reviewed-by: Eric

Re: [Qemu-block] [Qemu-devel] [RFC v2 3/3] Remove unnecessary variables for function return value

2016-06-14 Thread Markus Armbruster
Eduardo Habkost writes: > On Mon, Jun 13, 2016 at 01:29:47PM +0200, Markus Armbruster wrote: >> Eduardo Habkost writes: >> >> > Use Coccinelle script to replace 'ret = E; return ret' with >> > 'return E'. The script will do the substitution only when

Re: [Qemu-block] [PATCH v2 2/2] block: Assert that flags are in range

2016-06-14 Thread Stefan Hajnoczi
On Mon, Jun 13, 2016 at 12:56:35PM -0600, Eric Blake wrote: > Add a new BDRV_REQ_MASK constant, and use it to make sure that > caller flags are always valid. > > Tested with 'make check' and with qemu-iotests on both '-raw' > and '-qcow2'; the only failure turned up was fixed in the > previous

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

2016-06-14 Thread Denis V. Lunev
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 Bonzini CC: Stefan Hajnoczi

[Qemu-block] [PATCH v20 Resend 01/10] unblock backup operations in backing file

2016-06-14 Thread Changlong Xie
From: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: Changlong Xie --- block.c | 17 + 1 file changed, 17 insertions(+) diff --git a/block.c b/block.c index 736432f..dcf63f4 100644 --- a/block.c

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

[Qemu-block] [PATCH 2/7] doc: sync help descriprion for --trace with man for qemu.1

2016-06-14 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Paolo Bonzini CC: Stefan Hajnoczi CC: Kevin Wolf --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2016-06-14 Thread Denis V. Lunev
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 Bonzini CC: Stefan Hajnoczi

[Qemu-block] [PATCH 4/7] trace: enable tracing in qemu-io

2016-06-14 Thread Denis V. Lunev
Moving trace_init_backends() into trace_opt_parse() is not possible. This should be called after daemonize() in vl.c. Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake CC: Paolo Bonzini CC: Stefan Hajnoczi CC:

[Qemu-block] [PATCH v5 0/7] trace: enable tracing in qemu-io/qemu-nbd/qemu-img

2016-06-14 Thread Denis V. Lunev
Changes from v4: - synced help descriprion for --trace with man for qemu.1/qemu-img.1/qemu-nbd.8 - moved @findex from qemu-option-trace.texi Changes from v3: - fixed difference in help/man for qemu-img/qemu-nbd - created separate .texi to contain trace description, proper dependency is added to

[Qemu-block] [PATCH 3/7] trace: move qemu_trace_opts to trace/control.c

2016-06-14 Thread Denis V. Lunev
The patch also creates trace_opt_parse() helper in trace/control.c to reuse this code in next patches for qemu-nbd and qemu-io. The patch also makes trace_init_events() static, as this call is not used outside the module anymore. Signed-off-by: Denis V. Lunev Reviewed-by: Eric

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

2016-06-14 Thread Denis V. Lunev
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 CC: Kevin Wolf --- Makefile

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

2016-06-14 Thread Denis V. Lunev
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 CC: Kevin Wolf --- Makefile

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

2016-06-14 Thread Denis V. Lunev
On 06/14/2016 12:16 PM, Denis V. Lunev wrote: Changes from v4: - synced help descriprion for --trace with man for qemu.1/qemu-img.1/qemu-nbd.8 - moved @findex from qemu-option-trace.texi Changes from v3: - fixed difference in help/man for qemu-img/qemu-nbd - created separate .texi to contain

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] [Qemu-devel] [PATCH v5 01/11] qdict: implement a qdict_crumple method for un-flattening a dict

2016-06-14 Thread Daniel P. Berrange
On Thu, Jun 09, 2016 at 03:20:47PM +0200, Markus Armbruster wrote: > I apologize for the lateness of this review. > > "Daniel P. Berrange" writes: > > > The qdict_flatten() method will take a dict whose elements are > > further nested dicts/lists and flatten them by

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 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 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 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 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.

[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 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 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,

[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 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

[Qemu-block] [PATCH v2 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 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 image:

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] 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 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 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] [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 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

[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 ---

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] [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 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 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 > >

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] [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 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

[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 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

[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

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] 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 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 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 >

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

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 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] [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 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 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 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:

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

[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 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 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 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 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:

[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 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 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 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

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] [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

[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] [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 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] 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 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

  1   2   >