[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] bc5d30: qapi: Fix error message format regres
From: |
Richard Henderson |
Subject: |
[Qemu-commits] [qemu/qemu] bc5d30: qapi: Fix error message format regression |
Date: |
Tue, 25 Apr 2023 23:24:15 -0700 |
Branch: refs/heads/staging
Home: https://github.com/qemu/qemu
Commit: bc5d3031642b15096876d232534cee38d0ab0484
https://github.com/qemu/qemu/commit/bc5d3031642b15096876d232534cee38d0ab0484
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/main.py
Log Message:
-----------
qapi: Fix error message format regression
Commit 52a474180ae3 changed reporting of errors connected to a source
location without mentioning it in the commit message. For instance,
$ python scripts/qapi-gen.py tests/qapi-schema/unknown-escape.json
tests/qapi-schema/unknown-escape.json:3:21: unknown escape \x
became
scripts/qapi-gen.py: tests/qapi-schema/unknown-escape.json:3:21: unknown
escape \x
This is not how compilers report such errors, and Emacs doesn't
recognize the format. Revert this change.
Fixes: 52a474180ae3 (qapi-gen: Separate arg-parsing from generation)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-2-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Commit: ecee568ef9bc81a2a74399290ad0e445c1c36d2c
https://github.com/qemu/qemu/commit/ecee568ef9bc81a2a74399290ad0e445c1c36d2c
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/schema.py
Log Message:
-----------
qapi/schema: Use super()
Commit 2cae67bcb5e (qapi: Use super() now we have Python 3) converted
the code to super(). Shortly after, commit f965e8fea6a (qapi: New
special feature flag "deprecated") neglected to use super(). Convert
it now.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-3-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Commit: 607045ba39f6ca845ede3131a902ad785088fea3
https://github.com/qemu/qemu/commit/607045ba39f6ca845ede3131a902ad785088fea3
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/expr.py
Log Message:
-----------
qapi: Clean up after removal of simple unions
Commit 4e99f4b12c0 (qapi: Drop simple unions) missed a bit of code
dealing with simple union branches. Drop it.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-4-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Commit: 06cc46eeaf3cf5790c85ebbb58e8875719e5eb86
https://github.com/qemu/qemu/commit/06cc46eeaf3cf5790c85ebbb58e8875719e5eb86
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/expr.py
Log Message:
-----------
qapi: Split up check_type()
check_type() can check type names, arrays, and implicit struct types.
Callers pass flags to select from this menu. This makes the function
somewhat hard to read. Moreover, a few minor bugs are hiding in
there, as we'll see shortly.
Split it into check_type_name(), check_type_name_or_array(), and
check_type_name_or_implicit(). Each of them is a copy of the original
specialized to a certain set of flags.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-5-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message corrected]
Commit: 2a0c975f86a24f18b90fc4d65fe8984253fd4562
https://github.com/qemu/qemu/commit/2a0c975f86a24f18b90fc4d65fe8984253fd4562
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/expr.py
M tests/qapi-schema/bad-data.err
M tests/qapi-schema/union-array-branch.err
Log Message:
-----------
qapi: Improve error message for unexpected array types
We reject array types in certain places with "cannot be an array".
Deleting this check improves the error message to "should be a type
name" or "should be an object or type name", depending on context, so
do that.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-6-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Commit: 7c4075190da24a01d9c02f5f59cf0651611bd40f
https://github.com/qemu/qemu/commit/7c4075190da24a01d9c02f5f59cf0651611bd40f
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/expr.py
Log Message:
-----------
qapi: Simplify code a bit after previous commits
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-7-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message corrected]
Commit: 6f2ab6090de993988f7345e449852821ffc75f4e
https://github.com/qemu/qemu/commit/6f2ab6090de993988f7345e449852821ffc75f4e
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/expr.py
M tests/qapi-schema/event-nest-struct.err
M tests/qapi-schema/nested-struct-data.err
M tests/qapi-schema/returns-dict.err
M tests/qapi-schema/struct-member-invalid.err
Log Message:
-----------
qapi: Fix error message when type name or array is expected
We incorrectly report "FOO should be a type name" when it could also
be an array. Fix that.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-8-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Commit: e2050ef633f77781e6b7b3aa04dd736e0ad825e1
https://github.com/qemu/qemu/commit/e2050ef633f77781e6b7b3aa04dd736e0ad825e1
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/expr.py
M tests/qapi-schema/meson.build
A tests/qapi-schema/struct-data-typename.err
A tests/qapi-schema/struct-data-typename.json
A tests/qapi-schema/struct-data-typename.out
Log Message:
-----------
qapi: Fix to reject 'data': 'mumble' in struct
A struct's 'data' must be a JSON object defining the struct's members.
The QAPI code generator incorrectly accepts a JSON string instead, and
then crashes in QAPISchema._make_members() called from
._def_struct_type().
Fix to reject it: factor check_type_implicit() out of
check_type_name_or_implicit(), and switch check_struct() to use it
instead. Also add a test case.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-9-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[More detailed commit message]
Commit: 8fba2f737a372be07739aefeea16c09614a152f0
https://github.com/qemu/qemu/commit/8fba2f737a372be07739aefeea16c09614a152f0
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M tests/qapi-schema/union-invalid-discriminator.err
M tests/qapi-schema/union-invalid-discriminator.json
Log Message:
-----------
tests/qapi-schema: Improve union discriminator coverage
A union's 'discriminator' must name one of the common members.
QAPISchemaVariants.check() looks it up by its c_name(), then checks
the name matches exactly (because c_name() is not injective).
Tests union-base-empty and union-invalid-discriminator both cover the
case where lookup fails. Repurpose the latter to cover the case where
it succeeds and the name check fails.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-10-armbru@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message typo fixed]
Commit: 40e350f0cc580c722499e9f7061ef7cb5824d047
https://github.com/qemu/qemu/commit/40e350f0cc580c722499e9f7061ef7cb5824d047
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M tests/qapi-schema/qapi-schema-test.json
M tests/qapi-schema/qapi-schema-test.out
Log Message:
-----------
tests/qapi-schema: Rename a few conditionals
Positive test case
{ 'enum': 'TestIfEnum',
'data': [ 'foo', { 'name' : 'bar', 'if': 'TEST_IF_ENUM_BAR' } ],
'if': 'TEST_IF_ENUM' }
generates
#if defined(TEST_IF_ENUM)
typedef enum TestIfEnum {
TEST_IF_ENUM_FOO,
#if defined(TEST_IF_ENUM_BAR)
TEST_IF_ENUM_BAR,
#endif /* defined(TEST_IF_ENUM_BAR) */
TEST_IF_ENUM__MAX,
} TestIfEnum;
Macro TEST_IF_ENUM_BAR clashes with the enumeration constant.
Wouldn't compile with -DTEST_IF_BAR.
Rename the macro to TEST_IF_ENUM_MEMBER. For consistency, rename
similar macros elsewhere as well.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-11-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Commit: 39d2cc8e71cb7b67b3636b6c431832a426651dd2
https://github.com/qemu/qemu/commit/39d2cc8e71cb7b67b3636b6c431832a426651dd2
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M tests/qapi-schema/qapi-schema-test.json
M tests/qapi-schema/qapi-schema-test.out
Log Message:
-----------
tests/qapi-schema: Clean up positive test for conditionals
Union TestIfUnion is conditional on macros TEST_IF_UNION and
TEST_IF_STRUCT. It uses TestIfEnum, which is conditional on macro
TEST_IF_ENUM. If TEST_IF_UNION and TEST_IF_STRUCT are defined, but
TEST_IF_ENUM isn't, the generated code won't compile.
Command test-if-cmd is conditional an macros TEST_IF_CMD and
TEST_IF_STRUCT, and uses TestIfEnum. Similar issue.
Event TEST_IF_EVENT is conditional an macros TEST_IF_EVT and
TEST_IF_STRUCT, and uses TestIfEnum. Similar issue.
Replace the uses of TestIfEnum in the latter two by str.
TestIfUnion is now TestIfEnum's only user. Change TestIfEnum's
condition to TEST_IF_UNION.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-12-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message corrected]
Commit: fa32eb909524486834c85f06ebaf5b9aa3f4b11f
https://github.com/qemu/qemu/commit/fa32eb909524486834c85f06ebaf5b9aa3f4b11f
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M tests/qapi-schema/qapi-schema-test.json
M tests/qapi-schema/qapi-schema-test.out
Log Message:
-----------
tests/qapi-schema: Cover optional conditional struct member
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-13-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Commit: 713d921aed52a802c62f02dadd59da5a9f9466b1
https://github.com/qemu/qemu/commit/713d921aed52a802c62f02dadd59da5a9f9466b1
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M scripts/qapi/visit.py
Log Message:
-----------
qapi: Fix code generated for optional conditional struct member
The generated member visit neglects to emit #if around a conditional
struct member's has_ variable. For instance,
tests/qapi-schema/qapi-schema-test.json generates
#if defined(TEST_IF_STRUCT)
bool visit_type_TestIfStruct_members(Visitor *v, TestIfStruct *obj, Error
**errp)
{
---> bool has_baz = !!obj->baz;
if (!visit_type_int(v, "foo", &obj->foo, errp)) {
return false;
}
#if defined(TEST_IF_STRUCT_MEMBER)
if (!visit_type_int(v, "bar", &obj->bar, errp)) {
return false;
}
#endif /* defined(TEST_IF_STRUCT_MEMBER) */
#if defined(TEST_IF_STRUCT_MEMBER)
if (visit_optional(v, "baz", &has_baz)) {
if (!visit_type_str(v, "baz", &obj->baz, errp)) {
return false;
}
}
#endif /* defined(TEST_IF_STRUCT_MEMBER) */
return true;
}
[...]
#endif /* defined(TEST_IF_STRUCT) */
Won't compile when TEST_IF_STRUCT is defined and TEST_IF_STRUCT_MEMBER
isn't.
Fix that the obvious way:
#if defined(TEST_IF_STRUCT_MEMBER)
bool has_baz = !!obj->baz;
#endif /* defined(TEST_IF_STRUCT_MEMBER) */
Fixes: 44ea9d9be33c (qapi: Start to elide redundant has_FOO in generated C)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-14-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Commit: de3b3f529d453dfaa1f8b437c1a1f0766d8108e4
https://github.com/qemu/qemu/commit/de3b3f529d453dfaa1f8b437c1a1f0766d8108e4
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-24 (Mon, 24 Apr 2023)
Changed paths:
M docs/devel/qapi-code-gen.rst
M scripts/qapi/commands.py
M scripts/qapi/gen.py
M scripts/qapi/schema.py
A tests/qapi-schema/args-if-implicit.err
A tests/qapi-schema/args-if-implicit.json
A tests/qapi-schema/args-if-implicit.out
A tests/qapi-schema/args-if-unboxed.err
A tests/qapi-schema/args-if-unboxed.json
A tests/qapi-schema/args-if-unboxed.out
A tests/qapi-schema/event-args-if-unboxed.err
A tests/qapi-schema/event-args-if-unboxed.json
A tests/qapi-schema/event-args-if-unboxed.out
M tests/qapi-schema/meson.build
M tests/qapi-schema/qapi-schema-test.json
M tests/qapi-schema/qapi-schema-test.out
Log Message:
-----------
qapi: Require boxed for conditional command and event arguments
The C code generator fails to honor 'if' conditions of command and
event arguments.
For instance, tests/qapi-schema/qapi-schema-test.json has
{ 'event': 'TEST_IF_EVENT',
'data': { 'foo': 'TestIfStruct',
'bar': { 'type': ['str'], 'if': 'TEST_IF_EVT_ARG' } },
'if': { 'all': ['TEST_IF_EVT', 'TEST_IF_STRUCT'] } }
Generated tests/test-qapi-events.h fails to honor the TEST_IF_EVT_ARG
condition:
#if defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)
void qapi_event_send_test_if_event(TestIfStruct *foo, strList *bar);
#endif /* defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT) */
Only uses so far are in tests/.
We could fix the generator to emit something like
#if defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)
void qapi_event_send_test_if_event(TestIfStruct *foo
#if defined(TEST_IF_EVT_ARG)
, strList *bar
#endif
);
#endif /* defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT) */
Ugly. Calls become similarly ugly. Not worth fixing.
Conditional arguments work fine with 'boxed': true, simply because
complex types with conditional members work fine. Not worth breaking.
Reject conditional arguments unless boxed.
Move the tests cases covering unboxed conditional arguments out of
tests/qapi-schema/qapi-schema-test.json. Cover boxed conditional
arguments there instead.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-15-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Commit: c4d5bf99b7fccf8849316b9f5100525b1beb8237
https://github.com/qemu/qemu/commit/c4d5bf99b7fccf8849316b9f5100525b1beb8237
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/block-backend.c
Log Message:
-----------
block: make BlockBackend->quiesce_counter atomic
The main loop thread increments/decrements BlockBackend->quiesce_counter
when drained sections begin/end. The counter is read in the I/O code
path. Therefore this field is used to communicate between threads
without a lock.
Acquire/release are not necessary because the BlockBackend->in_flight
counter already uses sequentially consistent accesses and running I/O
requests hold that counter when blk_wait_while_drained() is called.
qatomic_read() can be used.
Use qatomic_fetch_inc()/qatomic_fetch_dec() for modifications even
though sequentially consistent atomic accesses are not strictly required
here. They are, however, nicer to read than multiple calls to
qatomic_read() and qatomic_set(). Since beginning and ending drain is
not a hot path the extra cost doesn't matter.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230307210427.269214-2-stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: ef80ec5067d7ca5b46e5b88be1be33cddfd33551
https://github.com/qemu/qemu/commit/ef80ec5067d7ca5b46e5b88be1be33cddfd33551
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/block-backend.c
Log Message:
-----------
block: make BlockBackend->disable_request_queuing atomic
This field is accessed by multiple threads without a lock. Use explicit
qatomic_read()/qatomic_set() calls. There is no need for acquire/release
because blk_set_disable_request_queuing() doesn't provide any
guarantees (it helps that it's used at BlockBackend creation time and
not when there is I/O in flight).
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230307210427.269214-3-stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 407ae2ae0714be309808a10997c248521b184006
https://github.com/qemu/qemu/commit/407ae2ae0714be309808a10997c248521b184006
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/block-backend.c
Log Message:
-----------
block: protect BlockBackend->queued_requests with a lock
The CoQueue API offers thread-safety via the lock argument that
qemu_co_queue_wait() and qemu_co_enter_next() take. BlockBackend
currently does not make use of the lock argument. This means that
multiple threads submitting I/O requests can corrupt the CoQueue's
QSIMPLEQ.
Add a QemuMutex and pass it to CoQueue APIs so that the queue is
protected. While we're at it, also assert that the queue is empty when
the BlockBackend is deleted.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230307210427.269214-4-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: d5eab432b0eb3edfe63a89dd1e3c5c946b92afaa
https://github.com/qemu/qemu/commit/d5eab432b0eb3edfe63a89dd1e3c5c946b92afaa
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/block-backend.c
Log Message:
-----------
block: don't acquire AioContext lock in bdrv_drain_all()
There is no need for the AioContext lock in bdrv_drain_all() because
nothing in AIO_WAIT_WHILE() needs the lock and the condition is atomic.
AIO_WAIT_WHILE_UNLOCKED() has no use for the AioContext parameter other
than performing a check that is nowadays already done by the
GLOBAL_STATE_CODE()/IO_CODE() macros. Set the ctx argument to NULL here
to help us keep track of all converted callers. Eventually all callers
will have been converted and then the argument can be dropped entirely.
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230309190855.414275-2-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: e5568a6603073884fb66e71bd133f082de763af9
https://github.com/qemu/qemu/commit/e5568a6603073884fb66e71bd133f082de763af9
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/export/export.c
Log Message:
-----------
block: convert blk_exp_close_all_type() to AIO_WAIT_WHILE_UNLOCKED()
There is no change in behavior. Switch to AIO_WAIT_WHILE_UNLOCKED()
instead of AIO_WAIT_WHILE() to document that this code has already been
audited and converted. The AioContext argument is already NULL so
aio_context_release() is never called anyway.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230309190855.414275-3-stefanha@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: d805d8a2c70d73fc5a1f29b70296e74a012e865b
https://github.com/qemu/qemu/commit/d805d8a2c70d73fc5a1f29b70296e74a012e865b
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/graph-lock.c
Log Message:
-----------
block: convert bdrv_graph_wrlock() to AIO_WAIT_WHILE_UNLOCKED()
The following conversion is safe and does not change behavior:
GLOBAL_STATE_CODE();
...
- AIO_WAIT_WHILE(qemu_get_aio_context(), ...);
+ AIO_WAIT_WHILE_UNLOCKED(NULL, ...);
Since we're in GLOBAL_STATE_CODE(), qemu_get_aio_context() is our home
thread's AioContext. Thus AIO_WAIT_WHILE() does not unlock the
AioContext:
if (ctx_ && in_aio_context_home_thread(ctx_)) { \
while ((cond)) { \
aio_poll(ctx_, true); \
waited_ = true; \
} \
And that means AIO_WAIT_WHILE_UNLOCKED(NULL, ...) can be substituted.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230309190855.414275-4-stefanha@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 263d5e12c30fa0e6916494ea5f7afc2ab129c06f
https://github.com/qemu/qemu/commit/263d5e12c30fa0e6916494ea5f7afc2ab129c06f
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/io.c
Log Message:
-----------
block: convert bdrv_drain_all_begin() to AIO_WAIT_WHILE_UNLOCKED()
Since the AioContext argument was already NULL, AIO_WAIT_WHILE() was
never going to unlock the AioContext. Therefore it is possible to
replace AIO_WAIT_WHILE() with AIO_WAIT_WHILE_UNLOCKED().
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230309190855.414275-5-stefanha@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 6bb685531aaeaf8a5bc4628856d66345b4cf7425
https://github.com/qemu/qemu/commit/6bb685531aaeaf8a5bc4628856d66345b4cf7425
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M monitor/hmp.c
Log Message:
-----------
hmp: convert handle_hmp_command() to AIO_WAIT_WHILE_UNLOCKED()
The HMP monitor runs in the main loop thread. Calling
AIO_WAIT_WHILE(qemu_get_aio_context(), ...) from the main loop thread is
equivalent to AIO_WAIT_WHILE_UNLOCKED(NULL, ...) because neither unlocks
the AioContext and the latter's assertion that we're in the main loop
succeeds.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230309190855.414275-6-stefanha@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 9612aa406e48167d64aa3f3b5714e194faadeceb
https://github.com/qemu/qemu/commit/9612aa406e48167d64aa3f3b5714e194faadeceb
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M monitor/monitor.c
Log Message:
-----------
monitor: convert monitor_cleanup() to AIO_WAIT_WHILE_UNLOCKED()
monitor_cleanup() is called from the main loop thread. Calling
AIO_WAIT_WHILE(qemu_get_aio_context(), ...) from the main loop thread is
equivalent to AIO_WAIT_WHILE_UNLOCKED(NULL, ...) because neither unlocks
the AioContext and the latter's assertion that we're in the main loop
succeeds.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230309190855.414275-7-stefanha@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 04ae220dbcde7d06b04a5bbac856f29acc3777eb
https://github.com/qemu/qemu/commit/04ae220dbcde7d06b04a5bbac856f29acc3777eb
Author: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M include/block/aio-wait.h
M include/block/block_int-common.h
Log Message:
-----------
include/block: fixup typos
Fixup a few minor typos
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Message-Id: <20230313003744.55476-1-wilfred.mallawa@opensource.wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: e95200c1c524403e42e8712c7391a8acd5825656
https://github.com/qemu/qemu/commit/e95200c1c524403e42e8712c7391a8acd5825656
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block.c
Log Message:
-----------
block: add missing coroutine_fn to bdrv_sum_allocated_file_size()
Not a coroutine_fn, you say?
static int64_t bdrv_sum_allocated_file_size(BlockDriverState *bs)
{
BdrvChild *child;
int64_t child_size, sum = 0;
QLIST_FOREACH(child, &bs->children, next) {
if (child->role & (BDRV_CHILD_DATA | BDRV_CHILD_METADATA |
BDRV_CHILD_FILTERED))
{
child_size = bdrv_co_get_allocated_file_size(child->bs);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Well what do we have here?!
I rest my case, your honor.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230308211435.346375-1-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: ab50533b6946b1adeb8eef62c6b16689abcd1e70
https://github.com/qemu/qemu/commit/ab50533b6946b1adeb8eef62c6b16689abcd1e70
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/file-posix.c
M block/linux-aio.c
M include/block/aio.h
M include/block/raw-aio.h
M include/sysemu/block-backend-io.h
Log Message:
-----------
linux-aio: use LinuxAioState from the running thread
Remove usage of aio_context_acquire by always submitting asynchronous
AIO to the current thread's LinuxAioState.
In order to prevent mistakes from the caller side, avoid passing LinuxAioState
in laio_io_{plug/unplug} and laio_co_submit, and document the functions
to make clear that they work in the current thread's AioContext.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20230203131731.851116-2-eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: a75e4e43659223bac1c94e11569547ec61d98543
https://github.com/qemu/qemu/commit/a75e4e43659223bac1c94e11569547ec61d98543
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/file-posix.c
M block/io_uring.c
M include/block/aio.h
M include/block/raw-aio.h
Log Message:
-----------
io_uring: use LuringState from the running thread
Remove usage of aio_context_acquire by always submitting asynchronous
AIO to the current thread's LuringState.
In order to prevent mistakes from the caller side, avoid passing LuringState
in luring_io_{plug/unplug} and luring_co_submit, and document the functions
to make clear that they work in the current thread's AioContext.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20230203131731.851116-3-eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 0fdb73112b6fb40af46a99e3251c340935a121ad
https://github.com/qemu/qemu/commit/0fdb73112b6fb40af46a99e3251c340935a121ad
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/file-posix.c
M block/file-win32.c
M block/qcow2-threads.c
M include/block/thread-pool.h
M util/thread-pool.c
Log Message:
-----------
thread-pool: use ThreadPool from the running thread
Use qemu_get_current_aio_context() where possible, since we always
submit work to the current thread anyways.
We want to also be sure that the thread submitting the work is
the same as the one processing the pool, to avoid adding
synchronization to the pool list.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20230203131731.851116-4-eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: aef04fc79084fe340c931679413eb6070f2f13ca
https://github.com/qemu/qemu/commit/aef04fc79084fe340c931679413eb6070f2f13ca
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M backends/tpm/tpm_backend.c
M block/file-posix.c
M block/file-win32.c
M block/qcow2-threads.c
M hw/9pfs/coth.c
M hw/ppc/spapr_nvdimm.c
M hw/virtio/virtio-pmem.c
M include/block/thread-pool.h
M scsi/pr-manager.c
M scsi/qemu-pr-helper.c
M tests/unit/test-thread-pool.c
M util/thread-pool.c
Log Message:
-----------
thread-pool: avoid passing the pool parameter every time
thread_pool_submit_aio() is always called on a pool taken from
qemu_get_current_aio_context(), and that is the only intended
use: each pool runs only in the same thread that is submitting
work to it, it can't run anywhere else.
Therefore simplify the thread_pool_submit* API and remove the
ThreadPool function parameter.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20230203131731.851116-5-eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: eab76d58462016e9fe35a51bab6917d254e82139
https://github.com/qemu/qemu/commit/eab76d58462016e9fe35a51bab6917d254e82139
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/vvfat.c
Log Message:
-----------
vvfat: mark various functions as coroutine_fn
Functions that can do I/O are prime candidates for being coroutine_fns. Make
the
change for those that are themselves called only from coroutine_fns.
In addition, coroutine_fns should do I/O using bdrv_co_*() functions, for
which it is required to hold the BlockDriverState graph lock. So also nnotate
functions on the I/O path with TSA attributes, making it possible to
switch them to use bdrv_co_*() functions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230309084456.304669-2-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 2f1fabdf4414ee86786e4d11350ad5197f1c69d0
https://github.com/qemu/qemu/commit/2f1fabdf4414ee86786e4d11350ad5197f1c69d0
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/blkdebug.c
Log Message:
-----------
blkdebug: add missing coroutine_fn annotation
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230309084456.304669-3-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 26bef102e32d93e1111c0194ff385fedde7a7111
https://github.com/qemu/qemu/commit/26bef102e32d93e1111c0194ff385fedde7a7111
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/mirror.c
Log Message:
-----------
mirror: make mirror_flush a coroutine_fn, do not use co_wrappers
mirror_flush calls a mixed function blk_flush but it is only called
from mirror_run; so call the coroutine version and make mirror_flush
a coroutine_fn too.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230309084456.304669-4-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: d2223cddce0efaf93b31c782b2651583799d447e
https://github.com/qemu/qemu/commit/d2223cddce0efaf93b31c782b2651583799d447e
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M nbd/server.c
Log Message:
-----------
nbd: mark more coroutine_fns, do not use co_wrappers
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: c3b21fb1896d40cf44dc1aaa65dc2c166fcfa696
https://github.com/qemu/qemu/commit/c3b21fb1896d40cf44dc1aaa65dc2c166fcfa696
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M hw/9pfs/9p.h
M hw/9pfs/codir.c
Log Message:
-----------
9pfs: mark more coroutine_fns
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230309084456.304669-6-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 70bd77bea50b08362d66b634e9c66739dfddd949
https://github.com/qemu/qemu/commit/70bd77bea50b08362d66b634e9c66739dfddd949
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M scsi/qemu-pr-helper.c
Log Message:
-----------
qemu-pr-helper: mark more coroutine_fns
do_sgio can suspend via the coroutine function thread_pool_submit_co, so it
has to be coroutine_fn as well---and the same is true of all its direct and
indirect callers.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230309084456.304669-7-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 10bf10a8e30663ba59ad31918eaa0b9ee3885fac
https://github.com/qemu/qemu/commit/10bf10a8e30663ba59ad31918eaa0b9ee3885fac
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M tests/unit/test-thread-pool.c
Log Message:
-----------
tests: mark more coroutine_fns
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230309084456.304669-8-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: a39bae4ecd61e9c62c7759ff41b00efbb39de46e
https://github.com/qemu/qemu/commit/a39bae4ecd61e9c62c7759ff41b00efbb39de46e
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/qcow2-bitmap.c
M block/qcow2-cluster.c
M block/qcow2-refcount.c
M block/qcow2-snapshot.c
M block/qcow2.c
M block/qcow2.h
Log Message:
-----------
qcow2: mark various functions as coroutine_fn and GRAPH_RDLOCK
Functions that can do I/O (including calling bdrv_is_allocated
and bdrv_block_status functions) are prime candidates for being
coroutine_fns. Make the change for those that are themselves called
only from coroutine_fns. Also annotate that they are called with the
graph rdlock taken, thus allowing them to call bdrv_co_*() functions
for I/O.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230309084456.304669-9-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 5a5a9fdd15622bf5087e93115e5d787317df0ecb
https://github.com/qemu/qemu/commit/5a5a9fdd15622bf5087e93115e5d787317df0ecb
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/vmdk.c
Log Message:
-----------
vmdk: make vmdk_is_cid_valid a coroutine_fn
Functions that can do I/O are prime candidates for being coroutine_fns. Make
the
change for the one that is itself called only from coroutine_fns. Unfortunately
vmdk does not use a coroutine_fn for the bulk of the open (like qcow2 does) so
vmdk_read_cid cannot have the same treatment.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230309084456.304669-10-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 8c1e8fb2e7fc2cbeb57703e143965a4cd3ad301a
https://github.com/qemu/qemu/commit/8c1e8fb2e7fc2cbeb57703e143965a4cd3ad301a
Author: Wang Liang <wangliangzz@inspur.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M block/monitor/block-hmp-cmds.c
Log Message:
-----------
block/monitor: Fix crash when executing HMP commit
hmp_commit() calls blk_is_available() from a non-coroutine context (and
in the main loop). blk_is_available() is a co_wrapper_mixed_bdrv_rdlock
function, and in the non-coroutine context it calls AIO_WAIT_WHILE(),
which crashes if the aio_context lock is not taken before.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1615
Signed-off-by: Wang Liang <wangliangzz@inspur.com>
Message-Id: <20230424103902.45265-1-wangliangzz@126.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 7ce54db23048bfcc3ea6821525bf333b715c7655
https://github.com/qemu/qemu/commit/7ce54db23048bfcc3ea6821525bf333b715c7655
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
M tests/qapi-schema/test-qapi.py
Log Message:
-----------
qapi: support updating expected test output via make
It is possible to pass --update to tests/qapi-schema/test-qapi.py
to make it update the output files on error. This is inconvenient
to achieve though when test-qapi.py is run indirectly by make/meson.
Instead simply allow for an env variable to be set:
$ QAPI_TEST_UPDATE= make check-qapi-schema
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230420102619.348173-2-berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Commit: 1e148b545fccc2a83a57269849de9a21e11c17da
https://github.com/qemu/qemu/commit/1e148b545fccc2a83a57269849de9a21e11c17da
Author: Markus Armbruster <armbru@redhat.com>
Date: 2023-04-26 (Wed, 26 Apr 2023)
Changed paths:
M scripts/qapi/schema.py
Log Message:
-----------
qapi: Improve specificity of type/member descriptions
Error messages describe object members, enumeration values, features,
and variants like ROLE 'NAME', where ROLE is "member", "value",
"feature", or "branch", respectively. When the member is defined in
another type, e.g. inherited from a base type, we add "of type
'TYPE'". Example: test case struct-base-clash-deep reports a member
of type 'Sub' clashing with a member of its base type 'Base' as
struct-base-clash-deep.json: In struct 'Sub':
struct-base-clash-deep.json:10: member 'name' collides with member 'name'
of type 'Base'
Members of implicitly defined types need special treatment. We don't
want to add "of type 'TYPE'" for them, because their named are made up
and mean nothing to the user. Instead, we describe members of an
implicitly defined base type as "base member 'NAME'", and command and
event parameters as "parameter 'NAME'". Example: test case
union-bad-base reports member of a variant's type clashing with a
member of its implicitly defined base type as
union-bad-base.json: In union 'TestUnion':
union-bad-base.json:8: member 'string' of type 'TestTypeA' collides with
base member 'string'
The next commit will permit unions as variant types. "base member
'NAME' would then be ambigious: is it the union's base, or is it the
union's variant's base? One of its test cases would report a clash
between two such bases as "base member 'type' collides with base
member 'type'". Confusing.
Refine the special treatment: add "of TYPE" even for implicitly
defined types, but massage TYPE and ROLE so they make sense for the
user.
Message-Id: <20230420102619.348173-3-berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Commit: a17dbc4b79a28ffb9511f192474ffefd88214cde
https://github.com/qemu/qemu/commit/a17dbc4b79a28ffb9511f192474ffefd88214cde
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: 2023-04-26 (Wed, 26 Apr 2023)
Changed paths:
M scripts/qapi/schema.py
M tests/qapi-schema/meson.build
M tests/qapi-schema/qapi-schema-test.json
M tests/qapi-schema/qapi-schema-test.out
A tests/qapi-schema/union-invalid-union-subfield.err
A tests/qapi-schema/union-invalid-union-subfield.json
A tests/qapi-schema/union-invalid-union-subfield.out
A tests/qapi-schema/union-invalid-union-subtype.err
A tests/qapi-schema/union-invalid-union-subtype.json
A tests/qapi-schema/union-invalid-union-subtype.out
M tests/unit/test-qobject-input-visitor.c
M tests/unit/test-qobject-output-visitor.c
Log Message:
-----------
qapi: allow unions to contain further unions
This extends the QAPI schema validation to permit unions inside unions,
provided the checks for clashing fields pass.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230420102619.348173-4-berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Commit: 4d1467a5683c8c91ab89d56a13c82c0a87bbbca5
https://github.com/qemu/qemu/commit/4d1467a5683c8c91ab89d56a13c82c0a87bbbca5
Author: Richard Henderson <richard.henderson@linaro.org>
Date: 2023-04-26 (Wed, 26 Apr 2023)
Changed paths:
M backends/tpm/tpm_backend.c
M block.c
M block/blkdebug.c
M block/block-backend.c
M block/export/export.c
M block/file-posix.c
M block/file-win32.c
M block/graph-lock.c
M block/io.c
M block/io_uring.c
M block/linux-aio.c
M block/mirror.c
M block/monitor/block-hmp-cmds.c
M block/qcow2-bitmap.c
M block/qcow2-cluster.c
M block/qcow2-refcount.c
M block/qcow2-snapshot.c
M block/qcow2-threads.c
M block/qcow2.c
M block/qcow2.h
M block/vmdk.c
M block/vvfat.c
M hw/9pfs/9p.h
M hw/9pfs/codir.c
M hw/9pfs/coth.c
M hw/ppc/spapr_nvdimm.c
M hw/virtio/virtio-pmem.c
M include/block/aio-wait.h
M include/block/aio.h
M include/block/block_int-common.h
M include/block/raw-aio.h
M include/block/thread-pool.h
M include/sysemu/block-backend-io.h
M monitor/hmp.c
M monitor/monitor.c
M nbd/server.c
M scsi/pr-manager.c
M scsi/qemu-pr-helper.c
M tests/unit/test-thread-pool.c
M util/thread-pool.c
Log Message:
-----------
Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging
Block layer patches
- Protect BlockBackend.queued_requests with its own lock
- Switch to AIO_WAIT_WHILE_UNLOCKED() where possible
- AioContext removal: LinuxAioState/LuringState/ThreadPool
- Add more coroutine_fn annotations, use bdrv/blk_co_*
- Fix crash when execute hmp_commit
# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmRH0b0RHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9Y0yw/6A/vzA4TGgFUP3WIvH/sQri4/V3gyR+PT
# u3hOQUCYZ99nioTpKV91TSuUPuU/Mdspy/0NKM+K92yIXqxa9172A2zLOsGOu21l
# qKpse+nBf1zqEgB8YzUHyCBdetPz916C/f9RS26SNUCW85GCHYGHA3u7nKvWLMyV
# oKIoTlA8QOglOuEKlRoYh7hCFm7ET51NOSEftm8GsYbsW/I2Vzl8a1SHN1lHufjd
# We3+898zUrmFqNMp6Rjdhn+yZmmoGzoZqV4YQi83z7xjiv+Ms4VHVVW7X8d20xRX
# 5BLFiLHAuZ/1d26HyVhgBUr7KHyf94odocz8BylWKXGl5SXMCZun1Td1vgVKlGK+
# GRxzB2cWGWqzC2UmqSTc0Z0aIWbXukKwvcX76uBKsQZ+kB2A7jFobxHiaoQEDJ8B
# WRNEMH2+CqCAu9rsrNRinnJKhT2nXcr9F9YfwRIlagdAePGWin+EUW8huf14dDBm
# Z2Y34aKW4RQibF8xirMHeRBbOLmcq2VpKLKwNfBHUDgZB8iuD7bLn4n9nwWXMG1w
# zgNsTybkv46vLPamTpEaUoNTHfuRDTAuE7Z7lkcc7jF41Z0V1DC/DCCWcL/0LvhP
# GIxFdkYug3hetdF2U/OZhUoEfxvkqcuBnrr55LFzqheKEllQpPwPpt7UF0aH8bg3
# i/YpjHsf3xU=
# =mpYX
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 25 Apr 2023 02:12:29 PM BST
# gpg: using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg: issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
* tag 'for-upstream' of https://repo.or.cz/qemu/kevin: (25 commits)
block/monitor: Fix crash when executing HMP commit
vmdk: make vmdk_is_cid_valid a coroutine_fn
qcow2: mark various functions as coroutine_fn and GRAPH_RDLOCK
tests: mark more coroutine_fns
qemu-pr-helper: mark more coroutine_fns
9pfs: mark more coroutine_fns
nbd: mark more coroutine_fns, do not use co_wrappers
mirror: make mirror_flush a coroutine_fn, do not use co_wrappers
blkdebug: add missing coroutine_fn annotation
vvfat: mark various functions as coroutine_fn
thread-pool: avoid passing the pool parameter every time
thread-pool: use ThreadPool from the running thread
io_uring: use LuringState from the running thread
linux-aio: use LinuxAioState from the running thread
block: add missing coroutine_fn to bdrv_sum_allocated_file_size()
include/block: fixup typos
monitor: convert monitor_cleanup() to AIO_WAIT_WHILE_UNLOCKED()
hmp: convert handle_hmp_command() to AIO_WAIT_WHILE_UNLOCKED()
block: convert bdrv_drain_all_begin() to AIO_WAIT_WHILE_UNLOCKED()
block: convert bdrv_graph_wrlock() to AIO_WAIT_WHILE_UNLOCKED()
...
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Commit: c3f9aa8e488db330197c9217e38555f6772e8f07
https://github.com/qemu/qemu/commit/c3f9aa8e488db330197c9217e38555f6772e8f07
Author: Richard Henderson <richard.henderson@linaro.org>
Date: 2023-04-26 (Wed, 26 Apr 2023)
Changed paths:
M docs/devel/qapi-code-gen.rst
M scripts/qapi/commands.py
M scripts/qapi/expr.py
M scripts/qapi/gen.py
M scripts/qapi/main.py
M scripts/qapi/schema.py
M scripts/qapi/visit.py
A tests/qapi-schema/args-if-implicit.err
A tests/qapi-schema/args-if-implicit.json
A tests/qapi-schema/args-if-implicit.out
A tests/qapi-schema/args-if-unboxed.err
A tests/qapi-schema/args-if-unboxed.json
A tests/qapi-schema/args-if-unboxed.out
M tests/qapi-schema/bad-data.err
A tests/qapi-schema/event-args-if-unboxed.err
A tests/qapi-schema/event-args-if-unboxed.json
A tests/qapi-schema/event-args-if-unboxed.out
M tests/qapi-schema/event-nest-struct.err
M tests/qapi-schema/meson.build
M tests/qapi-schema/nested-struct-data.err
M tests/qapi-schema/qapi-schema-test.json
M tests/qapi-schema/qapi-schema-test.out
M tests/qapi-schema/returns-dict.err
A tests/qapi-schema/struct-data-typename.err
A tests/qapi-schema/struct-data-typename.json
A tests/qapi-schema/struct-data-typename.out
M tests/qapi-schema/struct-member-invalid.err
M tests/qapi-schema/test-qapi.py
M tests/qapi-schema/union-array-branch.err
M tests/qapi-schema/union-invalid-discriminator.err
M tests/qapi-schema/union-invalid-discriminator.json
A tests/qapi-schema/union-invalid-union-subfield.err
A tests/qapi-schema/union-invalid-union-subfield.json
A tests/qapi-schema/union-invalid-union-subfield.out
A tests/qapi-schema/union-invalid-union-subtype.err
A tests/qapi-schema/union-invalid-union-subtype.json
A tests/qapi-schema/union-invalid-union-subtype.out
M tests/unit/test-qobject-input-visitor.c
M tests/unit/test-qobject-output-visitor.c
Log Message:
-----------
Merge tag 'pull-qapi-2023-04-26' of https://repo.or.cz/qemu/armbru into
staging
QAPI patches patches for 2023-04-26
# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmRIvOkSHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZTX3MQAIqrKQbOzQ81/cDZ7aeLOroDoGYf1Cs0
# 0NiEVlyoblWNzL3HraGgXiNRTP+zaG/TcFKza1nz8qjdkxWxBjdbfF5Lm6mQf5Zo
# tcHUjksmnUlPkLYSOyEjfY9SNvcS6g7djE/NF5lbJtzYGZScZpLarELR7oUvrcXR
# AEiw8N5FZXp+j6cTeWvrLzSqz9qBsFJUCGcGER0T/Mt5MlUwDexE1xe7g8oD5l+b
# s0jeQr1PTZm5k6ehajQtgbHvAkgH8xVTKqbB/U5iz4VhYriH+IPEOtfCFt6/1soz
# pVkYikJpazCvQMjqnWu9dE1onthgSsEIOV29kFU0Kr8ATZuJBQMuLVp4hSsbKANj
# BUVyL2/fUsIp7gd+KikXUOjKYajxek6Q2YLAPpL+1pBCTql/PBQ7td8CECdiv/9e
# Xh50q+BGvyEiyoyf4EEpaLXUZog605WHEaODj9uPtNHJP9x6Rqt93FUsdWUtt/k9
# hJ8RSKy8njr0vxGoJkj89m2XfCwtuX3VQ5IXvv/If4U5Y4+JhcLtiqW+Njh8fAM4
# ZwIrlUYG7inLUKFVcQ3sEGpaj611i5ixIxctUvEiggZX+fPeSFKYUr+Rq8WXM8gv
# suLXz7VF6H4Sw30lCvdQ4LSungbzlYAtQYpmdEQGoM8iasIi4PoDf0cTYBbMYHDX
# +pZvWC50cVtf
# =wLx6
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 26 Apr 2023 06:55:53 AM BST
# gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg: issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [undefined]
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653
* tag 'pull-qapi-2023-04-26' of https://repo.or.cz/qemu/armbru:
qapi: allow unions to contain further unions
qapi: Improve specificity of type/member descriptions
qapi: support updating expected test output via make
qapi: Require boxed for conditional command and event arguments
qapi: Fix code generated for optional conditional struct member
tests/qapi-schema: Cover optional conditional struct member
tests/qapi-schema: Clean up positive test for conditionals
tests/qapi-schema: Rename a few conditionals
tests/qapi-schema: Improve union discriminator coverage
qapi: Fix to reject 'data': 'mumble' in struct
qapi: Fix error message when type name or array is expected
qapi: Simplify code a bit after previous commits
qapi: Improve error message for unexpected array types
qapi: Split up check_type()
qapi: Clean up after removal of simple unions
qapi/schema: Use super()
qapi: Fix error message format regression
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Compare: https://github.com/qemu/qemu/compare/a14b8206c5ed...c3f9aa8e488d
- [Qemu-commits] [qemu/qemu] bc5d30: qapi: Fix error message format regression,
Richard Henderson <=