qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] ef7c7f: qom: add object_property_add_alias()


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] ef7c7f: qom: add object_property_add_alias()
Date: Tue, 01 Jul 2014 05:30:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ef7c7ff6d4ca1955278af1bc5025f47044183250
      
https://github.com/qemu/qemu/commit/ef7c7ff6d4ca1955278af1bc5025f47044183250
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M include/qom/object.h
    M qom/object.c

  Log Message:
  -----------
  qom: add object_property_add_alias()

Sometimes an object needs to present a property which is actually on
another object, or it needs to provide an alias name for an existing
property.

Examples:
  a.foo -> b.foo
  a.old_name -> a.new_name

The new object_property_add_alias() API allows objects to alias a
property on the same object or another object.  The source and target
names can be different.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>


  Commit: 64607d088132abdb25bf30d93e97d0c8df7b364c
      
https://github.com/qemu/qemu/commit/64607d088132abdb25bf30d93e97d0c8df7b364c
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M include/qom/object.h
    M qom/object.c

  Log Message:
  -----------
  qom: add a generic mechanism to resolve paths

It may be desirable to have custom link<> properties that do more
than just store an object.  Even the addition of a "check"
function is not enough if setting the link has side effects
or if a non-standard reference counting is preferrable.

Avoid the assumption that the opaque field of a link<> is a
LinkProperty struct, by adding a generic "resolve" callback
to ObjectProperty.  This fixes aliases of link properties.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: d190698e6f806198da42c05c35b623760b6e1f00
      
https://github.com/qemu/qemu/commit/d190698e6f806198da42c05c35b623760b6e1f00
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qom: allow creating an alias of a child<> property

Child properties must be unique.  Fix this problem by
turning their aliases into links.

The resolve function that forwards to the target property
does not have any knowledge of the target property's type,
so it works fine.

Reviewed-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 654a36d857ff949e0d1989904b76f53fded9dc83
      
https://github.com/qemu/qemu/commit/654a36d857ff949e0d1989904b76f53fded9dc83
  Author: Marcelo Tosatti <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M hw/timer/mc146818rtc.c

  Log Message:
  -----------
  mc146818rtc: add "rtc-time" link to "/machine/rtc"

Add a link to rtc under /machine providing a stable
location for management apps to query the value of the
time.  The link should be added by any object that sends
RTC_TIME_CHANGE events.

{"execute":"qom-get","arguments":{"path":"/machine","property":"rtc-time"} }

Suggested by Paolo Bonzini and Andreas Faerber.

Signed-off-by: Marcelo Tosatti <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c28322d10cd5f0529605b48684d2b82c9eb9c020
      
https://github.com/qemu/qemu/commit/c28322d10cd5f0529605b48684d2b82c9eb9c020
  Author: Peter Crosthwaite <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qom: object: remove parent pointer when unparenting

Certain parts of the QOM framework test this pointer to determine if
an object is parented. Nuke it when the object is unparented to allow
for reuse of an object after unparenting.

Signed-off-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 8ffad850ef5ae14287d0e185d478c9a35820482c
      
https://github.com/qemu/qemu/commit/8ffad850ef5ae14287d0e185d478c9a35820482c
  Author: Peter Crosthwaite <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qom: object: Ignore refs/unrefs of NULL

Just do nothing if passed NULL for a ref or unref. This avoids
call sites that manage a combination of NULL or non-NULL pointers
having to add iffery around every ref and unref.

Signed-off-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 563890c7c7e977842e2a35afe7a24d06d2103242
      
https://github.com/qemu/qemu/commit/563890c7c7e977842e2a35afe7a24d06d2103242
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M tests/fdc-test.c
    M tests/libqtest.c
    M tests/qom-test.c
    M tests/tmp105-test.c

  Log Message:
  -----------
  libqtest: escape strings in QMP commands, fix leak

libqtest is using g_strdup_printf to format QMP commands, but
this does not work if the argument strings need to be escaped.
Instead, use the fancy %-formatting functionality of QObject.
The only change required in tests is that strings have to be
formatted as %s, not '%s' or \"%s\".  Luckily this usage of
parameterized QMP commands is not that frequent.

The leak is in socket_sendf.  Since we are extracting the send
loop to a new function, fix it now.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: b5c2c3d0c81ea97ac8443113b9a7a0c0ce25368e
      
https://github.com/qemu/qemu/commit/b5c2c3d0c81ea97ac8443113b9a7a0c0ce25368e
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M memory.c
    M vl.c

  Log Message:
  -----------
  memory: MemoryRegion: use /machine as default owner

This will be added (after QOMification) as the QOM parent.

Reviewed-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: b4fefef9d52003b6d09866501275a9a57995c6b0
      
https://github.com/qemu/qemu/commit/b4fefef9d52003b6d09866501275a9a57995c6b0
  Author: Peter Crosthwaite <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M exec.c
    M include/exec/memory.h
    M memory.c

  Log Message:
  -----------
  memory: MemoryRegion: QOMify

QOMify memory regions as an Object. The former init() and destroy()
routines become instance_init() and instance_finalize() resp.

memory_region_init() is re-implemented to be:
object_initialize() + set fields

memory_region_destroy() is re-implemented to call unparent().

