Am 23.11.2012 09:47, schrieb Paolo Bonzini:
> diff --git a/hw/qdev.c b/hw/qdev.c
> index 7ddcd24..f43717b 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
[...]
> @@ -720,6 +717,18 @@ static void device_class_base_init(ObjectClass *class, 
> void *data)
>      klass->props = NULL;
>  }
>  
> +static void qdev_remove_from_bus(Object *obj)
> +{
> +    DeviceState *dev = DEVICE(obj);
> +
> +    bus_remove_child(dev->parent_bus, dev);
> +}
> +
> +static void device_class_init(ObjectClass *class, void *data)
> +{
> +    class->unparent = qdev_remove_from_bus;

Ouch, patch for 1.4 coming up. :)

Andreas

> +}
> +
>  void device_reset(DeviceState *dev)
>  {
>      DeviceClass *klass = DEVICE_GET_CLASS(dev);
> @@ -747,6 +756,7 @@ static TypeInfo device_type_info = {
>      .instance_init = device_initfn,
>      .instance_finalize = device_finalize,
>      .class_base_init = device_class_base_init,
> +    .class_init = device_class_init,
>      .abstract = true,
>      .class_size = sizeof(DeviceClass),
>  };

-- 
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