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
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.
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
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(+
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:
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
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
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
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
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
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
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
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
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..
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
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
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
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,
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
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
@@ -
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
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
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
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
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 = {
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_
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
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 {
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 (
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
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
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
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
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
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_
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.
> >
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
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
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
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
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
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,
>
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
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-
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
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-
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
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
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
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
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
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
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
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
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(+)
>
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-
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
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
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.
>
>-
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
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
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
"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
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
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
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
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
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)
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
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
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
71 matches
Mail list logo