[PATCH v5 14/16] python/qemu: make 'args' style arguments immutable

2020-07-09 Thread John Snow
These arguments don't need to be mutable and aren't really used as such. Clarify their types as immutable and adjust code to match where necessary. In general, It's probably best not to accept a user-defined mutable object and store it as internal object state unless there's a strong justification

[PATCH v5 15/16] iotests.py: Adjust HMP kwargs typing

2020-07-09 Thread John Snow
mypy wants to ensure there's consistency between the kwargs arguments types and any unspecified keyword arguments. In this case, conv_keys is a bool, but the remaining keys are Any type. Mypy (correctly) infers the **kwargs type to be **Dict[str, str], which is not compatible with conv_keys: bool.

[PATCH v5 16/16] python/qemu: Add mypy type annotations

2020-07-09 Thread John Snow
These should all be purely annotations with no changes in behavior at all. You need to be in the python folder, but you should be able to confirm that these annotations are correct (or at least self-consistent) by running `mypy --strict qemu`. Signed-off-by: John Snow --- python/qemu/accel.py

[PATCH v5 12/16] python/machine.py: Add _qmp access shim

2020-07-09 Thread John Snow
Like many other Optional[] types, it's not always a given that this object will be set. Wrap it in a type-shim that raises a meaningful error and will always return a concrete type. Signed-off-by: John Snow --- python/qemu/machine.py | 24 +--- 1 file changed, 13 insertions(+

[PATCH v5 09/16] python/machine.py: Don't modify state in _base_args()

2020-07-09 Thread John Snow
Don't append to the _remove_files list during _base_args; instead do so during _launch. Rework _base_args as a @property to help facilitate this impression. This has the additional benefit of making the type of _console_address easier to analyze statically. Signed-off-by: John Snow Reviewed-by:

[PATCH v5 08/16] python/machine.py: reorder __init__

2020-07-09 Thread John Snow
Put the init arg handling all at the top, and mostly in order (deviating when one is dependent on another), and put what is effectively runtime state declaration at the bottom. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kevin Wolf --- python/qemu/machine.py | 29

[PATCH v5 11/16] python/machine.py: use qmp.command

2020-07-09 Thread John Snow
machine.py and qmp.py both do the same thing here; refactor machine.py to use qmp.py's functionality more directly. Signed-off-by: John Snow Reviewed-by: Kevin Wolf --- python/qemu/machine.py | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/python

[PATCH v5 10/16] python/machine.py: Handle None events in events_wait

2020-07-09 Thread John Snow
If the timeout is 0, we can get None back. Handle this explicitly. Signed-off-by: John Snow Reviewed-by: Kevin Wolf --- python/qemu/machine.py | 27 --- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 3

[PATCH v5 13/16] python/machine.py: fix _popen access

2020-07-09 Thread John Snow
As always, Optional[T] causes problems with unchecked access. Add a helper that asserts the pipe is present before we attempt to talk with it. Signed-off-by: John Snow --- python/qemu/machine.py | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/python/qemu/mac

[PATCH v5 07/16] python/machine.py: Fix monitor address typing

2020-07-09 Thread John Snow
Prior to this, it's difficult for mypy to intuit what the concrete type of the monitor address is; it has difficulty inferring the type across two variables. Create _monitor_address as a property that always returns a valid address to simplify static type analysis. To preserve our ability to clea

[PATCH v5 04/16] python/qmp.py: Do not return None from cmd_obj

2020-07-09 Thread John Snow
This makes typing the qmp library difficult, as it necessitates wrapping Optional[] around the type for every return type up the stack. At some point, it becomes difficult to discern or remember why it's None instead of the expected object. Use the python exception system to tell us exactly why we

[PATCH v5 05/16] python/qmp.py: add casts to JSON deserialization

2020-07-09 Thread John Snow
mypy and python type hints are not powerful enough to properly describe JSON messages in Python 3.6. The best we can do, generally, is describe them as Dict[str, Any]. Add casts to coerce this type for static analysis; but do NOT enforce this type at runtime in any way. Note: Python 3.8 adds a Ty

[PATCH v5 02/16] iotests.py: use qemu.qmp type aliases

2020-07-09 Thread John Snow
iotests.py should use the type definitions from qmp.py instead of its own. Signed-off-by: John Snow Reviewed-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.p

[PATCH v5 01/16] python/qmp.py: Define common types

