Re: [Qemu-block] [Qemu-devel] [PATCH v5 0/2] qemu-img: Document --force-share / -U

2018-01-16 Thread Fam Zheng
Ping? On Tue, Dec 26, 2017 at 10:52 AM, Fam Zheng wrote: > v5: Clean up the @table @var section first. [Kevin, Peter] > > Fam Zheng (2): > qemu-img.texi: Clean up parameter list > qemu-img: Document --force-share / -U > > qemu-img.texi | 75 >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 31/32] qcow2: Allow configuring the L2 slice size

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > Now that the code is ready to handle L2 slices we can finally add an > option to allow configuring their size. > > An L2 slice is the portion of an L2 table that is read by the qcow2 > cache. Until now the cache was always reading full L2 tables,

Re: [Qemu-block] [Qemu-devel] [PATCH v2 26/32] qcow2: Update qcow2_truncate() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > The qcow2_truncate() code is mostly independent from whether > we're using L2 slices or full L2 tables, but in full and > falloc preallocation modes new L2 tables are allocated using > qcow2_alloc_cluster_link_l2(). Therefore the code needs to be >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 25/32] qcow2: Update expand_zero_clusters_in_l1() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > expand_zero_clusters_in_l1() expands zero clusters as a necessary step > to downgrade qcow2 images to a version that doesn't support metadata > zero clusters. This function takes an L1 table (which may or may not > be active) and iterates over all

Re: [Qemu-block] [Qemu-devel] [PATCH v2 24/32] qcow2: Update qcow2_update_snapshot_refcount() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > qcow2_update_snapshot_refcount() increases the refcount of all > clusters of a given snapshot. In order to do that it needs to load all > its L2 tables and iterate over their entries. Since we'll be loading > L2 slices instead of full tables we need

Re: [Qemu-block] [Qemu-devel] [PATCH v2 23/32] qcow2: Update zero_single_l2() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > zero_single_l2() limits the number of clusters to be zeroed to the > amount that fits inside an L2 table. Since we'll be loading L2 slices > instead of full tables we need to update that limit. > > Apart from that, this function doesn't need any

Re: [Qemu-block] [Qemu-devel] [PATCH v2 22/32] qcow2: Update discard_single_l2() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > discard_single_l2() limits the number of clusters to be discarded to > the amount that fits inside an L2 table. Since we'll be loading L2 > slices instead of full tables we need to update that limit. > > Apart from that, this function doesn't need

Re: [Qemu-block] [Qemu-devel] [PATCH v2 21/32] qcow2: Update handle_alloc() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > handle_alloc() loads an L2 table and limits the number of checked > clusters to the amount that fits inside that table. Since we'll be > loading L2 slices instead of full tables we need to update that limit. > > Apart from that, this function

Re: [Qemu-block] [Qemu-devel] [PATCH v2 20/32] qcow2: Update handle_copied() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > handle_copied() loads an L2 table and limits the number of checked > clusters to the amount that fits inside that table. Since we'll be > loading L2 slices instead of full tables we need to update that limit. > > Apart from that, this function

Re: [Qemu-block] [Qemu-devel] [PATCH v2 19/32] qcow2: Update qcow2_alloc_cluster_link_l2() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > There's a loop in this function that iterates over the L2 entries in a > table, so now we need to assert that it remains within the limits of > an L2 slice. > > Apart from that, this function doesn't need any additional changes, so > this patch

Re: [Qemu-block] [Qemu-devel] [PATCH v2 18/32] qcow2: Update qcow2_get_cluster_offset() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > qcow2_get_cluster_offset() checks how many contiguous bytes are > available at a given offset. The returned number of bytes is limited > by the amount that can be addressed without having to load more than > one L2 table. > > Since we'll be loading

Re: [Qemu-block] [Qemu-devel] [PATCH v2 17/32] qcow2: Update get_cluster_table() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This patch updates get_cluster_table() to return L2 slices instead of > full L2 tables. > > The code itself needs almost no changes, it only needs to call > offset_to_l2_slice_index() instead of offset_to_l2_index(). This patch > also renames all

Re: [Qemu-block] [Qemu-devel] [PATCH v2 16/32] qcow2: Update l2_allocate() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This patch updates l2_allocate() to support the qcow2 cache returning > L2 slices instead of full L2 tables. > > The old code simply gets an L2 table from the cache and initializes it > with zeroes or with the contents of an existing table. With a

Re: [Qemu-block] [Qemu-devel] [PATCH v2 15/32] qcow2: Update l2_load() to support L2 slices

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > Each entry in the qcow2 L2 cache stores a full L2 table (which uses a > complete cluster in the qcow2 image). A cluster is usually too large > to be used efficiently as the size for a cache entry, so we want to > decouple both values by allowing

Re: [Qemu-block] [Qemu-devel] [PATCH v2 14/32] qcow2: Add offset_to_l2_slice_index()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > Similar to offset_to_l2_index(), this function takes a guest offset > and returns the index in the L2 slice that contains its L2 entry. > > An L2 slice has currently the same size as an L2 table (one cluster), > so both functions return the same

Re: [Qemu-block] [Qemu-devel] [PATCH v2 13/32] qcow2: Add l2_slice_size field to BDRVQcow2State

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > The BDRVQcow2State structure contains an l2_size field, which stores > the number of 64-bit entries in an L2 table. > > For efficiency reasons we want to be able to load slices instead of > full L2 tables, so we need to know how many entries an L2

Re: [Qemu-block] [Qemu-devel] [PATCH v2 12/32] qcow2: Add offset_to_l1_index()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > Similar to offset_to_l2_index(), this function returns the index in > the L1 table for a given guest offset. This is only used in a couple > of places and it's not a particularly complex calculation, but it > makes the code a bit more readable. > >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/32] qcow2: Remove BDS parameter from qcow2_cache_is_table_offset()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was only using the BlockDriverState parameter to pass it > to qcow2_cache_get_table_addr(). This is no longer necessary so this > parameter can be removed. > > Signed-off-by: Alberto Garcia > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/32] qcow2: Remove BDS parameter from qcow2_cache_discard()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was only using the BlockDriverState parameter to pass it > to qcow2_cache_get_table_idx() and qcow2_cache_table_release(). This > is no longer necessary so this parameter can be removed. > > Signed-off-by: Alberto Garcia

Re: [Qemu-block] [Qemu-devel] [PATCH v2 09/32] qcow2: Remove BDS parameter from qcow2_cache_clean_unused()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was only using the BlockDriverState parameter to pass it > to qcow2_cache_table_release(). This is no longer necessary so this > parameter can be removed. > > Signed-off-by: Alberto Garcia > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 08/32] qcow2: Remove BDS parameter from qcow2_cache_destroy()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was never using the BlockDriverState parameter so it can > be safely removed. > > Signed-off-by: Alberto Garcia > --- > block/qcow2-cache.c | 2 +- > block/qcow2.c | 16 > block/qcow2.h

Re: [Qemu-block] [Qemu-devel] [PATCH v2 07/32] qcow2: Remove BDS parameter from qcow2_cache_put()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was only using the BlockDriverState parameter to pass it > to qcow2_cache_get_table_idx(). This is no longer necessary so this > parameter can be removed. > > Signed-off-by: Alberto Garcia > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 06/32] qcow2: Remove BDS parameter from qcow2_cache_entry_mark_dirty()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was only using the BlockDriverState parameter to pass it > to qcow2_cache_get_table_idx(). This is no longer necessary so this > parameter can be removed. > > Signed-off-by: Alberto Garcia > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 05/32] qcow2: Remove BDS parameter from qcow2_cache_table_release()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was only using the BlockDriverState parameter to get the > cache table size (since it was equal to the cluster size). This is no > longer necessary so this parameter can be removed. > > Signed-off-by: Alberto Garcia

