Statistics
| Branch: | Revision:

root / qom @ 6a1751b7

# Date Author Comment
35143f01 08/16/2013 07:44 pm Andreas Färber

gdbstub: Fix gdb_register_coprocessor() register counting

Commit a0e372f0c49ac01faeaeb73a6e8f50e8ac615f34 reorganized the register
counting for GDB. While it seems correct not to let the total number of
registers skyrocket in an SMP scenario through a static variable, the...

8231c2dd 08/16/2013 07:44 pm Eduardo Habkost

qom: Introduce instance_post_init hook

This will allow classes to specify a function to be called after all
instance_init functions were called.

This will be used by DeviceState to call qdev_prop_set_globals() at the
right moment.

Signed-off-by: Eduardo Habkost <>...

14a10fc3 07/29/2013 04:29 pm Andreas Färber

cpu: Partially revert "cpu: Change qemu_init_vcpu() argument to CPUState"

Commit c643bed99 moved qemu_init_vcpu() calls to common CPUState code.
This causes x86 cpu-add to fail with "KVM: setting VAPIC address failed".

The reason for the failure is that CPUClass::kvm_fd is not yet...

5b50e790 07/27/2013 01:04 am Andreas Färber

cpu: Introduce CPUClass::gdb_{read,write}_register()

Completes migration of target-specific code to new target-*/gdbstub.c.

Acked-by: Michael Walle <> (for lm32)
Acked-by: Max Filippov <> (for xtensa)
Signed-off-by: Andreas Färber <>

a0e372f0 07/27/2013 12:23 am Andreas Färber

cpu: Introduce CPUState::gdb_num_regs and CPUClass::gdb_num_core_regs

CPUState::gdb_num_regs replaces num_g_regs.
CPUClass::gdb_num_core_regs replaces NUM_CORE_REGS.

Allows building gdb_register_coprocessor() for xtensa, too.

As a side effect this should fix coprocessor register numbering for SMP....

51455c59 07/10/2013 06:54 pm Anthony Liguori

Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

  • Fix for OpenRISCCPU subclasses
  • Fix for gdbstub CPU selection
  • Move linux-user CPU functions into new header
  • CPUState part 10 refactoring: first_cpu, next_cpu, cpu_single_env et al....
9d6a3d58 07/10/2013 06:53 pm Peter Crosthwaite

qom: Fix class cast of NULL classes

Its clear from the implementation that class casting is supposed to work
with a NULL class argument. Guard all dereferences of the class argument
against NULL accordingly.

Signed-off-by: Peter Crosthwaite <>...

91b1df8c 07/09/2013 10:33 pm Andreas Färber

cpu: Move reset logging to CPUState

x86 was using additional CPU_DUMP_* flags, so make that configurable in
CPUClass::reset_dump_flags.

This adds reset logging for alpha, unicore32 and xtensa.

Acked-by: Michael Walle <> (for lm32)
Reviewed-by: Richard Henderson <>...

f08c03f3 07/04/2013 06:42 pm Jan Kiszka

qom: Use atomics for object refcounting

Object reference counts will soon be changed outside the BQL. So we need
to use atomics in object_ref/unref.

Based on a patch by Liu Ping Fan.

Signed-off-by: Liu Ping Fan <>
Signed-off-by: Jan Kiszka <>...

c643bed9 06/28/2013 02:25 pm Andreas Färber

cpu: Change qemu_init_vcpu() argument to CPUState

This allows to move the call into CPUState's realizefn.
Therefore move the stub into libqemustub.a.

Reviewed-by: Richard Henderson <>
Signed-off-by: Andreas Färber <>

60a3e17a 06/28/2013 02:25 pm Andreas Färber

cpu: Change cpu_exit() argument to CPUState

It no longer depends on CPUArchState, so move it to qom/cpu.c.

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <>

878096ee 06/28/2013 02:25 pm Andreas Färber

cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks

Make cpustats monitor command available unconditionally.

Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()
arguments to CPUState.

Signed-off-by: Andreas Färber <>