2020-07-09 Thread John Snow
Define some common types that we'll need to annotate a lot of other functions going forward. Signed-off-by: John Snow Reviewed-by: Kevin Wolf --- python/qemu/qmp.py | 18 ++ 1 file changed, 18 insertions(+) diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py index e64b6b5faa..

[PATCH v5 00/16] python: add mypy support to python/qemu

2020-07-09 Thread John Snow
Based-on: 20200710050649.32434-1-js...@redhat.com This series modifies the python/qemu library to comply with mypy --strict, pylint, and flake8. This requires my "refactor shutdown" patch as a pre-requisite. v5: (Things unchanged omitted) 003/16:[] [-C] 'python/qmp.py: re-absorb MonitorRespo

[PATCH v5 03/16] python/qmp.py: re-absorb MonitorResponseError

2020-07-09 Thread John Snow
When I initially split this out, I considered this more of a machine error than a QMP protocol error, but I think that's misguided. Move this back to qmp.py and name it QMPResponseError. Convert qmp.command() to use this exception type. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daud

[PATCH v5 06/16] python/qmp.py: add QMPProtocolError

2020-07-09 Thread John Snow
In the case that we receive a reply but are unable to understand it, use this exception name to indicate that case. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kevin Wolf --- python/qemu/qmp.py | 10 ++ 1 file changed, 10 insertions(+) diff --git a/python

[PATCH 12/13] gluster: add GUri-based URI parsing

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/gluster.c | 81 + 1 file changed, 61 insertions(+), 20 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index c06eca1c12f..2cad76deabf 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -288,

[PATCH 11/13] nfs: add GUri-based URI parsing

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/nfs.c | 96 - 1 file changed, 65 insertions(+), 31 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index 93d719551d2..0b24044535d 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -77,6 +77,31 @@ typed

[PATCH 10/13] sheepdog: add GUri-based URI parsing

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/sheepdog.c | 99 ++-- 1 file changed, 71 insertions(+), 28 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 3403adfc2cd..3f3f5b7dba9 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -

[PATCH 13/13] ssh: add GUri-based URI parsing

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/ssh.c | 75 + 1 file changed, 58 insertions(+), 17 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index c8f6ad79e3c..d2bc6277613 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -180,9 +180,37 @@ sta

[PATCH 07/13] block/gluster: auto-ify URI parsing variables

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/gluster.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index 31233cac696..c06eca1c12f 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -349,10 +349,10 @@ static in

