qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 1/2] qemu/qdev: type safety in reset handler


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH 1/2] qemu/qdev: type safety in reset handler
Date: Wed, 16 Sep 2009 15:08:44 +0300
User-agent: Mutt/1.5.19 (2009-01-05)

On Wed, Sep 16, 2009 at 12:22:28PM +0200, Gerd Hoffmann wrote:
> On 09/16/09 12:06, Michael S. Tsirkin wrote:
>>> How about going one step further?  Register *one* qdev_reset instance
>>> which then walks the qdev tree and calls ->reset() for every device?
>>
>> Will be much more code. Why not reuse the existing queue?
>
> I think we'll need such a tree walker anyway sooner or later.  Thus  
> you'll get bonus points for making it generic, so it could be used for a  
> -- say -- late_init() callback too.

By the way, for save/restore, we have there:

void qdev_free(DeviceState *dev)
{
#if 0 /* FIXME: need sane vmstate_unregister function */
    if (dev->info->vmsd)
        vmstate_unregister(dev->info->vmsd, dev);
#endif
    QLIST_REMOVE(dev, sibling);
    qemu_free(dev);
}

which likely means that qemu will crash
on migration if a qdev device has been removed.
Anyone looking at fixing this?


> 
> Also the reset() callbacks order will be based on the position of the  
> device in the tree instead of being more or less random.

Not sure whether this can break anything.
If no because no one cares about the order,
why change it now?

> cheers,
>   Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]