<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/include/qapi, branch master</title>
<subtitle>QEMU development tree</subtitle>
<id>https://git.zx2c4.com/qemu/atom/include/qapi?h=master</id>
<link rel='self' href='https://git.zx2c4.com/qemu/atom/include/qapi?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/'/>
<updated>2024-08-09T16:37:54Z</updated>
<entry>
<title>include: Fix typo in name of MAKE_IDENTFIER macro</title>
<updated>2024-08-09T16:37:54Z</updated>
<author>
<name>Peter Maydell</name>
<email>peter.maydell@linaro.org</email>
</author>
<published>2024-08-09T16:37:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=05548400327db52d8f98eb033002fd2baadc3706'/>
<id>urn:sha1:05548400327db52d8f98eb033002fd2baadc3706</id>
<content type='text'>
In commit bb71846325e23 we added some macro magic to avoid
variable-shadowing when using some of our more complicated
macros. One of the internal components of this is a macro
named MAKE_IDENTFIER. Fix the typo in its name: it should
be MAKE_IDENTIFIER.

Commit created with
 sed -i -e 's/MAKE_IDENTFIER/MAKE_IDENTIFIER/g' include/qemu/*.h include/qapi/qmp/qobject.h

Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Message-id: 20240801102516.3843780-1-peter.maydell@linaro.org
</content>
</entry>
<entry>
<title>include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()</title>
<updated>2024-06-28T12:44:52Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2024-06-25T11:12:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=eb350d1d01d9b9df0ce174e2e1681699b071bab3'/>
<id>urn:sha1:eb350d1d01d9b9df0ce174e2e1681699b071bab3</id>
<content type='text'>
The typeof_strip_qual() is most useful for the atomic fetch-and-modify
operations in atomic.h, but it can be used elsewhere as well.  For example,
QAPI_LIST_LENGTH() assumes that the argument is not const, which is not a
requirement.

Move the macro to compiler.h and, while at it, move it under #ifndef
__cplusplus to emphasize that it uses C-only constructs.  A C++ version
of typeof_strip_qual() using type traits is possible[1], but beyond the
scope of this patch because the little C++ code that is in QEMU does not
use QAPI.

The patch was tested by changing the declaration of strv_from_str_list()
in qapi/qapi-type-helpers.c to:

    char **strv_from_str_list(const strList *const list)

This is valid C code, and it fails to compile without this change.

[1] https://lore.kernel.org/qemu-devel/20240624205647.112034-1-flwu@google.com/

Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Reviewed-by: Manos Pitsidianakis &lt;manos.pitsidianakis@linaro.org&gt;
Tested-by: Manos Pitsidianakis &lt;manos.pitsidianakis@linaro.org&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>qapi: Do not cast function pointers</title>
<updated>2024-05-29T10:41:56Z</updated>
<author>
<name>Akihiko Odaki</name>
<email>akihiko.odaki@daynix.com</email>
</author>
<published>2024-05-24T05:35:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=b04091393e6a71065aee6c91b2566f2dec95a4c9'/>
<id>urn:sha1:b04091393e6a71065aee6c91b2566f2dec95a4c9</id>
<content type='text'>
Using -fsanitize=undefined with Clang v18 causes an error if function
pointers are casted:

 qapi/qapi-clone-visitor.c:188:5: runtime error: call to function visit_type_SocketAddress through pointer to incorrect function type 'bool (*)(struct Visitor *, const char *, void **, struct Error **)'
 /tmp/qemu-ubsan/qapi/qapi-visit-sockets.c:487: note: visit_type_SocketAddress defined here
     #0 0x5642aa2f7f3b in qapi_clone qapi/qapi-clone-visitor.c:188:5
     #1 0x5642aa2c8ce5 in qio_channel_socket_listen_async io/channel-socket.c:285:18
     #2 0x5642aa2b8903 in test_io_channel_setup_async tests/unit/test-io-channel-socket.c:116:5
     #3 0x5642aa2b8204 in test_io_channel tests/unit/test-io-channel-socket.c:179:9
     #4 0x5642aa2b8129 in test_io_channel_ipv4 tests/unit/test-io-channel-socket.c:323:5
     ...

It also prevents enabling the strict mode of CFI which is currently
disabled with -fsanitize-cfi-icall-generalize-pointers.

The problematic casts are necessary to pass visit_type_T() and
visit_type_T_members() as callbacks to qapi_clone() and qapi_clone_members(),
respectively. Open-code these two functions to avoid the callbacks, and
thus the type casts.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2346
Signed-off-by: Akihiko Odaki &lt;akihiko.odaki@daynix.com&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20240524-xkb-v4-3-2de564e5c859@daynix.com&gt;
[thuth: Improve commit message according to Markus' suggestions]
Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
</content>
</entry>
<entry>
<title>qerror: QERR_QGA_COMMAND_FAILED is no longer used, drop</title>
<updated>2024-05-27T11:00:12Z</updated>
<author>
<name>Markus Armbruster</name>
<email>armbru@redhat.com</email>
</author>
<published>2024-05-14T10:58:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=2020337239b054447d0756ea75e970b35f7a541b'/>
<id>urn:sha1:2020337239b054447d0756ea75e970b35f7a541b</id>
<content type='text'>
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20240514105829.729342-4-armbru@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Konstantin Kostiuk &lt;kkostiuk@redhat.com&gt;
</content>
</entry>
<entry>
<title>qerror: QERR_IO_ERROR is no longer used, drop</title>
<updated>2024-05-27T10:53:29Z</updated>
<author>
<name>Markus Armbruster</name>
<email>armbru@redhat.com</email>
</author>
<published>2024-05-13T14:17:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=5b957bf6d378cfa0c196b2be119449e086647612'/>
<id>urn:sha1:5b957bf6d378cfa0c196b2be119449e086647612</id>
<content type='text'>
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20240513141703.549874-7-armbru@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
</content>
</entry>
<entry>
<title>qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition</title>
<updated>2024-04-24T07:50:58Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-03-12T14:13:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=be842efbe3102c6aa1980039f6d4a8f997f1ff8c'/>
<id>urn:sha1:be842efbe3102c6aa1980039f6d4a8f997f1ff8c</id>
<content type='text'>
Address the comment added in commit 4629ed1e98
("qerror: Finally unused, clean up"), from 2015:

  /*
   * These macros will go away, please don't use
   * in new code, and do not add new ones!
   */