Re: [Qemu-block] [Qemu-devel] [PATCH v2 04/32] qcow2: Remove BDS parameter from qcow2_cache_get_table_idx()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was only using the BlockDriverState parameter to get the > cache table size (since it was equal to the cluster size). This is no > longer necessary so this parameter can be removed. > > Signed-off-by: Alberto Garcia

Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/32] qcow2: Remove BDS parameter from qcow2_cache_get_table_addr()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function was only using the BlockDriverState parameter to get the > cache table size (since it was equal to the cluster size). This is no > longer necessary so this parameter can be removed. > > Signed-off-by: Alberto Garcia

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/32] qcow2: Add table size field to Qcow2Cache

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > The table size in the qcow2 cache is currently equal to the cluster > size. This doesn't allow us to use the cache memory efficiently, > particularly with large cluster sizes, so we need to be able to have > smaller cache tables that are independent

Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/32] qcow2: Fix documentation of get_cluster_table()

2018-01-16 Thread Eric Blake
On 12/15/2017 06:53 AM, Alberto Garcia wrote: > This function has not been returning the offset of the L2 table since > commit 3948d1d4876065160583e79533bf604481063833 > > Signed-off-by: Alberto Garcia > --- > block/qcow2-cluster.c | 3 +-- > 1 file changed, 1 insertion(+), 2

Re: [Qemu-block] [PATCH v6 9/9] iotest 134: test cluster-misaligned encrypted write

2018-01-16 Thread Eric Blake
On 01/16/2018 07:04 AM, Anton Nefedov wrote: > COW (even empty/zero) areas require encryption too > > Signed-off-by: Anton Nefedov > --- > tests/qemu-iotests/134 | 9 + > tests/qemu-iotests/134.out | 10 ++ > 2 files changed, 19 insertions(+)

Re: [Qemu-block] [PATCH v6 4/9] block: treat BDRV_REQ_ALLOCATE as serialising

2018-01-16 Thread Eric Blake
On 01/16/2018 07:04 AM, Anton Nefedov wrote: > The idea is that ALLOCATE requests may overlap with other requests. > Reuse the existing block layer infrastructure for serialising requests. > Use the following approach: > - mark ALLOCATE serialising, so subsequent requests to the area wait > -

Re: [Qemu-block] [Qemu-devel] [PATCH v2] file-posix: specify expected filetypes

2018-01-16 Thread Eric Blake
On 01/15/2018 04:50 PM, John Snow wrote: > I don't think there's a legitimate reason to open directories as if > they were files. This prevents QEMU from opening and attempting to probe > a directory inode, which can break in exciting ways. One of those ways > is lseek on ext4/xfs, which will

Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema

2018-01-16 Thread Eric Blake
On 01/16/2018 02:11 PM, Kevin Wolf wrote: >>> +{ 'enum': 'BlockdevQcow2CompatLevel', >>> + 'data': [ '0_10', '1_1' ] } >> >> Enums are allowed to start with digits while struct members are not; so >> you can get away with this naming. Do we really want the names 0_10 and >> 1_1, or are there

Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema

2018-01-16 Thread Kevin Wolf
Am 16.01.2018 um 19:59 hat Eric Blake geschrieben: > On 01/11/2018 01:52 PM, Kevin Wolf wrote: > > Signed-off-by: Kevin Wolf > > --- > > qapi/block-core.json | 33 - > > 1 file changed, 32 insertions(+), 1 deletion(-) > > > > diff --git

Re: [Qemu-block] [RFC PATCH 10/10] block: x-blockdev-create QMP command

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > This adds a synchronous x-blockdev-create QMP command that can create > qcow2 images on a given node name. > > We don't want to block while creating an image, so this is not the final > interface in all aspects, but BlockdevCreateOptionsQcow2 and >

