Re: [Qemu-block] [Qemu-devel] [PATCH v6 04/22] block: Introduce image file locking

2016-06-07 Thread Fam Zheng
On Tue, 06/07 21:51, Jason Dillaman wrote: > On Fri, Jun 3, 2016 at 4:48 AM, Fam Zheng wrote: > > +typedef enum { > > +/* The values are ordered so that lower number implies higher > > restriction. > > + * Starting from 1 to make 0 an invalid value. > > + * */ > > +

Re: [Qemu-block] [Qemu-devel] [PATCH v6 04/22] block: Introduce image file locking

2016-06-07 Thread Jason Dillaman
On Fri, Jun 3, 2016 at 4:48 AM, Fam Zheng wrote: > +typedef enum { > +/* The values are ordered so that lower number implies higher > restriction. > + * Starting from 1 to make 0 an invalid value. > + * */ > +BDRV_LOCKF_EXCLUSIVE = 1, > +BDRV_LOCKF_SHARED, >

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

2016-06-07 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 +

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

2016-06-07 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 v20 10/10] support replication driver in blockdev-add

2016-06-07 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 06/10] auto complete active commit

2016-06-07 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 v20 03/10] Backup: export interfaces for extra serialization

2016-06-07 Thread Changlong Xie
Normal backup(sync='none') workflow: step 1. NBD peformance I/O write from client to server qcow2_co_writev bdrv_co_writev ... bdrv_aligned_pwritev notifier_with_return_list_notify -> backup_do_cow bdrv_driver_pwritev // write new contents step 2. drive-backup

[Qemu-block] [PATCH v20 04/10] Link backup into block core

2016-06-07 Thread Changlong Xie
From: Wen Congyang Some programs that add a dependency on it will use the block layer directly. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Signed-off-by:

[Qemu-block] [PATCH v20 00/10] Block replication for continuous checkpoints

2016-06-07 Thread Changlong Xie
Block replication is a very important feature which is used for continuous checkpoints(for example: COLO). You can get the detailed information about block replication from here: http://wiki.qemu.org/Features/BlockReplication Usage: Please refer to docs/block-replication.txt You can get the

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

2016-06-07 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

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

2016-06-07 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 |

Re: [Qemu-block] [Qemu-devel] [PATCH v4 04/28] qapi: Add parameter to visit_end_*

2016-06-07 Thread Eric Blake
On 06/01/2016 09:36 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Rather than making the dealloc visitor track of stack of pointers >> remembered during visit_start_* in order to free them during >> visit_end_*, it's a lot easier to just make all callers pass the >>

Re: [Qemu-block] [PATCH] Report error when opening device with locked tray

2016-06-07 Thread John Snow
On 06/07/2016 06:28 AM, Kevin Wolf wrote: > Am 06.06.2016 um 21:40 hat Colin Lord geschrieben: >> This commit causes qmp_blockdev_change_medium to report an error if an >> attempt is made to open a device with a locked tray. > > The old behaviour is that the command seemingly succeeds, but the

Re: [Qemu-block] [PATCH v1 6/6] block: convert to use qapi_stringify_ImageInfoSpecific

2016-06-07 Thread Eric Blake
On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > When 'qemu-img info' prints out format specific information, > it first converts the QAPI object into a JSON based QObject > data structure. Unfortunately structs have to be turned into > dicts, which looses all information about field ordering,

Re: [Qemu-block] [PATCH v1 4/6] qapi: add a text output visitor for pretty printing types

2016-06-07 Thread Eric Blake
On 06/07/2016 10:20 AM, Daniel P. Berrange wrote: > On Tue, Jun 07, 2016 at 10:09:48AM -0600, Eric Blake wrote: >> On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: >>> The current approach for pretty-printing QAPI types is to >>> convert them to JSON using the QMP output visitor and then >>>

Re: [Qemu-block] [PATCH v1 5/6] qapi: generate a qapi_stringify_TYPENAME method for all types

2016-06-07 Thread Eric Blake
On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > There are sometimes cases where one might wish to have a > pretty string representation of a QAPI type. For example, > the 'qemu-img info' tool wants to print out ImageInfoSpecific > type in a humand friendly format. Also when debugging problems

Re: [Qemu-block] [PATCH v1 4/6] qapi: add a text output visitor for pretty printing types

2016-06-07 Thread Daniel P. Berrange
On Tue, Jun 07, 2016 at 10:09:48AM -0600, Eric Blake wrote: > On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > > The current approach for pretty-printing QAPI types is to > > convert them to JSON using the QMP output visitor and then > > pretty-print the JSON document. This has an unfixable

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

2016-06-07 Thread Eric Blake
On 06/07/2016 09:51 AM, Daniel P. Berrange wrote: >> >> Missing documentation, but why do you need it, since it is identical to >> QCryptoBlockInfoLUKSSlot in the previous patch? >> > > Essentially yes, and this is something I meant to mention in > the cover letter. > > I wasn't really sure on

