e54c2433 | 20-Feb-2024 |
Peter Maydell <peter.maydell@linaro.org> |
include/qom/object.h: New OBJECT_DEFINE_SIMPLE_TYPE{, _WITH_INTERFACES} macros
We have an OBJECT_DEFINE_TYPE_EXTENDED macro, plus several variations on it, which emits the boilerplate for the TypeIn
include/qom/object.h: New OBJECT_DEFINE_SIMPLE_TYPE{, _WITH_INTERFACES} macros
We have an OBJECT_DEFINE_TYPE_EXTENDED macro, plus several variations on it, which emits the boilerplate for the TypeInfo and ensures it is registered with the type system. However, all the existing macros insist that the type being defined has its own FooClass struct, so they aren't useful for the common case of a simple leaf class which doesn't have any new methods or any other need for its own class struct (that is, for the kind of type that OBJECT_DECLARE_SIMPLE_TYPE declares).
Pull the actual implementation of OBJECT_DEFINE_TYPE_EXTENDED out into a new DO_OBJECT_DEFINE_TYPE_EXTENDED which parameterizes the value we use for the class_size field. This lets us add a new OBJECT_DEFINE_SIMPLE_TYPE which does the same job as the various existing OBJECT_DEFINE_*_TYPE_* family macros for this kind of simple type, and the variant OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES for when the type will implement some interfaces.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20240220160622.114437-5-peter.maydell@linaro.org Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
show more ...
|
bc2f4fcb | 12-Mar-2021 |
Paolo Bonzini <pbonzini@redhat.com> |
qom: move user_creatable_add_opts logic to vl.c and QAPIfy it
Emulators are currently using OptsVisitor (via user_creatable_add_opts) to parse the -object command line option. This has one extra fe
qom: move user_creatable_add_opts logic to vl.c and QAPIfy it
Emulators are currently using OptsVisitor (via user_creatable_add_opts) to parse the -object command line option. This has one extra feature, compared to keyval, which is automatic conversion of integers to lists as well as support for lists as repeated options:
-object memory-backend-ram,id=pc.ram,size=1048576000,host-nodes=0,policy=bind
So we cannot replace OptsVisitor with keyval right now. Still, this patch moves the user_creatable_add_opts logic to vl.c since it is not needed anywhere else, and makes it go through user_creatable_add_qapi.
In order to minimize code changes, the predicate still takes a string. This can be changed later to use the ObjectType QAPI enum directly.
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20210312173547.1283477-3-pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
f3750266 | 17-Feb-2021 |
Kevin Wolf <kwolf@redhat.com> |
qom: Factor out user_creatable_process_cmdline()
The implementation for --object can be shared between qemu-storage-daemon and other binaries, so move it into a function in qom/object_interfaces.c t
qom: Factor out user_creatable_process_cmdline()
The implementation for --object can be shared between qemu-storage-daemon and other binaries, so move it into a function in qom/object_interfaces.c that is accessible from everywhere.
This also requires moving the implementation of qmp_object_add() into a new user_creatable_add_qapi(), because qom/qom-qmp-cmds.c is not linked for tools.
user_creatable_print_help_from_qdict() can become static now.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
ff59780f | 02-Oct-2020 |
Eduardo Habkost <ehabkost@redhat.com> |
qom: Explicitly tag doc comments for typedefs and structs
If we explicitly indicate we are documenting a typedef or a struct, we'll be able to remove the $decl_type='type name' hack from kernel-doc.
qom: Explicitly tag doc comments for typedefs and structs
If we explicitly indicate we are documenting a typedef or a struct, we'll be able to remove the $decl_type='type name' hack from kernel-doc.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201003024123.193840-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
b99e80cb | 02-Oct-2020 |
Eduardo Habkost <ehabkost@redhat.com> |
docs/devel/qom: Remove usage of <code>
<code> is not valid reST syntax.
Function @argument references don't need additional markup, so just remove <code></code>.
Constants were changed to use reST
docs/devel/qom: Remove usage of <code>
<code> is not valid reST syntax.
Function @argument references don't need additional markup, so just remove <code></code>.
Constants were changed to use reST ``code`` syntax
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201003025424.199291-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
9cb54b18 | 23-Sep-2020 |
Paolo Bonzini <pbonzini@redhat.com> |
docs: Move object.h overview doc comment to qom.rst
Move the whole contents of the overview doc comment from object.h to qom.rst.
This makes the documentation source easier to read and edit, and al
docs: Move object.h overview doc comment to qom.rst
Move the whole contents of the overview doc comment from object.h to qom.rst.
This makes the documentation source easier to read and edit, and also solves the backslash escaping issue at the typecasting macro examples.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20200910221526.10041-10-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
6cf164c0 | 10-Sep-2020 |
Eduardo Habkost <ehabkost@redhat.com> |
qom: Add code block markup to all code blocks
Convert all example/codelisting markup to Sphinx code-block.
There are a few sections where backslashes at the end of lines break code formatting. A c
qom: Add code block markup to all code blocks
Convert all example/codelisting markup to Sphinx code-block.
There are a few sections where backslashes at the end of lines break code formatting. A comment was added noting that this is an issue.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20200910221526.10041-8-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
9bbfd245 | 10-Sep-2020 |
Eduardo Habkost <ehabkost@redhat.com> |
qom: Indent existing code examples
This indents existing code examples that are not indented yet, just to make future conversion to Sphinx markup easier to review.
Signed-off-by: Eduardo Habkost <e
qom: Indent existing code examples
This indents existing code examples that are not indented yet, just to make future conversion to Sphinx markup easier to review.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20200910221526.10041-7-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
88144468 | 10-Sep-2020 |
Eduardo Habkost <ehabkost@redhat.com> |
qom: Reformat section titles using Sphinx syntax
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20200910221526.10041-6-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@
qom: Reformat section titles using Sphinx syntax
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20200910221526.10041-6-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|