Am 26.03.2012 15:46, schrieb Andreas Färber:
> On realize, call the qdev init function.

> If that returns an error, raise QERR_DEVICE_INIT_FAILED.

Sorry, that sentence is outdated - the error is set in qom/object.c
(patch 1/3) for non-zero return values. It is merely being passed
through here.

Andreas

> 
> Signed-off-by: Andreas Färber <afaer...@suse.de>
> Cc: Anthony Liguori <anth...@codemonkey.ws>
> Cc: Paolo Bonzini <pbonz...@redhat.com>
> ---
>  hw/qdev.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/qdev.c b/hw/qdev.c
> index ee21d90..c84b656 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -649,6 +649,13 @@ static void device_finalize(Object *obj)
>      QTAILQ_REMOVE(&dev->parent_bus->children, dev, sibling);
>  }
>  
> +static int device_realize(Object *obj)
> +{
> +    DeviceState *dev = DEVICE(obj);
> +
> +    return qdev_init(dev);
> +}
> +
>  void device_reset(DeviceState *dev)
>  {
>      DeviceClass *klass = DEVICE_GET_CLASS(dev);
[snip]

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

Reply via email to