qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 16bf7f: qom: Allow properties to be registere


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 16bf7f: qom: Allow properties to be registered against cla...
Date: Mon, 18 Jan 2016 10:30:03 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 16bf7f522a2ff68993f80631ed86254c71eaf5d4
      
https://github.com/qemu/qemu/commit/16bf7f522a2ff68993f80631ed86254c71eaf5d4
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-01-18 (Mon, 18 Jan 2016)

  Changed paths:
    M include/qom/object.h
    M qom/object.c
    M tests/check-qom-proplist.c

  Log Message:
  -----------
  qom: Allow properties to be registered against classes

When there are many instances of a given class, registering
properties against the instance is wasteful of resources. The
majority of objects have a statically defined list of possible
properties, so most of the properties are easily registerable
against the class. Only those properties which are conditionally
registered at runtime need be recorded against the klass.

Registering properties against classes also makes it possible
to provide static introspection of QOM - currently introspection
is only possible after creating an instance of a class, which
severely limits its usefulness.

This impl only supports simple scalar properties. It does not
attempt to allow child object / link object properties against
the class. There are ways to support those too, but it would
make this patch more complicated, so it is left as an exercise
for the future.

There is no equivalent to object_property_del() provided, since
classes must be immutable once they are defined.

Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>


  Commit: 7746abd8e9ee9db20c0b0fdb19504f163ba3cbea
      
https://github.com/qemu/qemu/commit/7746abd8e9ee9db20c0b0fdb19504f163ba3cbea
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-01-18 (Mon, 18 Jan 2016)

  Changed paths:
    M hw/ppc/spapr_drc.c
    M include/qom/object.h
    M net/filter.c
    M qmp.c
    M qom/object.c
    M tests/check-qom-proplist.c
    M vl.c

  Log Message:
  -----------
  qom: Change object property iterator API contract

Currently the ObjectProperty iterator API works as follows:

  ObjectPropertyIterator *iter;

  iter = object_property_iter_init(obj);
  while ((prop = object_property_iter_next(iter))) {
     ...
  }
  object_property_iter_free(iter);

This has the benefit that the ObjectPropertyIterator struct
can be opaque, but has the downside that callers need to
explicitly call a free function. It is also not in keeping
with iterator style used elsewhere in QEMU/GLib2.

This patch changes the API to use stack allocation instead:

  ObjectPropertyIterator iter;

  object_property_iter_init(&iter, obj);
  while ((prop = object_property_iter_next(&iter))) {
     ...
  }

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[AF: Fused ObjectPropertyIterator struct with typedef]
Signed-off-by: Andreas Färber <address@hidden>


  Commit: abed886ec60cf239a03515cf0b30fb11fa964c44
      
https://github.com/qemu/qemu/commit/abed886ec60cf239a03515cf0b30fb11fa964c44
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-01-18 (Mon, 18 Jan 2016)

  Changed paths:
    M hw/core/qdev.c

  Log Message:
  -----------
  qdev: Free QemuOpts when the QOM path goes away

Otherwise there is a race where the DEVICE_DELETED event has been sent but
attempts to reuse the ID will fail.

Note that similar races exist for other QemuOpts, which this patch
does not attempt to fix.

For example, if the device is a block device, then unplugging it also
deletes its backend.  However, this backend's get deleted in
drive_info_del(), which is only called when properties are
destroyed.  Just like device_finalize(), drive_info_del() is called
some time after DEVICE_DELETED is sent.  A separate patch series has
been sent to plug this other bug.  Character devices also have yet to
be fixed.

Reported-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>


  Commit: 300b115ce804cb6a20acc0003cc17687545b728d
      
https://github.com/qemu/qemu/commit/300b115ce804cb6a20acc0003cc17687545b728d
  Author: Andreas Färber <address@hidden>
  Date:   2016-01-18 (Mon, 18 Jan 2016)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Fix sPAPR entry heading

get_maintainers.pl does not handle parenthesis in maintenance areas well
in connection with list emails (here: address@hidden).

Resolve a recurring CC issue breaking git-send-email by reverting part
of commit 085eb217dfb3ee12e7985c11f71f8a038394735a ("Add David Gibson
for sPAPR in MAINTAINERS file").

Cc: David Gibson <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>


  Commit: 3db34bf64ab4f8797565dd8750003156c32b301d
      
https://github.com/qemu/qemu/commit/3db34bf64ab4f8797565dd8750003156c32b301d
  Author: Peter Maydell <address@hidden>
  Date:   2016-01-18 (Mon, 18 Jan 2016)

  Changed paths:
    M MAINTAINERS
    M hw/core/qdev.c
    M hw/ppc/spapr_drc.c
    M include/qom/object.h
    M net/filter.c
    M qmp.c
    M qom/object.c
    M tests/check-qom-proplist.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' 
into staging

QOM infrastructure fixes and device conversions

* Dynamic class properties
* Property iterator cleanup
* Device hot-unplug ID race fix

# gpg: Signature made Mon 18 Jan 2016 17:27:01 GMT using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <address@hidden>"
# gpg:                 aka "Andreas Färber <address@hidden>"

* remotes/afaerber/tags/qom-devices-for-peter:
  MAINTAINERS: Fix sPAPR entry heading
  qdev: Free QemuOpts when the QOM path goes away
  qom: Change object property iterator API contract
  qom: Allow properties to be registered against classes

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/12b167226f28...3db34bf64ab4

reply via email to

[Prev in Thread] Current Thread [Next in Thread]