<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/include/qom, branch master</title>
<subtitle>QEMU development tree</subtitle>
<id>https://git.zx2c4.com/qemu/atom/include/qom?h=master</id>
<link rel='self' href='https://git.zx2c4.com/qemu/atom/include/qom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/'/>
<updated>2024-02-27T13:01:42Z</updated>
<entry>
<title>include/qom/object.h: New OBJECT_DEFINE_SIMPLE_TYPE{, _WITH_INTERFACES} macros</title>
<updated>2024-02-27T13:01:42Z</updated>
<author>
<name>Peter Maydell</name>
<email>peter.maydell@linaro.org</email>
</author>
<published>2024-02-20T16:06:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=e54c24339f3e6533af0b0c4364c5c9c9f74e9273'/>
<id>urn:sha1:e54c24339f3e6533af0b0c4364c5c9c9f74e9273</id>
<content type='text'>
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é &lt;berrange@redhat.com&gt;
Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Message-id: 20240220160622.114437-5-peter.maydell@linaro.org
Reviewed-by: Zhao Liu &lt;zhao1.liu@intel.com&gt;
</content>
</entry>
<entry>
<title>hw/acpi: move object_resolve_type_unambiguous to core QOM</title>
<updated>2024-02-27T08:36:41Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2024-02-23T12:43:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=ee3b34cd48a29b744a390c33eaa1f97b69b88367'/>
<id>urn:sha1:ee3b34cd48a29b744a390c33eaa1f97b69b88367</id>
<content type='text'>
object_resolve_type_unambiguous provides a useful functionality, that
is currently emulated for example by usb_bus_find().  Move it to core
code and add error reporting for increased generality.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Reviewed-by: Thomas Huth &lt;thuth@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Message-ID: &lt;20240223124406.234509-2-pbonzini@redhat.com&gt;
[PMD: Fixed style]
Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
</content>
</entry>
<entry>
<title>qom: Add object_property_set_default_list()</title>
<updated>2023-11-10T17:19:14Z</updated>
<author>
<name>Kevin Wolf</name>
<email>kwolf@redhat.com</email>
</author>
<published>2023-11-09T17:42:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=125062e791258c68109f3a59cb7aca3dadbdb5a3'/>
<id>urn:sha1:125062e791258c68109f3a59cb7aca3dadbdb5a3</id>
<content type='text'>
This function provides a default for properties that are accessed using
the list visitor interface. The default is always an empty list.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Reviewed-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Message-ID: &lt;20231109174240.72376-10-kwolf@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>qom/object_interfaces: Clean up global variable shadowing</title>
<updated>2023-10-06T11:27:48Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2023-10-04T12:00:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=e0c7de8dc4a3c0b7a0d0fa21fa0561a4dc763716'/>
<id>urn:sha1:e0c7de8dc4a3c0b7a0d0fa21fa0561a4dc763716</id>
<content type='text'>
Fix:

  qom/object_interfaces.c:262:53: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
  ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp)
                                                      ^
  qom/object_interfaces.c:298:46: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
  bool user_creatable_add_from_str(const char *optarg, Error **errp)
                                               ^
  qom/object_interfaces.c:313:49: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
  void user_creatable_process_cmdline(const char *optarg)
                                                  ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here
  extern char *optarg;                    /* getopt(3) external variables */
               ^

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Message-ID: &lt;20231004120019.93101-9-philmd@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
</content>
</entry>
<entry>
<title>qom/object: Remove circular include dependency</title>
<updated>2022-06-28T08:53:32Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>f4bug@amsat.org</email>
</author>
<published>2022-05-09T08:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=5bba9bcfbb42e7c016626420e148a1bf1b080835'/>
<id>urn:sha1:5bba9bcfbb42e7c016626420e148a1bf1b080835</id>
<content type='text'>
"qom/object.h" doesn't need to include itself.

