On Mon, Apr 01, 2013 at 04:20:30PM +0800, Liu Ping Fan wrote: > From: Liu Ping Fan <pingf...@linux.vnet.ibm.com> > > This pair of interface are optinal, except for those device which is > used outside the biglock's protection for hot unplug.
Not sure if this comment is true. Memory unplug safety is not about the big lock, it's about whether a reference to memory is held *across* a hot unplug operation. So even code that is under the big lock can use a guest RAM buffer across the event loop, and therefore be exposed to a RAM unplug! Therefore inc/dec must be used if guest RAM is held across event loop handler calls. If the guest RAM access happens completely inside a handler function, then it is not affected by hot plug and doesn't need to do inc/dec.