Signed-off-by: Peter Crosthwaite <address@hidden>
[Add newly-created MR as child, unparent on destruction. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 22a893e4f55344f96e1aafc66f5fedc491a5ca97
      
https://github.com/qemu/qemu/commit/22a893e4f55344f96e1aafc66f5fedc491a5ca97
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M include/exec/memory.h
    M memory.c

  Log Message:
  -----------
  memory: MemoryRegion: replace owner field with QOM parent

The two are now the same.

Reviewed-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 409ddd0139c101f813d16e8ebaa7c7d4b4afb96e
      
https://github.com/qemu/qemu/commit/409ddd0139c101f813d16e8ebaa7c7d4b4afb96e
  Author: Peter Crosthwaite <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M memory.c

  Log Message:
  -----------
  memory: MemoryRegion: Add container and addr props

Expose the already existing .parent and .addr fields as QOM properties.
.parent (i.e. the field describing the memory region that contains this
one in Memory hierachy) is renamed "container". This is to avoid
confusion with the QOM parent.

Signed-off-by: Peter Crosthwaite <address@hidden>
[Remove setters.  Do not unref parent on releasing the property. Clean
 up error propagation. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: d33382da9abe21cb42f26b55945845b56ce9324a
      
https://github.com/qemu/qemu/commit/d33382da9abe21cb42f26b55945845b56ce9324a
  Author: Peter Crosthwaite <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M include/exec/memory.h
    M memory.c

  Log Message:
  -----------
  memory: MemoryRegion: Add may-overlap and priority props

QOM propertyify the .may-overlap and .priority fields. The setters
will re-add the memory as a subregion if needed (i.e. the values change
when the memory region is already contained).

Signed-off-by: Peter Crosthwaite <address@hidden>
[Remove setters. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 52aef7bba74a65d0c9fbec7a6559cc8385ab0e17
      
https://github.com/qemu/qemu/commit/52aef7bba74a65d0c9fbec7a6559cc8385ab0e17
  Author: Peter Crosthwaite <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M memory.c

  Log Message:
  -----------
  memory: MemoryRegion: Add size property

To allow devices to dynamically resize the device. The motivation is
to allow devices with variable size to init their memory_region
without size early and then correctly populate size at realize() time.

Signed-off-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 1f6245e5aba94ff7acd34f8514da7dfb9712935d
      
https://github.com/qemu/qemu/commit/1f6245e5aba94ff7acd34f8514da7dfb9712935d
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M exec.c

  Log Message:
  -----------
  memory: do not give a name to the internal exec.c regions

There is no need to have them visible under /machine.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 352e8da743f26948cb12d0ee53c455f328f59bbe
      
https://github.com/qemu/qemu/commit/352e8da743f26948cb12d0ee53c455f328f59bbe
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M hw/core/qdev.c
    M include/hw/qdev-core.h

  Log Message:
  -----------
  qdev: correctly send DEVICE_DELETED for recursively-deleted devices

When a device is unparented (i.e. made completely hidden from management)
we want to send a DEVICE_DELETED event only if the device actually was
realized.  This avoids raising DEVICE_DELETED events when device_add
fails.

However, this does not work right for recursively-deleted
devices: the whole tree is _first_ unrealized, _then_ unparented.
Then device_unparent sees realized==false and fails to trigger
the event.  The solution is simply to move have_realized into
the DeviceState struct.  If device_add fails, we never set the
new field to true and DEVICE_DELETED is not sent.

Fixes qemu-iotests testcase 067 (broken by commit 5942a19, though that
commit in turn fixed a possible segfault in the same test).

Reported-by: Markus Armbruster <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c26f3a0a6dfe5ef2973ddfab03b1ceff641a7ebe
      
https://github.com/qemu/qemu/commit/c26f3a0a6dfe5ef2973ddfab03b1ceff641a7ebe
  Author: Peter Maydell <address@hidden>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M exec.c
    M hw/core/qdev.c
    M hw/timer/mc146818rtc.c
    M include/exec/memory.h
    M include/hw/qdev-core.h
    M include/qom/object.h
    M memory.c
    M qom/object.c
    M tests/fdc-test.c
    M tests/libqtest.c
    M tests/qom-test.c
    M tests/tmp105-test.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/memory' into staging

* remotes/bonzini/memory:
  qdev: correctly send DEVICE_DELETED for recursively-deleted devices
  memory: do not give a name to the internal exec.c regions
  memory: MemoryRegion: Add size property
  memory: MemoryRegion: Add may-overlap and priority props
  memory: MemoryRegion: Add container and addr props
  memory: MemoryRegion: replace owner field with QOM parent
  memory: MemoryRegion: QOMify
  memory: MemoryRegion: use /machine as default owner
  libqtest: escape strings in QMP commands, fix leak
  qom: object: Ignore refs/unrefs of NULL
  qom: object: remove parent pointer when unparenting
  mc146818rtc: add "rtc-time" link to "/machine/rtc"
  qom: allow creating an alias of a child<> property
  qom: add a generic mechanism to resolve paths
  qom: add object_property_add_alias()

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


Compare: https://github.com/qemu/qemu/compare/b3959efdbb2d...c26f3a0a6dfe

reply via email to

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