From cd34d667d448bec91c81f4e46f9e7eb4e4857f6f Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Mon, 12 Dec 2011 14:29:43 -0600 Subject: qdev: add a qdev_get_type() function and expose as a 'type' property Signed-off-by: Anthony Liguori --- hw/qdev.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hw/qdev.h') diff --git a/hw/qdev.h b/hw/qdev.h index 9faf2ee18b..6e184278f4 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -596,4 +596,18 @@ void qdev_property_add_str(DeviceState *dev, const char *name, void (*set)(DeviceState *, const char *, Error **), Error **errp); +/** + * @qdev_get_type + * + * Returns the string representation of the type of this object. + * + * @dev - the device + * + * @errp - if an error occurs, a pointer to an area to store the error + * + * Returns: a string representing the type. This must be freed by the caller + * with g_free(). + */ +char *qdev_get_type(DeviceState *dev, Error **errp); + #endif -- cgit v1.2.1