Re: [Qemu-block] [PATCH v1 4/6] qapi: add a text output visitor for pretty printing types

2016-06-07 Thread Eric Blake
On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > The current approach for pretty-printing QAPI types is to > convert them to JSON using the QMP output visitor and then > pretty-print the JSON document. This has an unfixable problem > that structs get their keys printed out in random order,

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

2016-06-07 Thread Daniel P. Berrange
On Tue, Jun 07, 2016 at 09:36:08AM -0600, Eric Blake wrote: > On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > > +++ b/qapi/block-core.json > > @@ -74,6 +74,37 @@ > >'extents': ['ImageInfo'] > >} } > > > > + > > +{ 'struct': 'ImageInfoSpecificLUKSSlot', > > + 'data': {'active':

Re: [Qemu-block] [PATCH v1 3/6] qapi: assert that visitor impls have required callbacks

2016-06-07 Thread Eric Blake
On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > Not all visitor implementations supply the full set of > visitor callback functions. For example, the string > output visitor does not provide 'start_struct' and > friends. If you don't know this and feed it an object > that uses structs, you'll

Re: [Qemu-block] [Qemu-devel] [PATCH] scsi-disk: fix reads from scsi-disk devices

2016-06-07 Thread Benjamin Herrenschmidt
On Fri, 2016-06-03 at 06:17 +0100, Mark Cave-Ayland wrote: > Commit fcaafb1001b9c42817714dd3b2aadcfdb997b53d accidentally broke > reads from > scsi-disk devices when being updated from its original form to use > the new > byte-based block functions. Add the extra missing sector to offset >

Re: [Qemu-block] [PATCH] block: Don't emulate natively supported pwritev flags

2016-06-07 Thread Eric Blake
On 06/07/2016 07:56 AM, Kevin Wolf wrote: > Drivers that implement .bdrv_co_pwritev() get the flags passed as an > argument to said function, but we also unconditionally emulate the flags > anyway. We shouldn't do that. > > Fix this by clearing all flags that the driver supports natively after >

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

2016-06-07 Thread Daniel P. Berrange
On Tue, Jun 07, 2016 at 06:04:36AM -0600, Eric Blake wrote: > On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > > uuid: 6ddee74b-3a22-408c-8909-6789d4fa2594 > > slots: > > [0]: > > active: true > > iters: 572706 > >

Re: [Qemu-block] [PATCH v2 0/5] block: Introduce qemu-img bench

2016-06-07 Thread Kevin Wolf
Am 06.06.2016 um 14:45 hat Kevin Wolf geschrieben: > After merging Den's qcow2 patch to avoid duplicated flushes, I thought I would > be nice to reproduce the problem and I remembered 'qemu-img bench', which I > had > posted before as part of more than one RFC series, but which never made it to >

[Qemu-block] [PATCH] block: Don't emulate natively supported pwritev flags

2016-06-07 Thread Kevin Wolf
Drivers that implement .bdrv_co_pwritev() get the flags passed as an argument to said function, but we also unconditionally emulate the flags anyway. We shouldn't do that. Fix this by clearing all flags that the driver supports natively after it returns from .bdrv_co_pwritev(). Fixes: 4df863f3

Re: [Qemu-block] [PATCH 6/5] block: Fix harmless off-by-one in bdrv_aligned_preadv()

2016-06-07 Thread Kevin Wolf
Am 04.06.2016 um 01:06 hat Eric Blake geschrieben: > 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

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

2016-06-07 Thread Kevin Wolf
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_discard and > discard_alignment. Rename them, using 'pdiscard' as an aid to > track which remaining discard interfaces need

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

2016-06-07 Thread Kevin Wolf
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 > and opt_transfer_length. Rename them (dropping the _length suffix) > so that the compiler will help us catch

Re: [Qemu-block] [Qemu-devel] coroutines: block: Co-routine re-entered recursively when migrating disk with iothreads

2016-06-07 Thread Jason J. Herne
On 06/06/2016 10:44 PM, Fam Zheng wrote: On Mon, 06/06 14:55, Jason J. Herne wrote: I'll see if I can reproduce it here. Fam Hi Fam, Have you had any luck reproducing this? No I cannot reproduce so far. I can hit the problem 100% of the time. Is there any info I can provide to help?

Re: [Qemu-block] [PATCH 1/5] block: Tighter assertions on bdrv_aligned_preadv()

2016-06-07 Thread Kevin Wolf
Am 03.06.2016 um 19:03 hat Eric Blake geschrieben: > Make sure everything is aligned to the passed-in alignment, > not just sectors. Also makes sure that the computation of > max_nb_sectors later in the function will not divide by > zero, by guaranteeing align is at least a sector. > >

Re: [Qemu-block] [PATCH 2/5] block: Honor flags during bdrv_aligned_preadv()

2016-06-07 Thread Kevin Wolf
Am 03.06.2016 um 19:03 hat Eric Blake geschrieben: > Not that we pass any flags during reads yet, but we may want to > support BDRV_REQ_FUA on reads in the future. So don't throw > away the input flags. > > Signed-off-by: Eric Blake Do we want to pass flags to

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

2016-06-07 Thread Eric Blake
On 06/07/2016 04:11 AM, 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 > image: /home/berrange/VirtualMachines/demo.qcow2 > file format: qcow2

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

2016-06-07 Thread Paolo Bonzini
On 07/06/2016 12:08, Kevin Wolf wrote: >>> > > Something in this patch is causing qemu-iotests 77 to infloop; we may >>> > > decide it is just easier to drop this patch rather than find all the >>> > > places where the request_alignment must be preserved across what >>> > > otherwise zeroes out

Re: [Qemu-block] [PATCH] Report error when opening device with locked tray

2016-06-07 Thread Kevin Wolf
Am 06.06.2016 um 21:40 hat Colin Lord geschrieben: > This commit causes qmp_blockdev_change_medium to report an error if an > attempt is made to open a device with a locked tray. The old behaviour is that the command seemingly succeeds, but the medium isn't actually changed. Correct? Should this

[Qemu-block] [PATCH v1 6/6] block: convert to use qapi_stringify_ImageInfoSpecific

2016-06-07 Thread Daniel P. Berrange
When 'qemu-img info' prints out format specific information, it first converts the QAPI object into a JSON based QObject data structure. Unfortunately structs have to be turned into dicts, which looses all information about field ordering, so the data printed appears in a semi-random order.

[Qemu-block] [PATCH v1 5/6] qapi: generate a qapi_stringify_TYPENAME method for all types

2016-06-07 Thread Daniel P. Berrange
There are sometimes cases where one might wish to have a pretty string representation of a QAPI type. For example, the 'qemu-img info' tool wants to print out ImageInfoSpecific type in a humand friendly format. Also when debugging problems in code it is often useful to insert code to print out a

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

2016-06-07 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 v1 4/6] qapi: add a text output visitor for pretty printing types

2016-06-07 Thread Daniel P. Berrange
The current approach for pretty-printing QAPI types is to convert them to JSON using the QMP output visitor and then pretty-print the JSON document. This has an unfixable problem that structs get their keys printed out in random order, since JSON dicts do not contain any key ordering information.

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

2016-06-07 Thread Daniel P. Berrange
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: /home/berrange/VirtualMachines/demo.qcow2 file format: qcow2 virtual size: 3.0G (3221225472 bytes) disk size: 140K

[Qemu-block] [PATCH v1 3/6] qapi: assert that visitor impls have required callbacks

2016-06-07 Thread Daniel P. Berrange
Not all visitor implementations supply the full set of visitor callback functions. For example, the string output visitor does not provide 'start_struct' and friends. If you don't know this and feed it an object that uses structs, you'll get a crash: Segmentation fault (core dumped) Crashing

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

2016-06-07 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] [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit

2016-06-07 Thread Kevin Wolf
Am 03.06.2016 um 23:43 hat Eric Blake geschrieben: > On 06/03/2016 11:49 AM, Eric Blake wrote: > > On 06/03/2016 11:03 AM, Eric Blake wrote: > >> It makes more sense to have ALL block size limit constraints > >> in the same struct. Improve the documentation while at it. > >> > >> Note that

[Qemu-block] [PATCH v3 3/5] qcow2: Make copy_sectors() byte based

2016-06-07 Thread Kevin Wolf
This will allow copy on write operations where the overwritten part of the cluster is not aligned to sector boundaries. Also rename the function because it has nothing to do with sectors any more. Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 55

Re: [Qemu-block] [PATCH v2 3/5] qcow2: Make copy_sectors() byte based

2016-06-07 Thread Kevin Wolf
Am 07.06.2016 um 05:47 hat Eric Blake geschrieben: > On 06/06/2016 08:59 AM, Kevin Wolf wrote: > > This will allow copy on write operations where the overwritten part of > > the cluster is not aligned to sector boundaries. > > > > Also rename the function because it has nothing to do with sectors

Re: [Qemu-block] [PATCH] qcow2 resize with snapshot

2016-06-07 Thread zhangzhiming
hi, need for someone's review of my code. no one does it for nearly one week. thanks! zhangzhiming zhangzhimin...@meituan.com > On Jun 1, 2016, at 6:24 PM, zhangzhiming wrote: > > hi, here are all changes of my code. thanks for the review! > > zhangzhiming >