Re: [Qemu-block] [RFC PATCH 09/10] qcow2: Use visitor for options in qcow2_create()

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 227 > ++--- > tests/qemu-iotests/049.out | 10 +- > 2 files changed, 93 insertions(+), 144 deletions(-) > > +/* Only the

Re: [Qemu-block] [RFC PATCH 01/10] block/qapi: Introduce BlockdevCreateOptions

2018-01-16 Thread Kevin Wolf
Am 16.01.2018 um 19:54 hat Eric Blake geschrieben: > On 01/11/2018 01:52 PM, Kevin Wolf wrote: > > This creates a BlockdevCreateOptions union type that will contain all of > > the options for image creation. We'll start out with an empty struct > > type BlockdevCreateDummy for all drivers. > > >

Re: [Qemu-block] [RFC PATCH 08/10] util: Add qemu_opts_to_qdict_filtered()

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > This allows, given a QemuOpts for a QemuOptsList that was merged from > multiple QemuOptsList, to only consider those options that exist in one > specific list. Block drivers need this to separate format-layer create > options from protocol-level

Re: [Qemu-block] [RFC PATCH 07/10] qcow2: Handle full/falloc preallocation in qcow2_create2()

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > Once qcow2_create2() can be called directly on an already existing node, > we must provide the 'full' and 'falloc' preallocation modes outside of > creating the image on the protocol layer. Fortunately, we have > preallocated truncate now which can

Re: [Qemu-block] [RFC PATCH 06/10] qcow2: Use QCryptoBlockCreateOptions in qcow2_create2()

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > Instead of passing the encryption format name and the QemuOpts down, use > the QCryptoBlockCreateOptions contained in BlockdevCreateOptions. > > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 62 >

Re: [Qemu-block] [RFC PATCH 05/10] qcow2: Use BlockdevRef in qcow2_create2()

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > Instead of passing a separate BlockDriverState* into qcow2_create2(), > make use of the BlockdevRef that is included in BlockdevCreateOptions. > > Signed-off-by: Kevin Wolf > --- > include/block/block.h | 1 + > block.c

Re: [Qemu-block] [RFC PATCH 04/10] qcow2: Pass BlockdevCreateOptions to qcow2_create2()

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > All of the simple options are now passed to qcow2_create2() in a > BlockdevCreateOptions object. Still missing: node-name and the > encryption options. > > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 186 >

Re: [Qemu-block] [RFC PATCH 03/10] qcow2: Let qcow2_create() handle protocol layer

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > Currently, qcow2_create() only parses the QemuOpts and then calls > qcow2_create2() for the actual image creation, which includes both the > creation of the actual file on the file system and writing a valid empty > qcow2 image into that file. > > The

Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > qapi/block-core.json | 33 - > 1 file changed, 32 insertions(+), 1 deletion(-) > > diff --git a/qapi/block-core.json b/qapi/block-core.json > index

Re: [Qemu-block] [RFC PATCH 01/10] block/qapi: Introduce BlockdevCreateOptions

2018-01-16 Thread Eric Blake
On 01/11/2018 01:52 PM, Kevin Wolf wrote: > This creates a BlockdevCreateOptions union type that will contain all of > the options for image creation. We'll start out with an empty struct > type BlockdevCreateDummy for all drivers. > > Signed-off-by: Kevin Wolf > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 31/32] qcow2: Allow configuring the L2 slice size

2018-01-16 Thread Anton Nefedov
On 15/12/2017 3:53 PM, Alberto Garcia wrote: diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 2fcecbd7a8..fe58d1ec70 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c [..] @@ -879,9 +896,13 @@ static int qcow2_update_options_prepare(BlockDriverState *bs, }

Re: [Qemu-block] [Qemu-devel] [PATCH v2 16/32] qcow2: Update l2_allocate() to support L2 slices

2018-01-16 Thread Anton Nefedov
On 15/12/2017 3:53 PM, Alberto Garcia wrote: This patch updates l2_allocate() to support the qcow2 cache returning L2 slices instead of full L2 tables. The old code simply gets an L2 table from the cache and initializes it with zeroes or with the contents of an existing table. With a cache

Re: [Qemu-block] [Qemu-devel] [PATCH v2 25/32] qcow2: Update expand_zero_clusters_in_l1() to support L2 slices

2018-01-16 Thread Anton Nefedov
On 15/12/2017 3:53 PM, Alberto Garcia wrote: diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 8f7a04ba7d..ab840a449f 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c [..] @@ -1907,124 +1911,133 @@ static int expand_zero_clusters_in_l1(BlockDriverState *bs,

Re: [Qemu-block] [PATCH v6 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-01-16 Thread Alberto Garcia
On Tue 16 Jan 2018 02:04:29 PM CET, Anton Nefedov wrote: > iotest 060: > write to the discarded cluster does not trigger COW anymore. > so, break on write_aio event instead, will work for the test > (but write won't fail anymore, so update reference output) I'm wondering about this. The reason

[Qemu-block] [PATCH v6 6/9] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2018-01-16 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- block/blkdebug.c | 3 ++- block/blkverify.c | 2 +- block/mirror.c | 2 +- block/raw-format.c | 3 ++- 4 files changed, 6

[Qemu-block] [PATCH v6 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-01-16 Thread Anton Nefedov
If COW areas of the newly allocated clusters are zeroes on the backing image, efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole cluster instead of writing explicit zero buffers later in perform_cow(). iotest 060: write to the discarded cluster does not trigger COW

[Qemu-block] [PATCH v6 1/9] mirror: inherit supported write/zero flags

2018-01-16 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia --- block/mirror.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index c9badc1..d18ec65 100644 ---

[Qemu-block] [PATCH v6 5/9] file-posix: support BDRV_REQ_ALLOCATE

2018-01-16 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- block/file-posix.c | 8 1 file changed, 8 insertions(+) diff --git a/block/file-posix.c

[Qemu-block] [PATCH v6 0/9] qcow2: cluster space preallocation

2018-01-16 Thread Anton Nefedov
(used to be 'qcow2: preallocation and COW improvements') v6: the series is split; now includes only ALLOCATE flag introduction and improvement of qcow2 COW with efficient write-zeroes. File space preallocation beyond EOF will be a separate series. Rebased; remarks to patch 8

[Qemu-block] [PATCH v6 9/9] iotest 134: test cluster-misaligned encrypted write

2018-01-16 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov --- tests/qemu-iotests/134 | 9 + tests/qemu-iotests/134.out | 10 ++ 2 files changed, 19 insertions(+) diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotests/134

[Qemu-block] [PATCH v6 2/9] blkverify: set supported write/zero flags

2018-01-16 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- block/blkverify.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block/blkverify.c b/block/blkverify.c index 06369f9..9ba65d0 100644 --- a/block/blkverify.c +++

[Qemu-block] [PATCH v6 7/9] qcow2: move is_zero() up

2018-01-16 Thread Anton Nefedov
To be used in the following commit without a forward declaration. Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- block/qcow2.c | 35 +-- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git

[Qemu-block] [PATCH v6 4/9] block: treat BDRV_REQ_ALLOCATE as serialising

2018-01-16 Thread Anton Nefedov
The idea is that ALLOCATE requests may overlap with other requests. Reuse the existing block layer infrastructure for serialising requests. Use the following approach: - mark ALLOCATE serialising, so subsequent requests to the area wait - ALLOCATE request itself must never wait if another

[Qemu-block] [PATCH v6 3/9] block: introduce BDRV_REQ_ALLOCATE flag

2018-01-16 Thread Anton Nefedov
The flag is supposed to indicate that the region of the disk image has to be sufficiently allocated so it reads as zeroes. The call with the flag set must return -ENOTSUP if allocation cannot be done efficiently. This has to be made sure of by both - the drivers that support the flag - and

[Qemu-block] [PATCH v2 5/6] qapi: add block-dirty-bitmap-merge

2018-01-16 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 38 ++ include/block/dirty-bitmap.h | 2 ++ block/dirty-bitmap.c | 18 ++ blockdev.c | 30

[Qemu-block] [PATCH v2 3/6] qapi: add block-dirty-bitmap-enable/disable

2018-01-16 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 42 ++ blockdev.c | 42 ++ 2 files changed, 84 insertions(+) diff --git a/qapi/block-core.json

[Qemu-block] [PATCH v2 2/6] block/dirty-bitmap: add lock to bdrv_enable/disable_dirty_bitmap

2018-01-16 Thread Vladimir Sementsov-Ogievskiy
Add locks and remove comments about BQL accordingly to dirty_bitmap_mutex definition in block_int.h. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/dirty-bitmap.c

[Qemu-block] [PATCH v2 4/6] qmp: transaction support for block-dirty-bitmap-enable/disable

2018-01-16 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/transaction.json | 4 +++ blockdev.c| 79 +++ 2 files changed, 83 insertions(+) diff --git a/qapi/transaction.json b/qapi/transaction.json index

[Qemu-block] [PATCH v2 6/6] qapi: add disabled parameter to block-dirty-bitmap-add

2018-01-16 Thread Vladimir Sementsov-Ogievskiy
This is needed, for example, to create a new bitmap and merge several disabled bitmaps into a new one. Without this flag we will have to put block-dirty-bitmap-add and block-dirty-bitmap-disable into one transaction. Signed-off-by: Vladimir Sementsov-Ogievskiy ---

[Qemu-block] [PATCH v2 0/6] qmp dirty bitmap API

2018-01-16 Thread Vladimir Sementsov-Ogievskiy
Hi all. There are three qmp commands, needed to implement external backup API. Using these three commands, client may do all needed bitmap management by hand: on backup start we need to do a transaction: {disable old bitmap, create new bitmap} on backup success: drop old bitmap on backup

[Qemu-block] [PATCH v2 1/6] block: maintain persistent disabled bitmaps

2018-01-16 Thread Vladimir Sementsov-Ogievskiy
To maintain load/store disabled bitmap there is new approach: - deprecate @autoload flag of block-dirty-bitmap-add, make it ignored - store enabled bitmaps as "auto" to qcow2 - store disabled bitmaps without "auto" flag to qcow2 - on qcow2 open load "auto" bitmaps as enabled and others as

[Qemu-block] [PATCH V6] pci: removed the is_express field since a uniform interface was inserted

2018-01-16 Thread Yoni Bettan
according to Eduardo Habkost's commit fd3b02c889 all PCIEs now implement INTERFACE_PCIE_DEVICE so we don't need is_express field anymore. Devices that implements only INTERFACE_PCIE_DEVICE (is_express == 1) or devices that implements only INTERFACE_CONVENTIONAL_PCI_DEVICE (is_express == 0) where

Re: [Qemu-block] [PATCH 1/4] lockable: add QemuLockable

2018-01-16 Thread Fam Zheng
On 01/16/2018 06:08 AM, Paolo Bonzini wrote: QemuLockable is a polymorphic lock type that takes an object and knows which function to use for locking and unlocking. The implementation could use C11 _Generic, but since the support is not very widespread I am instead using __builtin_choose_expr

Re: [Qemu-block] [PATCH 0/4] coroutine-lock: polymorphic CoQueue

2018-01-16 Thread Fam Zheng
On 01/16/2018 06:08 AM, Paolo Bonzini wrote: There are cases in which a queued coroutine must be restarted from non-coroutine context (with qemu_co_enter_next). In this cases, qemu_co_enter_next also needs to be thread-safe, but it cannot use a CoMutex and so cannot qemu_co_queue_wait. This

Re: [Qemu-block] [RFC PATCH 00/10] x-blockdev-create for qcow2

2018-01-16 Thread Kevin Wolf
Am 11.01.2018 um 20:52 hat Kevin Wolf geschrieben: > This series implements a minimal QMP command that allows to create an > image format on a given block node. The interface is still going to > change to some kind of an async command (possibly a block job), so I > prefixed x- for now. > > At

Re: [Qemu-block] [Qemu-devel] qcow2 autoloading bitmaps

2018-01-16 Thread Vladimir Sementsov-Ogievskiy
16.01.2018 00:26, John Snow wrote: On 01/11/2018 10:15 AM, Vladimir Sementsov-Ogievskiy wrote: 11.01.2018 17:43, Eric Blake wrote: On 01/11/2018 08:26 AM, Vladimir Sementsov-Ogievskiy wrote: # @autoload: the bitmap will be automatically loaded when the image it is stored #    in is