[PATCH 05/13] block/ssh: auto-ify URI parsing variables

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/ssh.c | 23 +++ 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index 098dbe03c15..c8f6ad79e3c 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -180,9 +180,9 @@ static void sftp_error_trace(BDRVSS

[PATCH 04/13] block/sheepdog: auto-ify URI parsing variables

2020-07-09 Thread Marc-André Lureau
Since we are going to introduce URI parsing alternative, I changed the way SheepdogConfig takes care of host/path & URI/QueryParams lifetimes. Signed-off-by: Marc-André Lureau --- block/sheepdog.c | 72 1 file changed, 30 insertions(+), 42 deletio

[PATCH 03/13] block/vxhs: auto-ify URI parsing variables

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/vxhs.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/block/vxhs.c b/block/vxhs.c index d79fc97df66..5d61cfb7548 100644 --- a/block/vxhs.c +++ b/block/vxhs.c @@ -174,14 +174,12 @@ static QemuOptsList runtime_tcp_opts = {

[PATCH 08/13] build-sys: add HAVE_GLIB_GURI

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- configure | 7 +++ 1 file changed, 7 insertions(+) diff --git a/configure b/configure index ee6c3c6792a..cd2fc120aed 100755 --- a/configure +++ b/configure @@ -3924,6 +3924,10 @@ if $pkg_config --atleast-version=$glib_req_ver gio-unix-2.0; then gio_

[PATCH 09/13] nbd: add GUri-based URI parsing version

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/nbd.c| 86 +++--- util/Makefile.objs | 2 +- 2 files changed, 66 insertions(+), 22 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index faadcab442b..fdc4a53a98f 100644 --- a/block/nbd.c +++ b/block/n

[PATCH 06/13] block/nfs: auto-ify URI parsing variables

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/nfs.c | 32 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index b1718d125a4..93d719551d2 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -77,34 +77,34 @@ typedef struct NFSRPC {

[PATCH 01/13] uri: add g_auto macros for URI & QueryParams

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- include/qemu/uri.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/qemu/uri.h b/include/qemu/uri.h index d201c61260d..b246a59449b 100644 --- a/include/qemu/uri.h +++ b/include/qemu/uri.h @@ -105,6 +105,9 @@ struct QueryParams *query_params_new (

[PATCH 00/13] RFC: use upcoming GUri for URI handling

2020-07-09 Thread Marc-André Lureau
Hi, After years trying to add a glib API to handle URI, GLib 2.65.1 will finally have one. As an exercice, I checked if the API fits qemu needs, and it seems to be fine. It should be about as verbose as the current libxml based URI parser, but the main benefit is that we will get rid of fairly com

[PATCH 02/13] block/nbd: auto-ify URI parsing variables

2020-07-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/nbd.c | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index eed160c5cda..faadcab442b 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1516,10 +1516,9 @@ static int nbd_client_connec

Re: [PULL 00/12] Block patches

2020-07-09 Thread Eduardo Habkost
On Thu, Jul 09, 2020 at 05:02:06PM +0200, Kevin Wolf wrote: > Am 08.07.2020 um 00:05 hat Eduardo Habkost geschrieben: > > On Tue, Jul 07, 2020 at 05:28:21PM +0200, Philippe Mathieu-Daudé wrote: > > > On 6/26/20 12:25 PM, Stefan Hajnoczi wrote: > > > > On Thu, Jun 25, 2020 at 02:31:14PM +0100, Pete

Re: [PATCH v5 5/5] vhost-user-blk: default num_queues to -smp N

2020-07-09 Thread Raphael Norwitz
On Mon, Jul 6, 2020 at 7:00 AM Stefan Hajnoczi wrote: > > Automatically size the number of request virtqueues to match the number > of vCPUs. This ensures that completion interrupts are handled on the > same vCPU that submitted the request. No IPI is necessary to complete > an I/O request and pe

Re: [PATCH 2/2] hw/sd/sdcard: Do not allow invalid SD card sizes

2020-07-09 Thread Niek Linnenbank
On Thu, Jul 9, 2020 at 4:15 PM Peter Maydell wrote: > On Thu, 9 Jul 2020 at 14:56, Philippe Mathieu-Daudé > wrote: > > > > On 7/7/20 10:29 PM, Niek Linnenbank wrote: > > > So I manually copy & pasted the change into hw/sd/sd.c to test it. > > > It looks like the check works, but my concern is th

Re: [PATCH 2/2] hw/sd/sdcard: Do not allow invalid SD card sizes

2020-07-09 Thread Niek Linnenbank
On Thu, Jul 9, 2020 at 3:56 PM Philippe Mathieu-Daudé wrote: > On 7/7/20 10:29 PM, Niek Linnenbank wrote: > > Hi Philippe, > > > > Just tried out your patch on latest master, and I noticed I couldn't > > apply it without getting this error: > > > > $ git am ~/Downloads/patches/\[PATCH\ 2_2\]\ hw_

Re: [PATCH 2/2] hw/sd/sdcard: Do not allow invalid SD card sizes

2020-07-09 Thread Alistair Francis
On Thu, Jul 9, 2020 at 7:35 AM Philippe Mathieu-Daudé wrote: > > On 7/9/20 4:15 PM, Peter Maydell wrote: > > On Thu, 9 Jul 2020 at 14:56, Philippe Mathieu-Daudé wrote: > >> > >> On 7/7/20 10:29 PM, Niek Linnenbank wrote: > >>> So I manually copy & pasted the change into hw/sd/sd.c to test it. > >

Re: [PATCH v7 14/47] stream: Deal with filters

2020-07-09 Thread Andrey Shinkevich
On 09.07.2020 17:52, Andrey Shinkevich wrote: On 25.06.2020 18:21, Max Reitz wrote: Because of the (not so recent anymore) changes that make the stream job independent of the base node and instead track the node above it, we have to split that "bottom" node into two cases: The bottom COW node, a

Re: [PATCH v7 14/47] stream: Deal with filters

2020-07-09 Thread Andrey Shinkevich
On 25.06.2020 18:21, Max Reitz wrote: Because of the (not so recent anymore) changes that make the stream job independent of the base node and instead track the node above it, we have to split that "bottom" node into two cases: The bottom COW node, and the node directly above the base node (which

Re: [PULL 18/31] block/core: add generic infrastructure for x-blockdev-amend qmp command

2020-07-09 Thread Peter Maydell
On Mon, 6 Jul 2020 at 11:05, Max Reitz wrote: > > From: Maxim Levitsky > > blockdev-amend will be used similiar to blockdev-create > to allow on the fly changes of the structure of the format based block > devices. > > Current plan is to first support encryption keyslot management for luks > bas

Re: [PULL 00/12] Block patches

2020-07-09 Thread Kevin Wolf
Am 08.07.2020 um 00:05 hat Eduardo Habkost geschrieben: > On Tue, Jul 07, 2020 at 05:28:21PM +0200, Philippe Mathieu-Daudé wrote: > > On 6/26/20 12:25 PM, Stefan Hajnoczi wrote: > > > On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote: > > >> On Wed, 24 Jun 2020 at 11:02, Stefan Hajnocz

Re: [PATCH v7 14/47] stream: Deal with filters

2020-07-09 Thread Andrey Shinkevich
On 25.06.2020 18:21, Max Reitz wrote: Because of the (not so recent anymore) changes that make the stream job independent of the base node and instead track the node above it, we have to split that "bottom" node into two cases: The bottom COW node, and the node directly above the base node (which

Re: [PATCH 2/2] hw/sd/sdcard: Do not allow invalid SD card sizes

2020-07-09 Thread Philippe Mathieu-Daudé
On 7/9/20 4:15 PM, Peter Maydell wrote: > On Thu, 9 Jul 2020 at 14:56, Philippe Mathieu-Daudé wrote: >> >> On 7/7/20 10:29 PM, Niek Linnenbank wrote: >>> So I manually copy & pasted the change into hw/sd/sd.c to test it. >>> It looks like the check works, but my concern is that with this change, >

Re: [PATCH 2/2] hw/sd/sdcard: Do not allow invalid SD card sizes

2020-07-09 Thread Peter Maydell
On Thu, 9 Jul 2020 at 14:56, Philippe Mathieu-Daudé wrote: > > On 7/7/20 10:29 PM, Niek Linnenbank wrote: > > So I manually copy & pasted the change into hw/sd/sd.c to test it. > > It looks like the check works, but my concern is that with this change, > > we will be getting this error on 'off-the

Re: [PATCH v10 31/34] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2020-07-09 Thread Max Reitz
On 03.07.20 17:58, Alberto Garcia wrote: > Now that the implementation of subclusters is complete we can finally > add the necessary options to create and read images with this feature, > which we call "extended L2 entries". > > Signed-off-by: Alberto Garcia > Reviewed-by: Eric Blake > Reviewed-

Re: [PATCH 2/2] hw/sd/sdcard: Do not allow invalid SD card sizes

2020-07-09 Thread Philippe Mathieu-Daudé
On 7/7/20 10:29 PM, Niek Linnenbank wrote: > Hi Philippe, > > Just tried out your patch on latest master, and I noticed I couldn't > apply it without getting this error: > > $ git am ~/Downloads/patches/\[PATCH\ 2_2\]\ hw_sd_sdcard\:\ Do\ not\ > allow\ invalid\ SD\ card\ sizes\ -\ Philippe\ Mathi

[PATCH] block: Avoid stale pointer dereference in blk_get_aio_context()

2020-07-09 Thread Greg Kurz
It is possible for blk_remove_bs() to race with blk_drain_all(), causing the latter to dereference a stale blk->root pointer: blk_remove_bs(blk) bdrv_root_unref_child(blk->root) child_bs = blk->root->bs bdrv_detach_child(blk->root) ... g_free(blk->root) <== blk-

Re: [PATCH v10 31/34] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2020-07-09 Thread Alberto Garcia
On Thu 09 Jul 2020 03:07:29 PM CEST, Max Reitz wrote: > On 03.07.20 17:58, Alberto Garcia wrote: >> Now that the implementation of subclusters is complete we can finally >> add the necessary options to create and read images with this feature, >> which we call "extended L2 entries". >> >> Signed-o

[PATCH 4/6] block, migration: add bdrv_finalize_vmstate helper

2020-07-09 Thread Denis V. Lunev
Right now bdrv_fclose() is just calling bdrv_flush(). The problem is that migration code is working inefficiently from block layer terms and are frequently called for very small pieces of unaligned data. Block layer is capable to work this way, but this is very slow. This patch is a preparation f

[PATCH 2/6] block/aio_task: drop aio_task_pool_wait_one() helper

2020-07-09 Thread Denis V. Lunev
It is not used outside the module. Actually there are 2 kind of waiters: - for a slot and - for all tasks to finish This patch limits external API to listed types. Signed-off-by: Denis V. Lunev Suggested-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf

[PATCH 6/6] block/io: improve loadvm performance

2020-07-09 Thread Denis V. Lunev
This patch creates intermediate buffer for reading from block driver state and performs read-ahead to this buffer. Snapshot code performs reads sequentially and thus we know what offsets will be required and when they will become not needed. Results are fantastic. Switch to snapshot times of 2GB F

[PATCH 5/6] block/io: improve savevm performance

2020-07-09 Thread Denis V. Lunev
This patch does 2 standard basic things: - it creates intermediate buffer for all writes from QEMU migration code to block driver, - this buffer is sent to disk asynchronously, allowing several writes to run in parallel. Thus bdrv_vmstate_write() is becoming asynchronous. All pending operation

[PATCH 1/6] block/aio_task: allow start/wait task from any coroutine

2020-07-09 Thread Denis V. Lunev
From: Vladimir Sementsov-Ogievskiy Currently, aio task pool assumes that there is a main coroutine, which creates tasks and wait for them. Let's remove the restriction by using CoQueue. Code becomes clearer, interface more obvious. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Deni

[PATCH v8 0/6] block: seriously improve savevm/loadvm performance

2020-07-09 Thread Denis V. Lunev
This series do standard basic things: - it creates intermediate buffer for all writes from QEMU migration code to QCOW2 image, - this buffer is sent to disk asynchronously, allowing several writes to run in parallel. In general, migration code is fantastically inefficent (by observation), buff

[PATCH 3/6] block/block-backend: remove always true check from blk_save_vmstate

2020-07-09 Thread Denis V. Lunev
bdrv_save_vmstate() returns either error with negative return value or size. Thus this check is useless. Signed-off-by: Denis V. Lunev Suggested-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Max Reitz CC: Stefan Hajnoczi CC: Fam Zheng CC: Juan Quintela CC: "Dr

Re: [PATCH v10 34/34] iotests: Add tests for qcow2 images with extended L2 entries

2020-07-09 Thread Max Reitz
On 03.07.20 17:58, Alberto Garcia wrote: > Signed-off-by: Alberto Garcia > --- > tests/qemu-iotests/271 | 901 + > tests/qemu-iotests/271.out | 724 + > tests/qemu-iotests/group | 1 + > 3 files changed, 1626 insertions(+) >

Re: [PATCH v10 31/34] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2020-07-09 Thread Max Reitz
On 03.07.20 17:58, Alberto Garcia wrote: > Now that the implementation of subclusters is complete we can finally > add the necessary options to create and read images with this feature, > which we call "extended L2 entries". > > Signed-off-by: Alberto Garcia > Reviewed-by: Eric Blake > Reviewed-

[PULL v2] Block layer patches

2020-07-09 Thread Kevin Wolf
The following changes since commit 8796c64ecdfd34be394ea277a53df0c76996: Merge remote-tracking branch 'remotes/kraxel/tags/audio-20200706-pull-request' into staging (2020-07-08 16:33:59 +0100) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream fo

Re: [PATCH] iotests: Simplify _filter_img_create() a bit

2020-07-09 Thread Kevin Wolf
Am 09.07.2020 um 13:02 hat Max Reitz geschrieben: > Not only is it a bit stupid to try to filter multi-line "Formatting" > output (because we only need it for a single test, which can easily be > amended to no longer need it), it is also problematic when there can be > output after a "Formatting" l

Re: [PATCH v10 28/34] qcow2: Add subcluster support to qcow2_co_pwrite_zeroes()

2020-07-09 Thread Max Reitz
On 03.07.20 17:58, Alberto Garcia wrote: > This works now at the subcluster level and pwrite_zeroes_alignment is > updated accordingly. > > qcow2_cluster_zeroize() is turned into qcow2_subcluster_zeroize() with > the following changes: > >- The request can now be subcluster-aligned. > >-

Re: [PATCH v10 21/34] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-07-09 Thread Max Reitz
On 03.07.20 17:58, Alberto Garcia wrote: > The logic of this function remains pretty much the same, except that > it uses count_contiguous_subclusters(), which combines the logic of > count_contiguous_clusters() / count_contiguous_clusters_unallocated() > and checks individual subclusters. > > qco

[PATCH] iotests: Simplify _filter_img_create() a bit

2020-07-09 Thread Max Reitz
Not only is it a bit stupid to try to filter multi-line "Formatting" output (because we only need it for a single test, which can easily be amended to no longer need it), it is also problematic when there can be output after a "Formatting" line that we do not want to filter as if it were part of it

Re: [PULL 00/12] Block layer patches

2020-07-09 Thread Kevin Wolf
Am 07.07.2020 um 18:34 hat Kevin Wolf geschrieben: > The following changes since commit 7623b5ba017f61de5d7c2bba12c6feb3d55091b1: > > Merge remote-tracking branch > 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging > (2020-07-06 11:40:10 +0100) > > are available in the Git r

Re: [PATCH 1/7] migration/savevm: respect qemu_fclose() error code in save_snapshot()

2020-07-09 Thread Juan Quintela
"Denis V. Lunev" wrote: > qemu_fclose() could return error, f.e. if bdrv_co_flush() will return > the error. > > This validation will become more important once we will start waiting of > asynchronous IO operations, started from bdrv_write_vmstate(), which are > coming soon. > > Signed-off-by: Den

Re: [PATCH v10 02/34] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-07-09 Thread Max Reitz
On 03.07.20 17:57, Alberto Garcia wrote: > qcow2_get_cluster_offset() takes an (unaligned) guest offset and > returns the (aligned) offset of the corresponding cluster in the qcow2 > image. > > In practice none of the callers need to know where the cluster starts > so this patch makes the function

Re: [PATCH v7 12/47] block: Use bdrv_filter_(bs|child) where obvious

2020-07-09 Thread Andrey Shinkevich
On 09.07.2020 11:59, Max Reitz wrote: On 08.07.20 20:24, Andrey Shinkevich wrote: On 25.06.2020 18:21, Max Reitz wrote: Places that use patterns like if (bs->drv->is_filter && bs->file) { ... something about bs->file->bs ... } should be BlockDriverState *filtered

Re: [PATCH v7 02/47] block: Add chain helper functions

2020-07-09 Thread Andrey Shinkevich
On 09.07.2020 11:24, Max Reitz wrote: On 08.07.20 19:20, Andrey Shinkevich wrote: On 25.06.2020 18:21, Max Reitz wrote: Add some helper functions for skipping filters in a chain of block nodes. Signed-off-by: Max Reitz ---   include/block/block_int.h |  3 +++   block.c   | 5

Re: [PATCH v7 00/47] block: Deal with filters

2020-07-09 Thread Andrey Shinkevich
On 09.07.2020 11:20, Max Reitz wrote: On 08.07.20 22:47, Eric Blake wrote: On 7/8/20 12:20 PM, Andrey Shinkevich wrote: On 25.06.2020 18:21, Max Reitz wrote: v6: https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg01715.html Branch: https://github.com/XanClic/qemu.git child-access-fun

Re: [PATCH v7 12/47] block: Use bdrv_filter_(bs|child) where obvious

2020-07-09 Thread Max Reitz
On 08.07.20 20:24, Andrey Shinkevich wrote: > On 25.06.2020 18:21, Max Reitz wrote: >> Places that use patterns like >> >> if (bs->drv->is_filter && bs->file) { >> ... something about bs->file->bs ... >> } >> >> should be >> >> BlockDriverState *filtered = bdrv_filter_bs(bs)

Re: [PATCH v7 02/47] block: Add chain helper functions

2020-07-09 Thread Max Reitz
On 08.07.20 19:20, Andrey Shinkevich wrote: > On 25.06.2020 18:21, Max Reitz wrote: >> Add some helper functions for skipping filters in a chain of block >> nodes. >> >> Signed-off-by: Max Reitz >> --- >>   include/block/block_int.h |  3 +++ >>   block.c   | 55

Re: [PATCH v7 00/47] block: Deal with filters

2020-07-09 Thread Max Reitz
On 08.07.20 22:47, Eric Blake wrote: > On 7/8/20 12:20 PM, Andrey Shinkevich wrote: >> On 25.06.2020 18:21, Max Reitz wrote: >>> v6: >>> https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg01715.html >>> >>> Branch: https://github.com/XanClic/qemu.git child-access-functions-v7 >>> Branch: h

Re: [PATCH v7 00/47] block: Deal with filters

2020-07-09 Thread Max Reitz
On 08.07.20 22:37, Eric Blake wrote: > On 7/8/20 2:46 PM, Andrey Shinkevich wrote: >> >> On 08.07.2020 20:32, Eric Blake wrote: >>> On 7/8/20 12:20 PM, Andrey Shinkevich wrote: On 25.06.2020 18:21, Max Reitz wrote: > v6: > https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg017