QEMU Object Model interfaces

The documentation of QEMU’s Object Model interfaces defined in qom/object_interfaces.h .

void user_creatable_complete(UserCreatable * uc, Error ** errp)

Parameters

UserCreatable * uc
the user-creatable object whose complete() method is called if defined
Error ** errp
if an error occurs, a pointer to an area to store the error

Description

Wrapper to call complete() method if one of types it’s inherited from implements USER_CREATABLE interface, otherwise the call does nothing.

bool user_creatable_can_be_deleted(UserCreatable * uc)

Parameters

UserCreatable * uc
the object whose can_be_deleted() method is called if implemented

Description

Wrapper to call can_be_deleted() method if one of types it’s inherited from implements USER_CREATABLE interface.

Object * user_creatable_add_type(const char * type, const char * id, const QDict * qdict, Visitor * v, Error ** errp)

Parameters

const char * type
the object type name
const char * id
the unique ID for the object
const QDict * qdict
the object properties
Visitor * v
the visitor
Error ** errp
if an error occurs, a pointer to an area to store the error

Description

Create an instance of the user creatable object type, placing it in the object composition tree with name id, initializing it with properties from qdict

Return

the newly created object or NULL on error

Object * user_creatable_add_opts(QemuOpts * opts, Error ** errp)

Parameters

QemuOpts * opts
the object definition
Error ** errp
if an error occurs, a pointer to an area to store the error

Description

Create an instance of the user creatable object whose type is defined in opts by the ‘qom-type’ option, placing it in the object composition tree with name provided by the ‘id’ field. The remaining options in opts are used to initialize the object properties.

Return

the newly created object or NULL on error

typedef bool(* user_creatable_add_opts_predicate)

Parameters

`` * user_creatable_add_opts_predicate``
undescribed

Description

A callback function to determine whether an object of type type should be created. Instances of this callback should be passed to user_creatable_add_opts_foreach

int user_creatable_add_opts_foreach(void * opaque, QemuOpts * opts, Error ** errp)

Parameters

void * opaque
a user_creatable_add_opts_predicate callback or NULL
QemuOpts * opts
options to create
Error ** errp
unused

Description

An iterator callback to be used in conjunction with the qemu_opts_foreach() method for creating a list of objects from a set of QemuOpts

The opaque parameter can be passed a user_creatable_add_opts_predicate callback to filter which types of object are created during iteration. When it fails, report the error.

Return

0 on success, -1 when an error was reported.

void user_creatable_del(const char * id, Error ** errp)

Parameters

const char * id
the unique ID for the object
Error ** errp
if an error occurs, a pointer to an area to store the error

Description

Delete an instance of the user creatable object identified by id.

void user_creatable_cleanup(void)

Parameters

void
no arguments

Description

Delete all user-creatable objects and the user-creatable objects container.