qemu-e2k/include
Daniel P. Berrange a31bdae5a7 qom: Add object_new_with_props() / object_new_withpropv() helpers
It is reasonably common to want to create an object, set a
number of properties, register it in the hierarchy and then
mark it as complete (if a user creatable type). This requires
quite a lot of error prone, verbose, boilerplate code to achieve.

First a pair of functions object_set_props() / object_set_propv()
are added which allow for a list of objects to be set in
one single API call.

Then object_new_with_props() / object_new_with_propv() constructors
are added which simplify the sequence of calls to create an
object, populate properties, register in the object composition
tree and mark the object complete, into a single method call.

Usage would be:

   Error *err = NULL;
   Object *obj;
   obj = object_new_with_propv(TYPE_MEMORY_BACKEND_FILE,
                               object_get_objects_root(),
                               "hostmem0",
                               &err,
                               "share", "yes",
                               "mem-path", "/dev/shm/somefile",
                               "prealloc", "yes",
                               "size", "1048576",
                               NULL);

Note all property values are passed in string form and will
be parsed into their required data types, using normal QOM
semantics for parsing from string format.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-06-19 18:42:18 +02:00
..
block Block layer core and image format patches 2015-06-15 10:43:06 +01:00
disas
exec softmmu: provide tlb_vaddr_to_host function for user mode 2015-06-17 12:40:51 +02:00
fpu
hw ACPI: Add definitions for the SPCR table 2015-06-15 18:06:11 +01:00
libdecnumber
migration Add a protective section footer 2015-06-12 06:54:01 +02:00
monitor audio: remove LOG_TO_MONITOR along with default_mon 2015-06-15 12:42:48 +02:00
net vhost: 64 bit features 2015-06-10 18:15:04 +02:00
qapi qdict: Add qdict_{set,copy}_default() 2015-06-12 16:58:06 +02:00
qemu qom: Add object_new_with_props() / object_new_withpropv() helpers 2015-06-19 18:42:18 +02:00
qom qom: Add object_new_with_props() / object_new_withpropv() helpers 2015-06-19 18:42:18 +02:00
standard-headers virtio: update headers, add virtio-gpu (2d) 2015-06-10 11:02:00 +02:00
sysemu virtio-gpu: pci support bits and virtio-vga. 2015-06-16 10:35:43 +01:00
ui QemuOpts: Convert qemu_opts_foreach() to Error 2015-06-09 07:37:37 +02:00
config.h
elf.h linux/elf.h update 2015-05-27 17:52:03 +02:00
glib-compat.h glib: remove stale compat functions 2015-05-22 15:58:06 -04:00
qemu-common.h machine: add default_ram_size to machine class 2015-06-03 23:56:55 +02:00
qemu-io.h
qjson.h
trace-tcg.h
trace.h