Re: [Qemu-block] [PATCH v3] specs/qcow2: Fix documentation of the compressed cluster descriptor

2018-02-22 Thread Alberto Garcia
On Wed 21 Feb 2018 11:10:07 PM CET, Eric Blake wrote: >> This patch fixes several mistakes in the documentation of the >> compressed cluster descriptor: > > More things to consider, as followup patches: > > Note that both the L1 table, and the standard L2 descriptors, have a cap > on bit 55 as

Re: [Qemu-block] [PATCH v2 2/3] qcow2: Don't allow overflow during cluster allocation

2018-02-22 Thread Alberto Garcia
On Thu 22 Feb 2018 12:39:52 AM CET, Eric Blake wrote: > free_in_cluster = s->cluster_size - offset_into_cluster(s, offset); > do { > if (!offset || free_in_cluster < size) { > -int64_t new_cluster = alloc_clusters_noref(bs, s->cluster_size); > +int64_t

[Qemu-block] block migration and MAX_IN_FLIGHT_IO

2018-02-22 Thread Peter Lieven
Hi, I stumbled across the MAX_INFLIGHT_IO field that was introduced in 2015 and was curious what was the reason to choose 512MB as readahead? The question is that I found that the source VM gets very unresponsive I/O wise while the initial 512MB are read and furthermore seems to stay

Re: [Qemu-block] [PATCH v2 3/3] qcow2: Avoid memory over-allocation on compressed images

2018-02-22 Thread Alberto Garcia
On Thu 22 Feb 2018 12:39:53 AM CET, Eric Blake wrote: > +assert(!!s->cluster_data == !!s->cluster_cache); > +assert(csize < 2 * s->cluster_size + 512); > if (!s->cluster_data) { > -/* one more sector for decompressed data alignment */ > -

Re: [Qemu-block] Limiting coroutine stack usage

2018-02-22 Thread Kevin Wolf
Am 20.02.2018 um 22:54 hat Paolo Bonzini geschrieben: > On 20/02/2018 18:04, Peter Lieven wrote: > > Hi, > > > > I remember we discussed a long time ago to limit the stack usage of all > > functions that are executed in a coroutine > > context to a very low value to be able to safely limit the

Re: [Qemu-block] Limiting coroutine stack usage

2018-02-22 Thread Peter Lieven
Am 22.02.2018 um 11:57 schrieb Kevin Wolf: > Am 20.02.2018 um 22:54 hat Paolo Bonzini geschrieben: >> On 20/02/2018 18:04, Peter Lieven wrote: >>> Hi, >>> >>> I remember we discussed a long time ago to limit the stack usage of all >>> functions that are executed in a coroutine >>> context to a

Re: [Qemu-block] [PATCH] docs: document how to use the l2-cache-entry-size parameter

2018-02-22 Thread Alberto Garcia
On Wed 21 Feb 2018 07:33:55 PM CET, Kevin Wolf wrote: [docs/qcow2-cache.txt] > While reviewing this, I read the whole document and stumbled across > these paragraphs: > >> The reason for this 1/4 ratio is to ensure that both caches cover the >> same amount of disk space. Note however that this

Re: [Qemu-block] [Qemu-devel] Qemu aborted in ide_restart_bh after migration

2018-02-22 Thread Wangjing (King, Euler)
This issue occurred at a very low probability, If we inject delays in address_space_write_continue like this, the issue occurred inevitably: ### diff --git a/exec.c b/exec.c index e8d7b33..b9779e0 100644 ---

Re: [Qemu-block] [PATCH v8 03/26] block: Add BDS.backing_overridden

2018-02-22 Thread Kevin Wolf
Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: > If the backing file is overridden, this most probably does change the > guest-visible data of a BDS. Therefore, we will need to consider this in > bdrv_refresh_filename(). > > Adding a new field to the BDS is not nice, but it is very simple and

Re: [Qemu-block] [PATCH v3] qcow2: Replace align_offset() with ROUND_UP()

2018-02-22 Thread Alberto Garcia
ping On Thu 15 Feb 2018 02:10:08 PM CET, Alberto Garcia wrote: > The align_offset() function is equivalent to the ROUND_UP() macro so > there's no need to use the former. The ROUND_UP() name is also a bit > more explicit. > > This patch uses ROUND_UP() instead of the slower QEMU_ALIGN_UP() >

Re: [Qemu-block] [PATCH 2/2] qcow2: Avoid memory over-allocation on compressed images

2018-02-22 Thread Alberto Garcia
On Wed 21 Feb 2018 05:59:58 PM CET, Eric Blake wrote: > But as Berto has convinced me that an externally produced image can > convince us to read up to 4M (even though we don't need that much to > decompress), A (harmless but funny) consequence of the way this works is that for any valid

Re: [Qemu-block] Limiting coroutine stack usage

2018-02-22 Thread Kevin Wolf
Am 22.02.2018 um 12:01 hat Peter Lieven geschrieben: > Am 22.02.2018 um 11:57 schrieb Kevin Wolf: > > Am 20.02.2018 um 22:54 hat Paolo Bonzini geschrieben: > >> On 20/02/2018 18:04, Peter Lieven wrote: > >>> Hi, > >>> > >>> I remember we discussed a long time ago to limit the stack usage of all >

Re: [Qemu-block] [Qemu-devel] Limiting coroutine stack usage

2018-02-22 Thread Peter Lieven
Am 22.02.2018 um 13:03 schrieb Daniel P. Berrangé: > On Thu, Feb 22, 2018 at 01:02:05PM +0100, Peter Lieven wrote: >> Am 22.02.2018 um 13:00 schrieb Daniel P. Berrangé: >>> On Thu, Feb 22, 2018 at 12:51:58PM +0100, Peter Lieven wrote: Am 22.02.2018 um 12:40 schrieb Daniel P. Berrangé: >

Re: [Qemu-block] [Qemu-devel] Limiting coroutine stack usage

2018-02-22 Thread Kevin Wolf
Am 22.02.2018 um 13:06 hat Peter Lieven geschrieben: > Am 22.02.2018 um 13:03 schrieb Daniel P. Berrangé: > > On Thu, Feb 22, 2018 at 01:02:05PM +0100, Peter Lieven wrote: > >> Am 22.02.2018 um 13:00 schrieb Daniel P. Berrangé: > >>> On Thu, Feb 22, 2018 at 12:51:58PM +0100, Peter Lieven wrote: >

Re: [Qemu-block] Limiting coroutine stack usage

2018-02-22 Thread Peter Lieven
Am 22.02.2018 um 12:32 schrieb Kevin Wolf: > Am 22.02.2018 um 12:01 hat Peter Lieven geschrieben: >> Am 22.02.2018 um 11:57 schrieb Kevin Wolf: >>> Am 20.02.2018 um 22:54 hat Paolo Bonzini geschrieben: On 20/02/2018 18:04, Peter Lieven wrote: > Hi, > > I remember we discussed a

Re: [Qemu-block] [Qemu-devel] Limiting coroutine stack usage

2018-02-22 Thread Peter Lieven
Am 22.02.2018 um 12:40 schrieb Daniel P. Berrangé: > On Thu, Feb 22, 2018 at 12:32:04PM +0100, Kevin Wolf wrote: >> Am 22.02.2018 um 12:01 hat Peter Lieven geschrieben: >>> Am 22.02.2018 um 11:57 schrieb Kevin Wolf: Am 20.02.2018 um 22:54 hat Paolo Bonzini geschrieben: > On 20/02/2018

Re: [Qemu-block] [Qemu-devel] Limiting coroutine stack usage

2018-02-22 Thread Daniel P . Berrangé
On Thu, Feb 22, 2018 at 01:02:05PM +0100, Peter Lieven wrote: > Am 22.02.2018 um 13:00 schrieb Daniel P. Berrangé: > > On Thu, Feb 22, 2018 at 12:51:58PM +0100, Peter Lieven wrote: > >> Am 22.02.2018 um 12:40 schrieb Daniel P. Berrangé: > >>> On Thu, Feb 22, 2018 at 12:32:04PM +0100, Kevin Wolf

Re: [Qemu-block] [Qemu-devel] Limiting coroutine stack usage

2018-02-22 Thread Daniel P . Berrangé
On Thu, Feb 22, 2018 at 01:06:33PM +0100, Peter Lieven wrote: > Am 22.02.2018 um 13:03 schrieb Daniel P. Berrangé: > > On Thu, Feb 22, 2018 at 01:02:05PM +0100, Peter Lieven wrote: > >> Am 22.02.2018 um 13:00 schrieb Daniel P. Berrangé: > >>> On Thu, Feb 22, 2018 at 12:51:58PM +0100, Peter Lieven

Re: [Qemu-block] [PATCH v8 01/26] block/mirror: Small absolute-paths simplification

2018-02-22 Thread Kevin Wolf
Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: > When invoking drive-mirror in absolute-paths mode, the target's backing > BDS is assigned to it in mirror_exit(). The current logic only does so > if the target does not have that backing BDS already; but it actually > cannot have a backing BDS

Re: [Qemu-block] [Qemu-devel] Limiting coroutine stack usage

2018-02-22 Thread Daniel P . Berrangé
On Thu, Feb 22, 2018 at 12:32:04PM +0100, Kevin Wolf wrote: > Am 22.02.2018 um 12:01 hat Peter Lieven geschrieben: > > Am 22.02.2018 um 11:57 schrieb Kevin Wolf: > > > Am 20.02.2018 um 22:54 hat Paolo Bonzini geschrieben: > > >> On 20/02/2018 18:04, Peter Lieven wrote: > > >>> Hi, > > >>> > > >>>

Re: [Qemu-block] [Qemu-devel] Limiting coroutine stack usage

2018-02-22 Thread Peter Lieven
Am 22.02.2018 um 13:00 schrieb Daniel P. Berrangé: > On Thu, Feb 22, 2018 at 12:51:58PM +0100, Peter Lieven wrote: >> Am 22.02.2018 um 12:40 schrieb Daniel P. Berrangé: >>> On Thu, Feb 22, 2018 at 12:32:04PM +0100, Kevin Wolf wrote: Am 22.02.2018 um 12:01 hat Peter Lieven geschrieben: >

Re: [Qemu-block] [Qemu-devel] Limiting coroutine stack usage

2018-02-22 Thread Daniel P . Berrangé
On Thu, Feb 22, 2018 at 12:51:58PM +0100, Peter Lieven wrote: > Am 22.02.2018 um 12:40 schrieb Daniel P. Berrangé: > > On Thu, Feb 22, 2018 at 12:32:04PM +0100, Kevin Wolf wrote: > >> Am 22.02.2018 um 12:01 hat Peter Lieven geschrieben: > >>> Am 22.02.2018 um 11:57 schrieb Kevin Wolf: > Am

Re: [Qemu-block] [PATCH v8 02/26] block: Use children list in bdrv_refresh_filename

2018-02-22 Thread Kevin Wolf
Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: > bdrv_refresh_filename() should invoke itself recursively on all > children, not just on file. > > With that change, we can remove the manual invocations in blkverify, > quorum, commit, and mirror. > > Signed-off-by: Max Reitz

[Qemu-block] [PATCH] iotests: Test abnormally large size in compressed cluster descriptor

2018-02-22 Thread Alberto Garcia
L2 entries for compressed clusters have a field that indicates the number of sectors used to store the data in the image. That's however not the size of the compressed data itself, just the number of sectors where that data is located. The actual data size is usually not a multiple of the sector

[Qemu-block] [PATCH v3 0/4] qcow2: minor compression improvements

2018-02-22 Thread Eric Blake
Since v2: - new patch 2, spec changes based on list followup - tweak patch 3 to use MIN() and stop open-coding a calculation [Berto] - tweak patch 4 to stop overallocating by a sector [Berto] Eric Blake (4): qcow2: Prefer byte-based calls into bs->file qcow2: Document some maximum size

[Qemu-block] [PATCH v3 1/4] qcow2: Prefer byte-based calls into bs->file

2018-02-22 Thread Eric Blake
We had only three sector-based stragglers left; convert them to use our preferred byte-based accesses. Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia --- v2: indentation fix --- block/qcow2-cluster.c | 5 ++--- block/qcow2-refcount.c | 6 +++--- 2

Re: [Qemu-block] [PATCH v8 03/26] block: Add BDS.backing_overridden

2018-02-22 Thread Max Reitz
On 2018-02-22 17:21, Kevin Wolf wrote: > Am 22.02.2018 um 16:17 hat Max Reitz geschrieben: >> On 2018-02-22 16:12, Kevin Wolf wrote: >>> Am 22.02.2018 um 15:55 hat Max Reitz geschrieben: On 2018-02-22 14:39, Kevin Wolf wrote: > Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: >> If

[Qemu-block] [PATCH v3 3/4] qcow2: Don't allow overflow during cluster allocation

2018-02-22 Thread Eric Blake
Our code was already checking that we did not attempt to allocate more clusters than what would fit in an INT64 (the physical maximimum if we can access a full off_t's worth of data). But this does not catch smaller limits enforced by various spots in the qcow2 image description: L1 and normal

Re: [Qemu-block] [PATCH] docs: document how to use the l2-cache-entry-size parameter

2018-02-22 Thread Alberto Garcia
On Thu 22 Feb 2018 03:17:57 PM CET, Kevin Wolf wrote: >> > While we're at it, would l2-cache-entry-size = MIN(cluster_size, >> > 64k) make sense as a default? >> >> Any reason why you choose 64k, or is it because it's the default >> cluster size? >> >> In general I'd be cautious to reduce the

Re: [Qemu-block] Limiting coroutine stack usage

2018-02-22 Thread John Snow
On 02/22/2018 05:57 AM, Kevin Wolf wrote: > Am 20.02.2018 um 22:54 hat Paolo Bonzini geschrieben: >> On 20/02/2018 18:04, Peter Lieven wrote: >>> Hi, >>> >>> I remember we discussed a long time ago to limit the stack usage of all >>> functions that are executed in a coroutine >>> context to a

[Qemu-block] [PATCH v3 4/4] qcow2: Avoid memory over-allocation on compressed images

2018-02-22 Thread Eric Blake
When reading a compressed image, we were allocating s->cluster_data to 32*cluster_size + 512 (possibly over 64 megabytes, for an image with 2M clusters). Let's check out the history: Back when qcow2 was first written, we used s->cluster_data for everything, including copy_sectors() and

[Qemu-block] [PATCH v3 2/4] qcow2: Document some maximum size constraints

2018-02-22 Thread Eric Blake
Although off_t permits up to 63 bits (8EB) of file offsets, in practice, we're going to hit other limits first. Document some of those limits in the qcow2 spec, and how choice of cluster size can influence some of the limits. While at it, notice that since we cannot map any virtual cluster to

Re: [Qemu-block] [PATCH v8 03/26] block: Add BDS.backing_overridden

2018-02-22 Thread Kevin Wolf
Am 22.02.2018 um 16:17 hat Max Reitz geschrieben: > On 2018-02-22 16:12, Kevin Wolf wrote: > > Am 22.02.2018 um 15:55 hat Max Reitz geschrieben: > >> On 2018-02-22 14:39, Kevin Wolf wrote: > >>> Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: > If the backing file is overridden, this most

Re: [Qemu-block] [PATCH v8 18/26] block: Add sgfnt_runtime_opts to BlockDriver

2018-02-22 Thread Alberto Garcia
On Thu 22 Feb 2018 04:19:45 PM CET, Max Reitz wrote: > On 2018-02-06 16:23, Alberto Garcia wrote: >> On Mon 05 Feb 2018 04:18:27 PM CET, Max Reitz wrote: >>> --- a/block/blkdebug.c >>> +++ b/block/blkdebug.c >>> @@ -886,6 +886,21 @@ static int blkdebug_reopen_prepare(BDRVReopenState >>>

Re: [Qemu-block] [PATCH v3 4/4] qcow2: Avoid memory over-allocation on compressed images

2018-02-22 Thread Alberto Garcia
On Thu 22 Feb 2018 04:59:22 PM CET, Eric Blake wrote: > sector_offset = coffset & 511; > csize = nb_csectors * 512 - sector_offset; [...] > +assert(csize < 2 * s->cluster_size); I think it should be <= If sector_offset is 0 and nb_csector is the maximum

Re: [Qemu-block] [PATCH v3 4/4] qcow2: Avoid memory over-allocation on compressed images

2018-02-22 Thread Eric Blake
On 02/22/2018 10:23 AM, Alberto Garcia wrote: On Thu 22 Feb 2018 04:59:22 PM CET, Eric Blake wrote: sector_offset = coffset & 511; csize = nb_csectors * 512 - sector_offset; [...] +assert(csize < 2 * s->cluster_size); I think it should be <= If

Re: [Qemu-block] [PATCH] iotests: Test abnormally large size in compressed cluster descriptor

2018-02-22 Thread Eric Blake
On 02/22/2018 10:18 AM, Alberto Garcia wrote: L2 entries for compressed clusters have a field that indicates the number of sectors used to store the data in the image. That's however not the size of the compressed data itself, just the number of sectors where that data is located. The actual

Re: [Qemu-block] [Qemu-devel] [PATCH 0/9] nbd block status base:allocation

2018-02-22 Thread no-reply
Hi, This series failed build test on ppcbe host. Please find the details below. Type: series Message-id: 1518702707-7077-1-git-send-email-vsement...@virtuozzo.com Subject: [Qemu-devel] [PATCH 0/9] nbd block status base:allocation === TEST SCRIPT BEGIN === #!/bin/bash # Testing script will be

Re: [Qemu-block] [PATCH v2 10/36] test-qemu-opts: Test qemu_opts_to_qdict_filtered()

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > tests/test-qemu-opts.c | 125 > + > 1 file changed, 125 insertions(+) Reviewed-by: Max Reitz signature.asc Description: OpenPGP

Re: [Qemu-block] [PATCH v2 18/36] rbd: Fix use after free in qemu_rbd_set_keypairs() error path

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > If we want to include the invalid option name in the error message, we > can't free the string earlier than that. > > Signed-off-by: Kevin Wolf > --- > block/rbd.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by:

Re: [Qemu-block] [PATCH v2 19/36] rbd: Factor out qemu_rbd_connect()

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > The code to establish an RBD connection is duplicated between open and > create. In order to be able to share the code, factor out the code from > qemu_rbd_open() as a first step. > > Signed-off-by: Kevin Wolf > --- > block/rbd.c | 100

Re: [Qemu-block] [PATCH v2 20/36] rbd: Remove non-schema options from runtime_opts

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > Instead of the QemuOpts in qemu_rbd_connect(), we want to use QAPI > objects. As a preparation, fetch those options directly from the QDict > that .bdrv_open() supports in the rbd driver and that are not in the > schema. > > Signed-off-by: Kevin Wolf

Re: [Qemu-block] [PATCH v2 11/36] qdict: Introduce qdict_rename_keys()

2018-02-22 Thread Eric Blake
On 02/21/2018 07:53 AM, Kevin Wolf wrote: A few block drivers will need to rename .bdrv_create options for their QAPIfication, so let's have a helper function for that. Signed-off-by: Kevin Wolf --- include/qapi/qmp/qdict.h | 6 +++ qobject/qdict.c | 34

Re: [Qemu-block] [PATCH v2 24/36] rbd: Use qemu_rbd_connect() in qemu_rbd_do_create()

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > This is almost exactly the same code. The differences are that > qemu_rbd_connect() supports BlockdevOptionsRbd.server and that the cache > mode is set explicitly. > > Supporting 'server' is a welcome new feature for image creation. > Caching is disabled

Re: [Qemu-block] [PATCH v2 11/36] qdict: Introduce qdict_rename_keys()

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > A few block drivers will need to rename .bdrv_create options for their > QAPIfication, so let's have a helper function for that. > > Signed-off-by: Kevin Wolf > --- > include/qapi/qmp/qdict.h | 6 +++ > qobject/qdict.c | 34

Re: [Qemu-block] [PATCH v2 17/36] gluster: Support .bdrv_co_create

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > This adds the .bdrv_co_create driver callback to gluster, which enables > image creation over QMP. > > Signed-off-by: Kevin Wolf > --- > qapi/block-core.json | 18 ++- > block/gluster.c | 135 >

Re: [Qemu-block] [PATCH v2 23/36] rbd: ***ing s->snap/image_name in qemu_rbd_open()

2018-02-22 Thread Max Reitz
I suppose the first word after the colon in your subject is supposed to be "assign" and not what it currently is (which is something I am not going to repeat!). :-) On 2018-02-21 14:53, Kevin Wolf wrote: > Now that the options are already available in qemu_rbd_open() and not > only parsed in

Re: [Qemu-block] [PATCH v2 34/36] block: Fail bdrv_truncate() with negative size

2018-02-22 Thread Eric Blake
On 02/21/2018 07:54 AM, Kevin Wolf wrote: Most callers have their own checks, but something like this should also be checked centrally. As it happens, x-blockdev-create can pass negative image sizes to format drivers (because there is no QAPI type that would reject negative numbers) and triggers

Re: [Qemu-block] [PATCH v2 27/36] sheepdog: QAPIfy "redundacy" create option

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > The "redundacy" option for Sheepdog image creation is currently a string > that can encode one or two integers depending on its format, which at > the same time implicitly selects a mode. > > This patch turns it into a QAPI union and converts the string

Re: [Qemu-block] [PATCH v2 13/36] block: Make bdrv_is_whitelisted() public

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > We'll use a separate source file for image creation, and we need to > check there whether the requested driver is whitelisted. > > Signed-off-by: Kevin Wolf > --- > include/block/block.h | 1 + > block.c | 2 +- > 2 files

Re: [Qemu-block] [PATCH v2 15/36] file-posix: Support .bdrv_co_create

2018-02-22 Thread Eric Blake
On 02/21/2018 07:53 AM, Kevin Wolf wrote: This adds the .bdrv_co_create driver callback to file, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qapi/block-core.json | 20 +- block/file-posix.c |

Re: [Qemu-block] [PATCH v2 28/36] sheepdog: Support .bdrv_co_create

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > This adds the .bdrv_co_create driver callback to sheepdog, which enables > image creation over QMP. > > Signed-off-by: Kevin Wolf > --- > qapi/block-core.json | 24 +- > block/sheepdog.c | 240 >

Re: [Qemu-block] [PATCH v2 08/36] util: Add qemu_opts_to_qdict_filtered()

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, 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 options. >

Re: [Qemu-block] [PATCH v2 14/36] block: x-blockdev-create QMP command

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, 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] [PATCH v2 20/36] rbd: Remove non-schema options from runtime_opts

2018-02-22 Thread Max Reitz
On 2018-02-23 00:13, Max Reitz wrote: > On 2018-02-21 14:53, Kevin Wolf wrote: >> Instead of the QemuOpts in qemu_rbd_connect(), we want to use QAPI >> objects. As a preparation, fetch those options directly from the QDict >> that .bdrv_open() supports in the rbd driver and that are not in the >>

Re: [Qemu-block] [PATCH v2 21/36] rbd: Pass BlockdevOptionsRbd to qemu_rbd_connect()

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > With the conversion to a QAPI options object, the function is now > prepared to be used in a .bdrv_co_create implementation. > > Signed-off-by: Kevin Wolf > --- > block/rbd.c | 102 >

Re: [Qemu-block] [PATCH v2 22/36] rbd: Support .bdrv_co_create

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > This adds the .bdrv_co_create driver callback to rbd, which enables > image creation over QMP. > > Signed-off-by: Kevin Wolf > --- > qapi/block-core.json | 19 ++- > block/rbd.c | 146 >

Re: [Qemu-block] [PATCH v2 09/36] test-qemu-opts: Test qemu_opts_append()

2018-02-22 Thread Max Reitz
On 2018-02-21 14:53, Kevin Wolf wrote: > Basic test for merging two QemuOptsLists. > > Signed-off-by: Kevin Wolf > --- > tests/test-qemu-opts.c | 128 > + > 1 file changed, 128 insertions(+) Reviewed-by: Max Reitz

Re: [Qemu-block] [PATCH v8 03/26] block: Add BDS.backing_overridden

2018-02-22 Thread Max Reitz
On 2018-02-22 14:39, Kevin Wolf wrote: > Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: >> If the backing file is overridden, this most probably does change the >> guest-visible data of a BDS. Therefore, we will need to consider this in >> bdrv_refresh_filename(). >> >> Adding a new field to

Re: [Qemu-block] [PATCH v8 06/26] block: Make path_combine() return the path

2018-02-22 Thread Kevin Wolf
Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: > Besides being safe for arbitrary path lengths, after some follow-up > patches all callers will want a freshly allocated buffer anyway. > > In the meantime, path_combine_deprecated() is added which has the same > interface as path_combine() had

Re: [Qemu-block] [PATCH v8 04/26] iotests: Drop explicit base blockdev in 191

2018-02-22 Thread Max Reitz
On 2018-02-22 15:34, Kevin Wolf wrote: > Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: >> Overriding the backing image should result in a json:{} pseudo-filename. >> Then, you can no longer use the commit block job with filename >> parameters. Therefore, do not explicitly add the base and

Re: [Qemu-block] [PATCH v8 03/26] block: Add BDS.backing_overridden

2018-02-22 Thread Kevin Wolf
Am 22.02.2018 um 15:55 hat Max Reitz geschrieben: > On 2018-02-22 14:39, Kevin Wolf wrote: > > Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: > >> If the backing file is overridden, this most probably does change the > >> guest-visible data of a BDS. Therefore, we will need to consider this in

Re: [Qemu-block] [PATCH v8 03/26] block: Add BDS.backing_overridden

2018-02-22 Thread Max Reitz
On 2018-02-22 16:12, Kevin Wolf wrote: > Am 22.02.2018 um 15:55 hat Max Reitz geschrieben: >> On 2018-02-22 14:39, Kevin Wolf wrote: >>> Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: If the backing file is overridden, this most probably does change the guest-visible data of a BDS.

Re: [Qemu-block] [PATCH v8 18/26] block: Add sgfnt_runtime_opts to BlockDriver

2018-02-22 Thread Max Reitz
On 2018-02-06 16:23, Alberto Garcia wrote: > On Mon 05 Feb 2018 04:18:27 PM CET, Max Reitz wrote: >> --- a/block/blkdebug.c >> +++ b/block/blkdebug.c >> @@ -886,6 +886,21 @@ static int blkdebug_reopen_prepare(BDRVReopenState >> *reopen_state, >> return 0; >> } >> >> +static const char

Re: [Qemu-block] [PATCH] docs: document how to use the l2-cache-entry-size parameter

2018-02-22 Thread Kevin Wolf
Am 22.02.2018 um 14:06 hat Alberto Garcia geschrieben: > On Wed 21 Feb 2018 07:33:55 PM CET, Kevin Wolf wrote: > > [docs/qcow2-cache.txt] > > While reviewing this, I read the whole document and stumbled across > > these paragraphs: > > > >> The reason for this 1/4 ratio is to ensure that both

Re: [Qemu-block] [PATCH v8 01/26] block/mirror: Small absolute-paths simplification

2018-02-22 Thread Max Reitz
On 2018-02-22 13:27, Kevin Wolf wrote: > Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: >> When invoking drive-mirror in absolute-paths mode, the target's backing >> BDS is assigned to it in mirror_exit(). The current logic only does so >> if the target does not have that backing BDS already;

Re: [Qemu-block] [PATCH v2 2/3] qcow2: Don't allow overflow during cluster allocation

2018-02-22 Thread Eric Blake
On 02/22/2018 04:29 AM, Alberto Garcia wrote: On Thu 22 Feb 2018 12:39:52 AM CET, Eric Blake wrote: free_in_cluster = s->cluster_size - offset_into_cluster(s, offset); do { if (!offset || free_in_cluster < size) { -int64_t new_cluster = alloc_clusters_noref(bs,

Re: [Qemu-block] [PATCH v2 3/3] qcow2: Avoid memory over-allocation on compressed images

2018-02-22 Thread Eric Blake
On 02/22/2018 04:50 AM, Alberto Garcia wrote: On Thu 22 Feb 2018 12:39:53 AM CET, Eric Blake wrote: +assert(!!s->cluster_data == !!s->cluster_cache); +assert(csize < 2 * s->cluster_size + 512); if (!s->cluster_data) { -/* one more sector for decompressed

Re: [Qemu-block] [PATCH v8 04/26] iotests: Drop explicit base blockdev in 191

2018-02-22 Thread Kevin Wolf
Am 05.02.2018 um 16:18 hat Max Reitz geschrieben: > Overriding the backing image should result in a json:{} pseudo-filename. > Then, you can no longer use the commit block job with filename > parameters. Therefore, do not explicitly add the base and override the > middle image in iotest 191,