6db297ea 06/11/2013 07:18 pm Andreas Färber

cpu: Change default for CPUClass::get_paging_enabled()

qemu_get_guest_memory_mapping() uses cpu_paging_enabled() to determine
whether to use cpu_get_memory_mapping() to return mappings or whether to
fall back to a simple identity map.

Since by default CPUClass::get_memory_mapping() is not implemented,...

a23bbfda 06/11/2013 07:03 pm Andreas Färber

cpu: Turn cpu_get_memory_mapping() into a CPUState hook

Change error reporting from return value to Error argument.

Reviewed-by: Jens Freimann <>
Reviewed-by: Luiz Capitulino <>
[AF: Fixed cpu_get_memory_mapping() documentation]...

444d5590 06/11/2013 06:50 pm Andreas Färber

cpu: Turn cpu_paging_enabled() into a CPUState hook

Relocate assignment of x86 get_arch_id to have all hooks in one place.

Reviewed-by: Jens Freimann <>
Reviewed-by: Luiz Capitulino <>
Signed-off-by: Andreas Färber <>

95916abc 05/22/2013 03:40 pm Peter Crosthwaite

qom/object: Don't poll cast cache for NULL objects

object_dynamic_cast_assert used to be tolerant of NULL objects and not
assert. It's clear from the implementation that this is the expected
behavior.

The preceding check of the cast cache dereferences obj however causing...

03587328 05/13/2013 11:27 pm Anthony Liguori

qom: aggressively optimize qom casting

