#
407bc4bf |
| 18-Nov-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
qapi: Move include/qapi/qmp/ to include/qobject/
The general expectation is that header files should follow the same file/path naming scheme as the corresponding source file. There are various histo
qapi: Move include/qapi/qmp/ to include/qobject/
The general expectation is that header files should follow the same file/path naming scheme as the corresponding source file. There are various historical exceptions to this practice in QEMU, with one of the most notable being the include/qapi/qmp/ directory. Most of the headers there correspond to source files in qobject/.
This patch corrects most of that inconsistency by creating include/qobject/ and moving the headers for qobject/ there.
This also fixes MAINTAINERS for include/qapi/qmp/dispatch.h: scripts/get_maintainer.pl now reports "QAPI" instead of "No maintainers found".
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Acked-by: Halil Pasic <pasic@linux.ibm.com> #s390x Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241118151235.2665921-2-armbru@redhat.com> [Rebased]
show more ...
|
#
d709bbf3 |
| 23-Mar-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
include/qapi: add g_autoptr support for qobject types
Need wrappers for qobject_unref() calls, which is a macro.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus A
include/qapi: add g_autoptr support for qobject types
Need wrappers for qobject_unref() calls, which is a macro.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323155743.1585078-10-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
4ac76ba4 |
| 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
qobject: Make QString immutable
The functions to modify a QString's string are all unused now. Drop them, and make the string immutable. Saves 16 bytes per QString on my system.
Signed-off-by: Ma
qobject: Make QString immutable
The functions to modify a QString's string are all unused now. Drop them, and make the string immutable. Saves 16 bytes per QString on my system.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-21-armbru@redhat.com>
show more ...
|
#
b3119b08 |
| 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
qobject: Drop qstring_get_try_str()
No users left outside tests/, and the ones in tests/ can just as well use qstring_get_str(). Do that, and drop the function.
Signed-off-by: Markus Armbruster <a
qobject: Drop qstring_get_try_str()
No users left outside tests/, and the ones in tests/ can just as well use qstring_get_str(). Do that, and drop the function.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-14-armbru@redhat.com>
show more ...
|
#
808ac365 |
| 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
qobject: Drop qobject_get_try_str()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-13-armbru@redhat.com>
|
#
80d71121 |
| 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
qobject: Move internals to qobject-internal.h
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-9-armbru@redhat.com>
|
#
88e25b1e |
| 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
Revert "qstring: add qstring_free()"
This reverts commit 164c374b75f87c6765a705c4418ab7005a2d356f.
A free function for a reference-counted object is in bad taste. Fortunately, this one is now also
Revert "qstring: add qstring_free()"
This reverts commit 164c374b75f87c6765a705c4418ab7005a2d356f.
A free function for a reference-counted object is in bad taste. Fortunately, this one is now also unused. Drop it.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-7-armbru@redhat.com>
show more ...
|
#
f1cc129d |
| 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
qobject: Use GString instead of QString to accumulate JSON
QString supports modifying its string, but it's quite limited: you can only append. The remaining callers use it for building an initial s
qobject: Use GString instead of QString to accumulate JSON
QString supports modifying its string, but it's quite limited: you can only append. The remaining callers use it for building an initial string, never for modifying it later.
Use of GString for building the initial string is actually more convenient here. Change qobject_to_json() & friends to do that.
Once all such uses are replaced this way, QString can become immutable.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-5-armbru@redhat.com>
show more ...
|
#
164c374b |
| 10-Jan-2020 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qstring: add qstring_free()
Similar to g_string_free(), optionally return the underlying char*.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-10
qstring: add qstring_free()
Similar to g_string_free(), optionally return the underlying char*.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-10-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
ad63c549 |
| 24-Jul-2018 |
liujunjie <liujunjie23@huawei.com> |
qstring: Fix qstring_from_substr() not to provoke int overflow
qstring_from_substr() parameters @start and @end are of type int. blkdebug_parse_filename(), blkverify_parse_filename(), nbd_parse_uri(
qstring: Fix qstring_from_substr() not to provoke int overflow
qstring_from_substr() parameters @start and @end are of type int. blkdebug_parse_filename(), blkverify_parse_filename(), nbd_parse_uri(), and qstring_from_str() pass @end values of type size_t or ptrdiff_t. Values exceeding INT_MAX get truncated, with possibly disastrous results.
Such huge substrings seem unlikely, but we found one in a core dump, where "info tlb" executed via QMP's human-monitor-command apparently produced 35 GiB of output.
Fix by changing the parameters size_t.
Signed-off-by: liujunjie <liujunjie23@huawei.com> Message-Id: <20180724134339.17832-1-liujunjie23@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
3d3eacae |
| 19-Apr-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qobject: use a QObjectBase_ struct
By moving the base fields to a QObjectBase_, QObject can be a type which also has a 'base' field. This allows writing a generic QOBJECT() macro that will work with
qobject: use a QObjectBase_ struct
By moving the base fields to a QObjectBase_, QObject can be a type which also has a 'base' field. This allows writing a generic QOBJECT() macro that will work with any QObject type, including QObject itself. The container_of() macro ensures that the object to cast has a QObjectBase_ base field, giving some type safety guarantees. QObject must have no members but QObjectBase_ base, or else QOBJECT() breaks.
QObjectBase_ is not a typedef and uses a trailing underscore to make it obvious it is not for normal use and to avoid potential abuse.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180419150145.24795-3-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
b26ae1cb |
| 09-Mar-2018 |
Peter Xu <peterx@redhat.com> |
qobject: introduce qobject_get_try_str()
A quick way to fetch string from qobject when it's a QString.
Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Si
qobject: introduce qobject_get_try_str()
A quick way to fetch string from qobject when it's a QString.
Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-4-peterx@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: rebase to qobject_to() macro] Signed-off-by: Eric Blake <eblake@redhat.com>
show more ...
|
#
77593202 |
| 09-Mar-2018 |
Peter Xu <peterx@redhat.com> |
qobject: introduce qstring_get_try_str()
The only difference from qstring_get_str() is that it allows the qstring to be NULL. If so, NULL is returned.
CC: Eric Blake <eblake@redhat.com> CC: Markus
qobject: introduce qstring_get_try_str()
The only difference from qstring_get_str() is that it allows the qstring to be NULL. If so, NULL is returned.
CC: Eric Blake <eblake@redhat.com> CC: Markus Armbruster <armbru@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-3-peterx@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
show more ...
|
#
cb51b976 |
| 24-Feb-2018 |
Max Reitz <mreitz@redhat.com> |
qapi: Remove qobject_to_X() functions
They are no longer needed now.
Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20180224154033.29559-5-
qapi: Remove qobject_to_X() functions
They are no longer needed now.
Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20180224154033.29559-5-mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
show more ...
|
#
9f5c734d |
| 01-Feb-2018 |
Markus Armbruster <armbru@redhat.com> |
Typedef the subtypes of QObject in qemu/typedefs.h, too
This renders many inclusions of qapi/qmp/q*.h superfluous. They'll be dropped in the next few commits.
Reviewed-by: Eric Blake <eblake@redha
Typedef the subtypes of QObject in qemu/typedefs.h, too
This renders many inclusions of qapi/qmp/q*.h superfluous. They'll be dropped in the next few commits.
Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-8-armbru@redhat.com>
show more ...
|
#
b38dd678 |
| 14-Nov-2017 |
Max Reitz <mreitz@redhat.com> |
qapi: Add qobject_is_equal()
This generic function (along with its implementations for different types) determines whether two QObjects are equal.
Signed-off-by: Max Reitz <mreitz@redhat.com> Revie
qapi: Add qobject_is_equal()
This generic function (along with its implementations for different types) determines whether two QObjects are equal.
Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 20171114180128.17076-4-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
90ce6e26 |
| 23-Feb-2016 |
Peter Maydell <peter.maydell@linaro.org> |
include: Clean up includes
Clean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
NB: If t
include: Clean up includes
Clean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
NB: If this commit breaks compilation for your out-of-tree patchseries or fork, then you need to make sure you add #include "qemu/osdep.h" to any new .c files that you have.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
#
55e1819c |
| 02-Dec-2015 |
Eric Blake <eblake@redhat.com> |
qobject: Simplify QObject
The QObject hierarchy is small enough, and unlikely to grow further (since we only use it to map to JSON and already cover all JSON types), that we can simplify things by n
qobject: Simplify QObject
The QObject hierarchy is small enough, and unlikely to grow further (since we only use it to map to JSON and already cover all JSON types), that we can simplify things by not tracking a separate vtable, but just inline the code element of the vtable QType directly into QObject (renamed to type), and track a separate array of destroy functions. We can drop qnull_destroy_obj() in the process.
The remaining QObject subclasses must export their destructor.
This also has the nice benefit of moving the typename 'QType' out of the way, so that the next patch can repurpose it for a nicer name for 'qtype_code'.
The various objects are still the same size (so no change in cache line pressure), but now have less indirection (although I didn't bother benchmarking to see if there is a noticeable speedup, as we don't have hard evidence that this was in a performance hotspot in the first place).
A future patch could drop the refcnt size to 32 bits for a smaller struct on 64-bit architectures, if desired (we have limits on the largest JSON that we are willing to parse, and will probably never need to take full advantage of a 64-bit refcnt).
Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-2-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
c7c46212 |
| 15-Oct-2015 |
Markus Armbruster <armbru@redhat.com> |
qobject: Drop QObject_HEAD
QObject_HEAD is a macro expanding into the common part of structs that are sub-types of QObject. It's always been just QObject base, and unlikely to change. Drop the mac
qobject: Drop QObject_HEAD
QObject_HEAD is a macro expanding into the common part of structs that are sub-types of QObject. It's always been just QObject base, and unlikely to change. Drop the macro, because the code is clearer with out it.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1444918537-18107-2-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
show more ...
|
#
54d49ac9 |
| 25-Mar-2013 |
Luiz Capitulino <lcapitulino@redhat.com> |
qstring: add qstring_get_length()
Long overdue.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
#
7b1b5d19 |
| 17-Dec-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
qapi: move include files to include/qobject/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
41836a9f |
| 12-May-2010 |
Luiz Capitulino <lcapitulino@redhat.com> |
Fix qtypes' licenses
- Change from GPL to LGPL - Add license text when missing - Minor cosmetic changes to make all headers look the same
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
|
#
4b5c5766 |
| 19-Nov-2009 |
Luiz Capitulino <lcapitulino@redhat.com> |
QString: Introduce qstring_from_substr()
Note that we can now write qstring_from_str() as a wrapper.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori
QString: Introduce qstring_from_substr()
Note that we can now write qstring_from_str() as a wrapper.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
764c1cae |
| 19-Nov-2009 |
Luiz Capitulino <lcapitulino@redhat.com> |
QString: Introduce qstring_append_int()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
#
6fe9565c |
| 19-Nov-2009 |
Luiz Capitulino <lcapitulino@redhat.com> |
QString: Introduce qstring_append_chr()
It appends a C char to a QString.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|