Fixes: db1015e92e04 ("Move QOM typedefs and add missing includes")
Signed-off-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
Reviewed-by: Damien Hedde &lt;damien.hedde@greensocs.com&gt;
Reviewed-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-Id: &lt;20220509084659.52076-1-philippe.mathieu.daude@gmail.com&gt;
Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED</title>
<updated>2022-03-22T10:40:51Z</updated>
<author>
<name>Marc-André Lureau</name>
<email>marcandre.lureau@redhat.com</email>
</author>
<published>2022-02-23T20:58:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=887ce500ef0046d35e613e40f7beb647a797b3e7'/>
<id>urn:sha1:887ce500ef0046d35e613e40f7beb647a797b3e7</id>
<content type='text'>
One less qemu-specific macro. It also helps to make some headers/units
only depend on glib, and thus moved in standalone projects eventually.

Signed-off-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
</content>
</entry>
<entry>
<title>monitor: Fix find_device_state() for IDs containing slashes</title>
<updated>2021-11-10T05:14:51Z</updated>
<author>
<name>Markus Armbruster</name>
<email>armbru@redhat.com</email>
</author>
<published>2021-10-19T08:57:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=1bf4d3294bd48b702530b131e3344860495425fd'/>
<id>urn:sha1:1bf4d3294bd48b702530b131e3344860495425fd</id>
<content type='text'>
Recent commit 6952026120 "monitor: Tidy up find_device_state()"
assumed the function's argument is "the device's ID or QOM path" (as
documented for device_del).  It's actually either an absolute QOM
path, or a QOM path relative to /machine/peripheral/.  Such a relative
path is a device ID when it doesn't contain a slash.  When it does,
the function now always fails.  Broke iotest 200, which uses relative
path "vda/virtio-backend".

It fails because object_resolve_path_component() resolves just one
component, not a relative path.

The obvious function to resolve relative paths is
object_resolve_path().  It picks a parent automatically.  Too much
magic, we want to specify the parent.  Create new
object_resolve_path_at() for that, and use it in find_device_state().

Reported-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-Id: &lt;20211019085711.86377-1-armbru@redhat.com&gt;
Tested-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Acked-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>qom: export more functions for use with non-UserCreatable objects</title>
<updated>2021-07-06T06:33:51Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2020-11-02T16:08:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=3bb6944585aa6f28b21265c88d86264e8e9f7e53'/>
<id>urn:sha1:3bb6944585aa6f28b21265c88d86264e8e9f7e53</id>
<content type='text'>
Machines and accelerators are not user-creatable but they are going
to share similar command-line parsing machinery.  Export functions
that will be used with -machine and -accel in softmmu/vl.c.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>qom: move user_creatable_add_opts logic to vl.c and QAPIfy it</title>
<updated>2021-03-19T09:18:17Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2021-03-12T17:35:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=bc2f4fcb1dd1a66ede126593fa091c23a94e3ab8'/>
<id>urn:sha1:bc2f4fcb1dd1a66ede126593fa091c23a94e3ab8</id>
<content type='text'>
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 &lt;eblake@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Message-Id: &lt;20210312173547.1283477-3-pbonzini@redhat.com&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>qom: Add user_creatable_parse_str()</title>
<updated>2021-03-19T09:17:14Z</updated>
<author>
<name>Kevin Wolf</name>
<email>kwolf@redhat.com</email>
</author>
<published>2021-02-19T17:14:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=ddf6dae7e34271332fbc04921d0c91ab6a009b5a'/>
<id>urn:sha1:ddf6dae7e34271332fbc04921d0c91ab6a009b5a</id>
<content type='text'>
The system emulator has a more complicated way of handling command line
options in that it reorders options before it processes them. This means
that parsing object options and creating the object happen at two
different points. Split the parsing part into a separate function that
can be reused by the system emulator command line.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Acked-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Acked-by: Peter Krempa &lt;pkrempa@redhat.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
</content>
</entry>
</feed>
