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
2015-06-18 14:12:33 +02:00
2015-06-11 15:33:38 +01:00
2015-06-12 15:39:05 +01:00
2015-06-17 20:02:15 +01:00
2015-06-12 18:04:14 +01:00
2015-06-17 20:02:15 +01:00
2015-06-12 12:02:48 +02:00
2015-06-12 18:04:14 +01:00
2012-09-07 09:02:44 +03:00
2015-04-04 09:45:59 +03:00
2014-06-16 13:24:35 +02:00
2013-09-05 09:40:31 -05:00
2015-06-12 06:42:34 +02:00
2015-04-28 15:36:09 +02:00
2013-10-11 09:34:56 -07:00
2008-10-12 17:54:42 +00:00
2015-06-03 14:21:24 +03:00
2015-04-30 16:05:48 +03:00
2013-07-23 02:41:31 +02:00
2015-06-12 18:04:14 +01:00
2015-06-12 13:42:17 +01:00
2015-06-12 10:13:23 +02:00
2015-06-03 14:21:24 +03:00
2015-06-15 13:24:51 +01:00
2015-05-22 17:08:01 +02:00
2014-05-24 00:07:29 +04:00
2015-05-11 08:59:07 -04:00
2015-06-12 18:04:14 +01:00
2015-05-22 15:58:22 -04:00
2013-10-11 09:34:56 -07:00
2015-06-11 10:13:28 +01:00
2015-04-25 22:05:07 +01:00
2013-10-11 09:34:56 -07:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
Description
No description provided
Readme 418 MiB
Languages
Rust 68.8%
C 26.3%
C++ 3%
Python 0.9%
Shell 0.5%
Other 0.3%