On Thu, Jan 20, 2022 at 9:23 AM Hanna Reitz wrote:
>
> When we still have an AIOCB registered for DMA operations, we try to
> settle the respective operation by draining the BlockBackend associated
> with the IDE device.
>
> However, this assumes that every DMA operation is associated with an
>
On Fri, Jan 21, 2022 at 7:06 AM Thomas Huth wrote:
>
> The retry_isa test is not doing what it was intended for: The
> test_retry_flush() function ignores the machine parameter completely
> and thus this test does not get run with the "isapc" machine.
> Moreover, in the course of time, the
block_crypto_amend_options_generic_luks uses the block layer
permission API, therefore it should be called with the BQL held.
However, the same function is being called by two BlockDriver
callbacks: bdrv_amend_options (under BQL) and bdrv_co_amend (I/O).
The latter is I/O because it is invoked
Introduce .pre_run() job callback. This cb will run in job_start,
before the coroutine is created and runs run() in the job aiocontext.
Therefore, .pre_run() always runs in the main loop.
We can use this function together with clean() cb to replace
bdrv_child_refresh_perms in
This function is currently just a wrapper for bdrv_invalidate_cache(),
but in future will contain the code of bdrv_co_invalidate_cache() that
has to always be protected by BQL, and leave the rest in the I/O
coroutine.
Replace all bdrv_invalidate_cache() invokations with bdrv_activate().
Following the assertion derived from the API split,
propagate the assertion also in the static functions.
Signed-off-by: Emanuele Giuseppe Esposito
---
block.c | 47 ++-
block/block-backend.c | 3 +++
2 files changed, 49 insertions(+), 1
Signed-off-by: Emanuele Giuseppe Esposito
---
include/block/block_int-common.h | 67 +++-
1 file changed, 40 insertions(+), 27 deletions(-)
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index e007dbf768..cc8c8835ba 100644
---
We want to be sure that the functions that write the child and
parent list of a bs are under BQL and drain.
BQL prevents from concurrent writings from the GS API, while
drains protect from I/O.
TODO: drains are missing in some functions using this assert.
Therefore a proper assertion will fail.
block.h currently contains a mix of functions:
some of them run under the BQL and modify the block layer graph,
others are instead thread-safe and perform I/O in iothreads.
It is not easy to understand which function is part of which
group (I/O vs GS), and this patch aims to clarify it.
The "GS"
Split bdrv_co_invalidate cache in two: the GS code that takes
care of permissions and running GS callbacks, and leave only the
I/O code (->bdrv_co_invalidate_cache) running in the I/O coroutine.
The only side effect is that bdrv_co_invalidate_cache is not
recursive anymore, and so is every direct
On 21/01/2022 13:33, Emanuele Giuseppe Esposito wrote:
On 19/01/2022 11:31, Paolo Bonzini wrote:
diff --git a/blockjob.c b/blockjob.c
index cf1f49f6c2..468ba735c5 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -155,14 +155,16 @@ static void child_job_set_aio_ctx(BdrvChild *c,
AioContext
copy-before-write functions always run under BQL lock.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Paolo Bonzini
Reviewed-by: Stefan Hajnoczi
---
block/copy-before-write.c | 2 ++
block/copy-before-write.h | 7 +++
2 files changed, 9 insertions(+)
diff --git
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Paolo Bonzini
Reviewed-by: Stefan Hajnoczi
---
block/block-backend.c | 3 +++
blockdev.c| 16
2 files changed, 19 insertions(+)
diff --git a/block/block-backend.c b/block/block-backend.c
index
Now that we "covered" the three main cases where the
permission API was being used under BQL (fuse,
amend and invalidate_cache), we can safely assert for
the permission functions implemented in block.c
Signed-off-by: Emanuele Giuseppe Esposito
---
block.c | 12
1 file changed, 12
These two callbacks will be invoked by job callbacks to execute
driver-specific code while still being in BQL.
In this example, we want the amend JobDriver to execute the
permission check (bdrv_child_refresh_perms) currently only
done in block/crypto.c block_crypto_amend_options_generic_luks()
to
The job API will be handled separately in another serie.
Signed-off-by: Emanuele Giuseppe Esposito
---
include/qemu/job.h | 22 ++
1 file changed, 22 insertions(+)
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 6e67b6977f..4ea7a4a0cd 100644
---
blockjob functions run always under the BQL lock.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
include/block/blockjob.h | 9 +
1 file changed, 9 insertions(+)
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index 87fbb3985f..2373dfeb07
Following the bdrv_activate renaming, change also the name
of the respective callers.
bdrv_invalidate_cache_all -> bdrv_activate_all
blk_invalidate_cache -> blk_activate
test_sync_op_invalidate_cache -> test_sync_op_activate
No functional change intended.
Signed-off-by: Emanuele Giuseppe
Signed-off-by: Emanuele Giuseppe Esposito
---
job.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/job.c b/job.c
index 54db80df66..39bf511949 100644
--- a/job.c
+++ b/job.c
@@ -381,6 +381,8 @@ void job_ref(Job *job)
void job_unref(Job *job)
{
+assert(qemu_in_main_thread());
Assertions in the callers of the function pointrs are already
added by previous patches.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Reviewed-by: Philippe Mathieu-Daudé
---
include/sysemu/block-backend-common.h | 28 ++-
1 file changed, 23
Signed-off-by: Emanuele Giuseppe Esposito
---
block.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/block.c b/block.c
index 448fb9d76f..ca16d90627 100644
--- a/block.c
+++ b/block.c
@@ -1491,6 +1491,7 @@ const BdrvChildClass child_of_bds = {
AioContext
Signed-off-by: Emanuele Giuseppe Esposito
---
block.c| 18 ++
block/create.c | 2 ++
2 files changed, 20 insertions(+)
diff --git a/block.c b/block.c
index bad834c86e..448fb9d76f 100644
--- a/block.c
+++ b/block.c
@@ -526,6 +526,7 @@ static void coroutine_fn
Similar to the header split, also the function pointers in BlockDriver
can be split in I/O and global state.
Signed-off-by: Emanuele Giuseppe Esposito
---
include/block/block_int-common.h | 434 ---
1 file changed, 231 insertions(+), 203 deletions(-)
diff --git
block coroutines functions run in different aiocontext, and are
not protected by the BQL. Therefore are I/O.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Paolo Bonzini
Reviewed-by: Stefan Hajnoczi
---
block/coroutines.h | 6 ++
1 file changed, 6 insertions(+)
diff --git
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
blockjob.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/blockjob.c b/blockjob.c
index 32fe27a6d4..cce8146cb6 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -62,6 +62,7 @@ static bool is_block_job(Job
Since the I/O functions are not many, keep a single file.
Also split the function pointers in BlockJobDriver.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
include/block/blockjob_int.h | 28
1 file changed, 28 insertions(+)
diff --git
blockdev functions run always under the BQL lock.
Signed-off-by: Emanuele Giuseppe Esposito
---
include/sysemu/blockdev.h | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
index f9fb54d437..a420bbc630 100644
Signed-off-by: Emanuele Giuseppe Esposito
---
block.c | 15 +++
block/backup.c | 1 +
block/block-backend.c | 3 +++
block/commit.c | 2 ++
block/dirty-bitmap.c| 1 +
block/io.c |
Similarly to the previous patches, split block-backend.h
in block-backend-io.h and block-backend-global-state.h
In addition, remove "block/block.h" include as it seems
it is not necessary anymore, together with "qemu/iov.h"
block-backend-common.h contains the structures shared between
the two
Similarly to the previous patch, split block_int.h
in block_int-io.h and block_int-global-state.h
block_int-common.h contains the structures shared between
the two headers, and the functions that can't be categorized as
I/O or global state.
Assertions are added in the next patch.
Signed-off-by:
Snapshots run also under the BQL lock, so they all are
in the global state API. The aiocontext lock that they hold
is currently an overkill and in future could be removed.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Paolo Bonzini
Reviewed-by: Stefan Hajnoczi
---
block/snapshot.c
All the global state (GS) API functions will check that
qemu_in_main_thread() returns true. If not, it means
that the safety of BQL cannot be guaranteed, and
they need to be moved to I/O.
Signed-off-by: Emanuele Giuseppe Esposito
---
block.c| 133
Allow writable exports to get BLK_PERM_RESIZE permission
from creation, in fuse_export_create().
In this way, there is no need to give the permission in
fuse_do_truncate(), which might be run in an iothread.
Permissions should be set only in the main thread, so
in any case if an iothread tries to
When invoked from the main loop, this function is the same
as qemu_mutex_iothread_locked, and returns true if the BQL is held.
When invoked from iothreads or tests, it returns true only
if the current AioContext is the Main Loop.
This essentially just extends qemu_mutex_iothread_locked to work
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
blockjob.c | 4
1 file changed, 4 insertions(+)
diff --git a/blockjob.c b/blockjob.c
index 10815a89fe..32fe27a6d4 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -84,6 +84,7 @@ BlockJob *block_job_get(const char *id)
All the global state (GS) API functions will check that
qemu_in_main_thread() returns true. If not, it means
that the safety of BQL cannot be guaranteed, and
they need to be moved to I/O.
Signed-off-by: Emanuele Giuseppe Esposito
---
block/block-backend.c | 79
Currently, block layer APIs like block.h contain a mix of
functions that are either running in the main loop and under the
BQL, or are thread-safe functions and run in iothreads performing I/O.
The functions running under BQL also take care of modifying the
block graph, by using drain and/or
21.01.2022 18:25, Emanuele Giuseppe Esposito wrote:
On 19/01/2022 11:44, Paolo Bonzini wrote:
On 1/5/22 15:01, Emanuele Giuseppe Esposito wrote:
These functions assume that the job lock is held by the
caller, to avoid TOC/TOU conditions. Therefore, their
name must end with _locked.
On 1/21/22 15:34, Daniel P. Berrangé wrote:
> On Fri, Jan 21, 2022 at 07:30:55AM -0700, Warner Losh wrote:
>> On Fri, Jan 21, 2022 at 4:47 AM Daniel P. Berrangé
>> wrote:
>>
>>> On Fri, Jan 21, 2022 at 12:40:48PM +0100, Thomas Huth wrote:
On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
On 19/01/2022 11:44, Paolo Bonzini wrote:
On 1/5/22 15:01, Emanuele Giuseppe Esposito wrote:
These functions assume that the job lock is held by the
caller, to avoid TOC/TOU conditions. Therefore, their
name must end with _locked.
Introduce also additional helpers that define _locked
On 19/01/2022 11:31, Paolo Bonzini wrote:
diff --git a/job.c b/job.c
index f16a4ef542..8a5b710d9b 100644
--- a/job.c
+++ b/job.c
@@ -566,7 +566,7 @@ void job_enter_cond_locked(Job *job, bool(*fn)(Job
*job))
job->busy = true;
real_job_unlock();
job_unlock();
-
On Fri, Jan 21, 2022 at 4:47 AM Daniel P. Berrangé
wrote:
> On Fri, Jan 21, 2022 at 12:40:48PM +0100, Thomas Huth wrote:
> > On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
> > > Refresh lcitool submodule and the generated files by running:
> > >
> > >$ make lcitool-refresh
> > >
> > >
On Fri, Jan 21, 2022 at 07:30:55AM -0700, Warner Losh wrote:
> On Fri, Jan 21, 2022 at 4:47 AM Daniel P. Berrangé
> wrote:
>
> > On Fri, Jan 21, 2022 at 12:40:48PM +0100, Thomas Huth wrote:
> > > On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
> > > > Refresh lcitool submodule and the
Hanna Reitz writes:
> On 21.01.22 11:27, Markus Armbruster wrote:
>> Hanna Reitz writes:
>>> The problem I face is that currently there is no ergonomic way to wait
>>> until the QSD is up and running (besides looping until the PID file
>>> exists), and I don’t think a utility program that
On 1/21/22 12:47, Thomas Huth wrote:
> On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
>> The previous commit removed all uses of libxml2.
>>
>> Update lcitool's qemu.yml and refresh the generated files by running:
>>
>> $ make lcitool-refresh
>
> Could you merge patch 4/8 and 7/8 so that
On 19/01/2022 11:31, Paolo Bonzini wrote:
diff --git a/blockjob.c b/blockjob.c
index cf1f49f6c2..468ba735c5 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -155,14 +155,16 @@ static void child_job_set_aio_ctx(BdrvChild *c,
AioContext *ctx,
bdrv_set_aio_context_ignore(sibling->bs, ctx,
The retry_isa test is not doing what it was intended for: The
test_retry_flush() function ignores the machine parameter completely
and thus this test does not get run with the "isapc" machine.
Moreover, in the course of time, the test_retry_flush() has been
changed to depend on PCI-related
On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
lcitool doesn't support MSYS2 targets, so manually remove
this now unnecessary library.
Reviewed-by: Daniel P. Berrangé
Signed-off-by: Philippe Mathieu-Daudé
---
.cirrus.yml | 1 -
.gitlab-ci.d/windows.yml | 2 --
2 files
On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
The previous commit removed all uses of libxml2.
Update lcitool's qemu.yml and refresh the generated files by running:
$ make lcitool-refresh
Could you merge patch 4/8 and 7/8 so that there is only one refreshment
patch in your series?
On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
From: Michael Tokarev
For a long time, we assumed that libxml2 is necessary for parallels
block format support (block/parallels*). However, this format actually
does not use libxml [*]. Since this is the only user of libxml2 in
whole QEMU
On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
Refresh lcitool submodule and the generated files by running:
$ make lcitool-refresh
Reviewed-by: Daniel P. Berrangé
Signed-off-by: Philippe Mathieu-Daudé
---
.gitlab-ci.d/cirrus/freebsd-12.vars | 2 +-
On Fri, Jan 21, 2022 at 12:40:48PM +0100, Thomas Huth wrote:
> On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
> > Refresh lcitool submodule and the generated files by running:
> >
> >$ make lcitool-refresh
> >
> > Reviewed-by: Daniel P. Berrangé
> > Signed-off-by: Philippe Mathieu-Daudé
On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
lcitool is used by build test / automation, we want maintainers
to get notified if the submodule is updated.
Reviewed-by: Daniel P. Berrangé
Signed-off-by: Philippe Mathieu-Daudé
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
On 21.01.22 11:27, Markus Armbruster wrote:
Hanna Reitz writes:
On 21.01.22 07:10, Markus Armbruster wrote:
Hanna Reitz writes:
On 20.01.22 17:00, Markus Armbruster wrote:
Kevin Wolf writes:
Am 19.01.2022 um 14:44 hat Hanna Reitz geschrieben:
On 19.01.22 13:58, Markus Armbruster
On 21/01/2022 11.36, Philippe Mathieu-Daudé wrote:
Correct the libvirt-ci repository URL to avoid this warning when
cloning / refreshing the submodule:
warning: redirecting to https://gitlab.com/libvirt/libvirt-ci.git/
Fixes: 4ebb040f1fd ("tests: integrate lcitool for generating build env
On Fri, Jan 21, 2022 at 11:36:17AM +0100, Philippe Mathieu-Daudé wrote:
> Correct the libvirt-ci repository URL to avoid this warning when
> cloning / refreshing the submodule:
>
> warning: redirecting to https://gitlab.com/libvirt/libvirt-ci.git/
>
> Fixes: 4ebb040f1fd ("tests: integrate
The previous commit removed all uses of libxml2.
Update lcitool's qemu.yml and refresh the generated files by running:
$ make lcitool-refresh
Reviewed-by: Daniel P. Berrangé
Signed-off-by: Philippe Mathieu-Daudé
---
.gitlab-ci.d/cirrus/freebsd-12.vars | 2 +-
Refresh lcitool submodule and the generated files by running:
$ make lcitool-refresh
Reviewed-by: Daniel P. Berrangé
Signed-off-by: Philippe Mathieu-Daudé
---
.gitlab-ci.d/cirrus/freebsd-12.vars | 2 +-
.gitlab-ci.d/cirrus/freebsd-13.vars | 2 +-
lcitool is used by build test / automation, we want maintainers
to get notified if the submodule is updated.
Reviewed-by: Daniel P. Berrangé
Signed-off-by: Philippe Mathieu-Daudé
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index
On 1/20/22 12:30, Philippe Mathieu-Daudé wrote:
> From: Michael Tokarev
>
> For a long time, we assumed that libxml2 is neecessary for parallels
> block format support (block/parallels*). However, this format actually
> does not use libxml [*]. Since this is the only user of libxml2 in
> while
20.01.2022 19:11, Hanna Reitz wrote:
On 22.12.21 18:40, Vladimir Sementsov-Ogievskiy wrote:
Introduce a new driver, that works in pair with copy-before-write to
improve fleecing.
Without fleecing driver, old fleecing scheme looks as follows:
[guest]
|
|root
v
[copy-before-write]
On 1/21/22 11:36, Philippe Mathieu-Daudé wrote:
> Correct the libvirt-ci repository URL to avoid this warning when
> cloning / refreshing the submodule:
>
> warning: redirecting to https://gitlab.com/libvirt/libvirt-ci.git/
>
> Fixes: 4ebb040f1fd ("tests: integrate lcitool for generating build
On Debian we also need libibumad to enable RDMA:
$ ../configure --enable-rdma
ERROR: OpenFabrics librdmacm/libibverbs/libibumad not present.
Your options:
(1) Fast: Install infiniband packages (devel) from your distro.
(2) Cleanest: Install libraries from
Hanna Reitz writes:
> On 21.01.22 07:10, Markus Armbruster wrote:
>> Hanna Reitz writes:
>>
>>> On 20.01.22 17:00, Markus Armbruster wrote:
Kevin Wolf writes:
> Am 19.01.2022 um 14:44 hat Hanna Reitz geschrieben:
>> On 19.01.22 13:58, Markus Armbruster wrote:
>>> Hanna
lcitool doesn't support MSYS2 targets, so manually remove
this now unnecessary library.
Reviewed-by: Daniel P. Berrangé
Signed-off-by: Philippe Mathieu-Daudé
---
.cirrus.yml | 1 -
.gitlab-ci.d/windows.yml | 2 --
2 files changed, 3 deletions(-)
diff --git a/.cirrus.yml
Correct the libvirt-ci repository URL to avoid this warning when
cloning / refreshing the submodule:
warning: redirecting to https://gitlab.com/libvirt/libvirt-ci.git/
Fixes: 4ebb040f1fd ("tests: integrate lcitool for generating build env
manifests")
Signed-off-by: Philippe Mathieu-Daudé
---
From: Michael Tokarev
For a long time, we assumed that libxml2 is necessary for parallels
block format support (block/parallels*). However, this format actually
does not use libxml [*]. Since this is the only user of libxml2 in
whole QEMU tree, we can drop all libxml2 checks and dependencies
The script only include the local qemu.yml for Dockerfiles.
Since we want to keep the Cirrus-CI generated files in sync,
also use the --data-dir option in generate_cirrus().
Fixes: c45a540f4bd (".gitlab-ci.d/cirrus: auto-generate variables with lcitool")
Reported-by: Daniel P. Berrangé
Missing review: Patch #2 (new)
Refresh lcitool to latest and remove libxml2 (mjt).
v4:
- Fixed typos and cleaned checkpatch.pl (thuth)
- Corrected libvirt-ci submodule URL
v3:
- fix 'refresh' helper to update cirrus-ci files (danpb)
v2:
- rebased (testing/next)
- include mjt's libxml2 removal
On 20/01/2022 14:48, Kevin Wolf wrote:
Am 20.01.2022 um 14:22 hat Paolo Bonzini geschrieben:
On 1/19/22 19:34, Kevin Wolf wrote:
So if we go back to a bdrv_invalidate_cache() that does all the graph
manipulations (and asserts that we're in the main loop) and then have a
much smaller
To support block resize, this updates the capacity field
in configuration space and use vu_notify_config_change()
to notify the vhost-user master on the block resize callback.
Signed-off-by: Xie Yongji
---
block/export/vhost-user-blk-server.c | 16
1 file changed, 16
This adds a new API vu_notify_config_change() to support
sending VHOST_USER_SLAVE_CONFIG_CHANGE_MSG message to notify
that the configuration space has changed.
Signed-off-by: Xie Yongji
---
subprojects/libvhost-user/libvhost-user.c | 20
On 21.01.22 07:10, Markus Armbruster wrote:
Hanna Reitz writes:
On 20.01.22 17:00, Markus Armbruster wrote:
Kevin Wolf writes:
Am 19.01.2022 um 14:44 hat Hanna Reitz geschrieben:
On 19.01.22 13:58, Markus Armbruster wrote:
Hanna Reitz writes:
We want to add a --daemonize argument to
From: Klaus Jensen
This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the
device itself. This still allows DMA to MMIO regions of other devices
(e.g. doing P2P DMA to the controller memory buffer of another NVMe
device).
Fixes: CVE-2021-3929
Reported-by: Qiuhao Li
Reviewed-by:
Hanna Reitz writes:
> On 20.01.22 17:00, Markus Armbruster wrote:
>> Kevin Wolf writes:
>>
>>> Am 19.01.2022 um 14:44 hat Hanna Reitz geschrieben:
On 19.01.22 13:58, Markus Armbruster wrote:
> Hanna Reitz writes:
>
>> We want to add a --daemonize argument to QSD's command
75 matches
Mail list logo