[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 4/5] qom: delay DeviceState's reclaim to main-lo

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 4/5] qom: delay DeviceState's reclaim to main-loop
Date: Wed, 25 Jul 2012 09:37:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

Il 25/07/2012 09:03, Stefan Hajnoczi ha scritto:
> From: Liu Ping Fan <address@hidden>
> iohandler/bh/timer may use DeviceState when its refcnt=0,

It's not clear how to me.  The only reference to devices from an
iohandler/bh/timer can be in the opaque.  Now, if you have a
iohandler/bh/timer whose opaque is a DeviceState, you should bump the
refcount before setting it up, and unref after tearing it down.

See for example how hw/scsi-disk.c bumps the refcount of a request
before starting asynchronous I/O and calls unref at the end of the
asynchronous I/O callback.


reply via email to

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