This patch adds a small typename cache to ObjectClass. This allows
caching positive casts within each ObjectClass. Benchmarking a
PPC workload provided by Aurelien, this patch eliminates every
single g_hash_table_lookup() happening during the benchmark (which...

bf0fda34 05/13/2013 05:52 pm Paolo Bonzini

qom: allow casting of a NULL class

This mimics what we do in object_dynamic_cast_assert.

Signed-off-by: Paolo Bonzini <>
Message-id:
Signed-off-by: Anthony Liguori <>

793c96b5 05/13/2013 05:52 pm Paolo Bonzini

qom: add a fast path to object_class_dynamic_cast

For leaf classes, in many cases the callbacks will simply downcast
the object back to the original class. Add this fast path to
object_class_dynamic_cast, object_dynamic_cast will inherit it.

Signed-off-by: Paolo Bonzini <>...

be17f18b 05/13/2013 05:52 pm Paolo Bonzini

qom: pass file/line/function to asserting casts

Signed-off-by: Paolo Bonzini <>
Message-id:
Signed-off-by: Anthony Liguori <>

fa131d94 05/13/2013 05:52 pm Paolo Bonzini

qom: trace asserting casts

This provides a way to detect the cast that leads to a (reproducible)
crash even when QOM cast debugging is disabled.

Signed-off-by: Paolo Bonzini <>
Message-id: ...

3556c233 05/13/2013 05:52 pm Paolo Bonzini

qom: allow turning cast debugging off

Cast debugging can have a substantial cost (20% or more). Instead of adding
special-cased "fast casts" in the hot paths, we can just disable it in
releases. The tracing facilities we just added make it easier to analyze...

c72bf468 05/01/2013 02:04 pm Jens Freimann

cpu: Move cpu_write_elfXX_note() functions to CPUState

Convert cpu_write_elfXX_note() functions to CPUClass methods and pass
CPUState as argument. Update target-i386 accordingly.

Signed-off-by: Jens Freimann <>
[AF: Retain stubs as CPUClass' default method implementation; style changes]...

997395d3 05/01/2013 02:04 pm Igor Mammedov

cpu: Introduce get_arch_id() method and override it for X86CPU

get_arch_id() adds possibility for generic code to get a guest-visible
CPU ID without accessing CPUArchState.
If derived classes don't override it, it will return cpu_index.

Override it on target-i386 in X86CPU to return the APIC ID....

69e5ff06 05/01/2013 02:04 pm Igor Mammedov

cpu: Add helper cpu_exists(), to check if CPU with specified id exists

Signed-off-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

13eed94e 05/01/2013 02:04 pm Igor Mammedov

cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()

If hotplugged, synchronize CPU state to KVM.

Signed-off-by: Igor Mammedov <>
Reviewed-by: Eduardo Habkost <>
Signed-off-by: Andreas Färber <>

6afb4721 05/01/2013 02:04 pm Igor Mammedov

cpu: Resume CPU from DeviceClass::realize() if hot-plugged

Signed-off-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

066e9b27 05/01/2013 02:04 pm Igor Mammedov

cpu: Introduce CPU hot-plug notifier

Hot-add CPU event will be distributed to acpi_piix4 and rtc_cmos.

Signed-off-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

9ab880b3 04/30/2013 05:40 pm Alexander Graf

QOM: Fail casts for unknown types

When we try to cast an object to an unknown type, fail the cast. Today
we would simply run into an assert().

This fixes a bug on qemu-system-s390x for me that gets triggered by the
audio code looking for PCI and ISA buses....

2e1103f6 04/29/2013 08:16 pm Paolo Bonzini

qom: do not return root for empty path

An empty path will return the sole object of that type in the
QOM tree. This is different from "/", which returns the root.

Signed-off-by: Paolo Bonzini <>
Message-id: ...

e0a83fc2 04/17/2013 12:10 am Paolo Bonzini

qom: do nothing on unparent of object without parent

Otherwise, device_unparent will fail to get a canonical path of
the object.

Signed-off-by: Paolo Bonzini <>
Message-id:
Signed-off-by: Anthony Liguori <>

404e7a4f 03/26/2013 11:16 pm Anthony Liguori

Merge remote-tracking branch 'mst/tags/for_anthony' into staging

virtio,pci,qom

Work by Alex to support VGA assignment,
pci and virtio fixes by Stefan, Jason and myself, and a
new qmp event for hotplug support by myself.

Signed-off-by: Michael S. Tsirkin <>...

e998fa8d 03/26/2013 09:00 pm Michael S. Tsirkin

qom: call class destructor before unparent

It seems more logical to have destruction flow start with the subclass
and move up to the base class. This ensures object has a valid
canonical path when destructor is called.

Signed-off-by: Michael S. Tsirkin <>

54852b03 03/26/2013 04:27 pm Peter Maydell

qom: Detect attempts to add a property that already exists

Detect attempts to add a property to an object if one of
that name already exists, and report them as errors.

Signed-off-by: Peter Maydell <>
Reviewed-by: Anthony Liguori <>...

259186a7 03/12/2013 11:35 am Andreas Färber

cpu: Move halted and interrupt_request fields to CPUState

Both fields are used in VMState, thus need to be moved together.
Explicitly zero them on reset since they were located before
breakpoints.

Pass PowerPCCPU to kvmppc_handle_halt().

Signed-off-by: Andreas Färber <>

d8ed887b 03/12/2013 11:35 am Andreas Färber

exec: Pass CPUState to cpu_reset_interrupt()

Move it to qom/cpu.c to avoid build failures depending on include order
of cpu-qom.h and exec/cpu-all.h.

Change opaques of various ..._irq_handler() functions to the
appropriate CPU type to facilitate using cpu_reset_interrupt()....

3e407de4 02/22/2013 12:34 am Peter Crosthwaite

qom/object.c: Reset interface list on inheritance

The QOM framework will attempt the recreate a classes interface list from
scratch for each class. This means that a child class should zero out the
list of interfaces when cloned from the parent class.

Currently the list is memcpy()d from the parent to the child. As the interface...

00e2ceae 02/22/2013 12:34 am Peter Crosthwaite

qom/object.c: Allow itf cast with num_itfs = 0

num_interfaces only tells you how many interfaces the concrete child class has
(as defined in the TypeInfo). This means if you have a child class which defines
no interfaces of its own, but its parent has interfaces you cannot cast to those...

fcd7d003 02/16/2013 03:51 pm Andreas Färber

cpu: Move exit_request field to CPUState

Since it was located before breakpoints field, it needs to be reset.

Signed-off-by: Andreas Färber <>

d77953b9 02/16/2013 03:51 pm Andreas Färber

cpu: Move current_tb field to CPUState

Explictly NULL it on CPU reset since it was located before breakpoints.

Change vapic_report_tpr_access() argument to CPUState. This also
resolves the use of void* for cpu.h independence.
Change vAPIC patch_instruction() argument to X86CPU....

4f658099 02/16/2013 03:50 pm Andreas Färber

cpu: Prepare QOM realizefn

Overwrite the default implementation with a no-op, no longer
attempting to call DeviceClass::init.

Signed-off-by: Andreas Färber <>

b76facc3 02/01/2013 11:53 pm Paolo Bonzini

qom: remove object_delete

This is now unused. Document the initial reference count of an object
and when it will be freed/finalized.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

52e636cd 02/01/2013 11:53 pm Paolo Bonzini

qom: preserve object while unparenting it

Avoid that the object disappears after it's deleted from the QOM
composition tree, in case that was the only reference to it.

Acked-by: Andreas Färber <>
Signed-off-by: Paolo Bonzini <>...

17862378 01/28/2013 12:33 am Andreas Färber

qom: Introduce object_class_is_abstract()

This lets a caller check if an ObjectClass as returned by, e.g.,
object_class_by_name() is instantiatable.

Signed-off-by: Andreas Färber <>
Cc: Anthony Liguori <>

2b8c2754 01/27/2013 03:52 pm Andreas Färber

cpu: Add model resolution support to CPUClass

Introduce CPUClass::class_by_name and add a default implementation.
Hook up the alpha and ppc implementations.

Introduce a wrapper function cpu_class_by_name().

Signed-off-by: Andreas Färber <>

00082344 01/26/2013 03:15 pm Paolo Bonzini

build: remove universal-obj-y

All of universal-obj-y, user-obj-y (right now unused) and common-obj-y can
be unified into common-obj-y if we take care of defining CONFIG_SOFTMMU
and CONFIG_USER_ONLY in the toplevel makefile. This is similar to how
we define symbols for hardware components....

3e84b483 01/15/2013 11:54 am Andreas Färber

qom: Make object_resolve_path_component() path argument const

A usage with a hardcoded partial path such as

object_resolve_path_component(obj, "foo")

is totally valid but currently leads to a compilation error. Fix this.

Signed-off-by: Andreas Färber <>...

9444e9e6 01/12/2013 07:42 pm Paolo Bonzini

build: consolidate multiple variables into universal-obj-y

The directory descent mechanism, and a less-flat tree both helped
in making some *-obj-y definitions very short. Many of these
often end up in universal-obj-y, and used to be separate only
because of libuser (which is now part of history...)....

8c43a6f0 01/10/2013 11:11 pm Andreas Färber

Make all static TypeInfos const

Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all
types natively through QEMU Object Model), TypeInfo as used in
the common, non-iterative pattern is no longer amended with information
and should therefore be const....

961f8395 01/08/2013 10:03 pm Eduardo Habkost

cpu: Change parent type to Device

This finally makes the CPU class a subclass of the Device class,
allowing us to start using DeviceState properties on CPU subclasses.

It has no_user=1, as creating CPUs using -device doesn't work yet.

Signed-off-by: Igor Mammedov <>...

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

14cccb61 12/19/2012 09:31 am Paolo Bonzini

qom: move include files to include/qom/

Signed-off-by: Paolo Bonzini <>

7b1b5d19 12/19/2012 09:31 am Paolo Bonzini

qapi: move include files to include/qobject/

Signed-off-by: Paolo Bonzini <>

4167c42c 12/19/2012 09:31 am Paolo Bonzini

qapi: remove qapi/qapi-types-core.h

The file is only including error.h and qerror.h. Prefer explicit
inclusion of whatever files are needed.
Signed-off-by: Paolo Bonzini <>

339c2708 11/26/2012 09:41 pm Paolo Bonzini

qom: make object_finalize static

It is not used anymore, and there is no need to make it public.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

764b6312 11/26/2012 09:41 pm Paolo Bonzini

qom: fix refcount of non-heap-allocated objects

The reference count for embedded objects is always one too low, because
object_initialize_with_type returns with zero references to the object.
This causes premature finalization of the object (or an assertion failure)...

667d22d1 11/26/2012 09:41 pm Paolo Bonzini

qdev: move bus removal to object_unparent

Add an ObjectClass method that is done at object_unparent time. It
should remove any backlinks to the object in the composition tree,
so that object_delete will be able to drop the last reference and
free the object....

fde9bf44 11/26/2012 09:41 pm Paolo Bonzini

qom: make object_delete usable for statically-allocated objects

Store in the object the freeing function that will be used at deletion
time. This makes it possible to use object_delete on statically-allocated
(embedded) objects. Dually, it makes it possible to use object_unparent...

b7f43fe4 11/26/2012 05:38 pm Paolo Bonzini

qom: dynamic_cast of NULL is always NULL

Trying to cast a NULL value will cause a crash. Returning
NULL is also sensible, and it is also what the type-unsafe
DO_UPCAST macro does.

Reported-by: Markus Armbruster <>
Signed-off-by: Paolo Bonzini <>...

0e558843 11/16/2012 04:36 pm Anthony Liguori

object: add object_property_add_bool (v2)

Signed-off-by: Anthony Liguori <>
---
v1 -> v2
- Fix whitespace (Andreas Faerber)

da5a44e8 08/24/2012 04:19 am Paolo Bonzini

qom: object_delete should unparent the object first

object_deinit is only called when the reference count goes to zero,
and yet tries to do an object_unparent. Now, object_unparent
either does nothing or it will decrease the reference count.
Because we know the reference count is zero, the object_unparent...

33e95c63 08/13/2012 12:20 pm Anthony Liguori

qom: Reimplement Interfaces

The current implementation of Interfaces is poorly designed. Each interface
that an object implements ends up being an object that's tracked by the
implementing object. There's all sorts of gymnastics to deal with casting
between these objects....

0866aca1 06/18/2012 04:14 pm Anthony Liguori

qbus: Make child devices links

Make qbus children show up as link<> properties. There is no stable
addressing for qbus children so we use an unstable naming convention.

This is okay in QOM though because the composition name is expected to
be what's stable....

8cb6789a 06/18/2012 04:14 pm Paolo Bonzini

qdev: Remove qdev_prop_exists()

Can be replaced everywhere with object_property_find().

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

89bfe000 06/18/2012 04:14 pm Paolo Bonzini

qom: Push error reporting to object_property_find()

Avoids duplicated error_set().

Signed-off-by: Paolo Bonzini <>
[AF: Also drop error_set() in object_property_del().]
Signed-off-by: Andreas Färber <>

3b50e311 06/18/2012 04:14 pm Paolo Bonzini

qom: Add class_base_init

The class_base_init TypeInfo callback was present in one of the early
QOM versions but removed (on my request...) before committing. We
will need it soon, add it.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Anthony Liguori <>...

745549c8 06/18/2012 04:14 pm Paolo Bonzini

qom: Make Object a type

Right now the base Object class has a special NULL type. Change this so
that we will be able to add class_init and class_base_init callbacks.
To do this, remove some special casing of ObjectClass that is not really
necessary.

Signed-off-by: Paolo Bonzini <>...

049cb3cf 06/18/2012 04:14 pm Paolo Bonzini

qom: Assert that public types have a non-NULL parent field

This protects against unwanted effects of changing TYPE_OBJECT from
NULL to a string.

Suggested-by: Andreas Färber <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

2f262e06 06/18/2012 04:14 pm Paolo Bonzini

qdev: Push "type" property up to Object

Now that Object is a type, add an instance_init function and push
the "type" property from qdev to there.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

e7cce67f 06/18/2012 04:14 pm Paolo Bonzini

qom: Add object_class_get_parent()

This simple bit of functionality was missing and we'll need it soon,
so add it.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Anthony Liguori <>
[AF: Document possible NULL return value]...

5d9d3f47 06/18/2012 04:14 pm Andreas Färber

qom: Introduce object_property_is_{child,link}()

Avoids hardcoding partial string comparisons.

Signed-off-by: Alexander Barabash <>
Signed-off-by: Andreas Färber <>
Reviewed-by: Paolo Bonzini <>

32efc535 06/18/2012 04:14 pm Paolo Bonzini

qom: Add object_child_foreach()

A utility function that will be used to implement hierarchical realization.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Anthony Liguori <>
[AF: Drop unrelated whitespace change, add Returns: in documentation]...

7f07b9cb 06/07/2012 10:21 am Paolo Bonzini

build: adapt qom/Makefile and move it to Makefile.objs

qom/ already used a separate makefile. Convert it to use relative
paths, and make it declare both common-obj-y and user-obj-y. This
way, the upper makefiles do not need to know that some QOM files
are compiled twice....

8185bfc1 05/12/2012 03:17 pm Paolo Bonzini

qdev: Use object_property_print() in info qtree

Otherwise, non-string properties without a legacy counterpart are missed.
Also fix error propagation in object_property_print() itself.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Anthony Liguori <>...

f156f238 05/03/2012 08:04 am Stefan Weil

qom: Fix memory leak in function container_get

Valgrind reported this memory leak which occured very often.

Test scenario:

qemu-system-i386 (no arguments), only BIOS started, terminate with
monitor command (quit).

Signed-off-by: Stefan Weil <>...

dfe47e70 04/24/2012 05:50 pm Andreas Färber

qom: Refine container_get() to allow using a custom root

Specify the root to search from as argument. This avoids hardcoding
"/machine" in some places and makes it more flexible.

Signed-off-by: Andreas Färber <>
Cc: Paolo Bonzini <>...

a612b2a6 04/02/2012 11:04 pm Paolo Bonzini

qom: add container_get

This is QOM "mkdir -p". It is useful when referring to
container objects such as "/machine".

Reviewed-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

dd83b06a 03/14/2012 11:20 pm Andreas Färber

qom: Introduce CPU class

Reintroduce CPUState as QOM object: It's abstract and derived directly
from TYPE_OBJECT for compatibility with the user emulators.
The identifier CPUState avoids conflicts between CPU and the struct.

Introduce $(qom-twice-y) to build it separately for system and for user...

ac451033 03/14/2012 10:30 pm Igor Mitsyanko

qom/object.c: rename type_class_init() to type_initialize()

Function name type_class_init() gave us a wrong impression of separation
of type's "class" and "object" entities initialization. Name type_initialize()
is more appropriate for type_class_init() function (considering what operations...

418ba9e5 03/14/2012 10:30 pm Andreas Färber

qom: Introduce object_class_get_list()

This function allows to obtain a singly-linked list of classes, which
can be sorted by the caller.

Signed-off-by: Andreas Färber <>
Cc: Anthony Liguori <>
Signed-off-by: Anthony Liguori <>

aca59af6 03/14/2012 10:30 pm Igor Mitsyanko

qom: if @instance_size==0, assign size of object to parent object size

QOM documentation states that for objects of type with @instance_size == 0 size
will be assigned to match parent object's size. But currently this feauture is
not implemented and qemu asserts during creation of object with zero instance_size....

6c1fdcf9 03/12/2012 09:05 pm Paolo Bonzini

qom: fix device hot-unplug

Property removal modifies the list, so it is not safe to continue
iteration. We know anyway that each object can have only one
parent (see object_property_add_child), so exit after finding
the requested object.

Reported-by: Michael S. Tsirkin <>...

f0cdc966 02/22/2012 09:24 pm Alexander Barabash

qom: In function object_set_link_property(), first call object_ref(), then object_unref().

In the old implementation, if the new value of the property links
to the same object, as the old value, that object is first unref-ed,
and then ref-ed. This leads to unintended deinitialization of that object....

258b2c42 02/22/2012 05:02 pm Andreas Färber

qom: Fix object_initialize_with_type() assertion

Assert the object is at least sizeof(Object), not sizeof(ObjectClass).

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>
Signed-off-by: Anthony Liguori <>

b2cd7dee 02/22/2012 09:31 am Paolo Bonzini

qom: add generic string parsing/printing

Add generic property accessors that take a string and parse it
appropriately for the property type. All the magic here is done
by the new string-based visitors.

Signed-off-by: Paolo Bonzini <>

83f7d43a 02/15/2012 05:39 pm Andreas Färber

qom: Unify type registration

Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace....

8f770d39 02/07/2012 02:52 pm Paolo Bonzini

qom: fix off-by-one

Signed-off-by: Paolo Bonzini <>

02fe2db6 02/07/2012 02:52 pm Paolo Bonzini

qom: add object_resolve_path_type

Reviewed-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>

11e35bfd 02/07/2012 02:52 pm Paolo Bonzini

qom: use object_resolve_path_type for links

This allows to restrict partial matches to objects of the expected
type. It will let people use bare names to reference drives
even though their name might be the same as a device's (e.g.
-drive id=hd0,if=none,... -device ...,drive=hd0,id=hd0)....

a1e7efdc 02/07/2012 02:52 pm Paolo Bonzini

qom: fix canonical paths vs. interfaces

Reviewed-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>

1d9c5a12 02/07/2012 02:52 pm Paolo Bonzini

qom: add property get/set wrappers for links

These can set a link to any object, as long as it is included in
the composition tree.

Reviewed-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>

b46d9b10 02/07/2012 02:52 pm Paolo Bonzini

qom: do not include qdev header file

Reviewed-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>

9f5f1350 02/07/2012 02:52 pm Paolo Bonzini

qom: add QObject-based property get/set wrappers

Move the creation of QmpInputVisitor and QmpOutputVisitor from qmp.c
to qom/object.c, since it's the only practical way to access object
properties.

Keep this isolated such that it's easy to remove. At some point, we need...

7b7b7d18 02/07/2012 02:52 pm Paolo Bonzini

qom: add property get/set wrappers for C types

Add wrappers that let you get/set properties using normal C data types.

Reviewed-by: Anthony Liguori <anthony@>
Signed-off-by: Paolo Bonzini <>

9970bd88 02/07/2012 02:52 pm Paolo Bonzini

qom: avoid useless conversions from string to type

Signed-off-by: Paolo Bonzini <>

acc4af3f 02/07/2012 02:51 pm Paolo Bonzini

qom: clean up/optimize object_dynamic_cast

The interface loop can be performed only on the parent object. It
does not need to be done on each interface. Similarly, we can
simplify the code by switching early from the implementation
object to the parent object....

57c9fafe 02/03/2012 06:41 pm Anthony Liguori

qom: move properties from qdev to object

This is mostly code movement although not entirely. This makes properties part
of the Object base class which means that we can now start using Object in a
meaningful way outside of qdev.

Signed-off-by: Anthony Liguori <>

fe40e627 02/03/2012 06:41 pm Anthony Liguori

qom: accept any compatible type when setting a link property

Links had limited utility before as they only allowed a concrete type to be
specified. Now we can support abstract types and interfaces which means it's
now possible to have a link<PCIDevice>....

db85b575 02/03/2012 06:41 pm Anthony Liguori

object: sure up reference counting

Now we have the following behavior:

1) object_new() returns an object with ref = 1
2) object_initialize() does not increase the reference count (ref may be 0).
3) object_deref() will finalize the object when ref = 0. it does not free the...

8b45d447 02/03/2012 06:41 pm Anthony Liguori

container: make a decendent of Object

Signed-off-by: Anthony Liguori <>
---
v1 -> v2
- Add license (Paolo)