Manual change. Remove the definition in
include/qapi/qmp/qerror.h.

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20240312141343.3168265-11-armbru@redhat.com&gt;
Reviewed-by: Zhao Liu &lt;zhao1.liu@intel.com&gt;
</content>
</entry>
<entry>
<title>qapi: Inline and remove QERR_MIGRATION_ACTIVE definition</title>
<updated>2024-04-24T07:50:58Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-03-12T14:13:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=005807860d3e1498ee591223db38f90d2c736165'/>
<id>urn:sha1:005807860d3e1498ee591223db38f90d2c736165</id>
<content type='text'>
Address the comment added in commit 4629ed1e98
("qerror: Finally unused, clean up"), from 2015:

  /*
   * These macros will go away, please don't use
   * in new code, and do not add new ones!
   */

Mechanical transformation using sed, manually
removing the definition in include/qapi/qmp/qerror.h.

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Juan Quintela &lt;quintela@redhat.com&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20240312141343.3168265-10-armbru@redhat.com&gt;
Reviewed-by: Zhao Liu &lt;zhao1.liu@intel.com&gt;
[Straightforward conflict with commit aeaafb1e59f (migration: export
migration_is_running) resolved]
</content>
</entry>
<entry>
<title>qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE definition</title>
<updated>2024-04-24T07:50:58Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-03-12T14:13:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=ef929281f1ddb1ce74f5fe39377a88e6cc8237aa'/>
<id>urn:sha1:ef929281f1ddb1ce74f5fe39377a88e6cc8237aa</id>
<content type='text'>
Address the comment added in commit 4629ed1e98
("qerror: Finally unused, clean up"), from 2015:

  /*
   * These macros will go away, please don't use
   * in new code, and do not add new ones!
   */

Manual changes (escaping the format in qapi/visit.py).

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20240312141343.3168265-8-armbru@redhat.com&gt;
Reviewed-by: Zhao Liu &lt;zhao1.liu@intel.com&gt;
</content>
</entry>
<entry>
<title>qapi: Inline and remove QERR_INVALID_PARAMETER definition</title>
<updated>2024-04-24T07:50:58Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-03-12T14:13:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=c6f5d406e1ace1e3d7697e085024a3c7b93d6db5'/>
<id>urn:sha1:c6f5d406e1ace1e3d7697e085024a3c7b93d6db5</id>
<content type='text'>
Address the comment added in commit 4629ed1e98
("qerror: Finally unused, clean up"), from 2015:

  /*
   * These macros will go away, please don't use
   * in new code, and do not add new ones!
   */

Mechanical transformation using:

  $ sed -i -e "s/QERR_INVALID_PARAMETER,/\"Invalid parameter '%s'\",/" \
    $(git grep -lw QERR_INVALID_PARAMETER)

Manually simplify qemu_opts_create(), and remove the macro definition
in include/qapi/qmp/qerror.h.

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20240312141343.3168265-6-armbru@redhat.com&gt;
</content>
</entry>
<entry>
<title>qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition</title>
<updated>2024-04-24T07:50:58Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-03-12T14:13:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=f95b25c37e34d575346fb171b2f59c162bbefb38'/>
<id>urn:sha1:f95b25c37e34d575346fb171b2f59c162bbefb38</id>
<content type='text'>
Address the comment added in commit 4629ed1e98
("qerror: Finally unused, clean up"), from 2015:

  /*
   * These macros will go away, please don't use
   * in new code, and do not add new ones!
   */

Mechanical transformation using sed, and manual cleanup.

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20240312141343.3168265-5-armbru@redhat.com&gt;
</content>
</entry>
</feed>
