qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v2 13/22] monitor: separate QMP parser and dispatc


From: Peter Xu
Subject: Re: [Qemu-devel] [RFC v2 13/22] monitor: separate QMP parser and dispatcher
Date: Mon, 23 Oct 2017 14:07:54 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

On Fri, Oct 20, 2017 at 11:19:44AM +0200, Paolo Bonzini wrote:
> On 19/10/2017 15:13, Stefan Hajnoczi wrote:
> > Up to you.  I don't remember the details of out_lock usage well enough
> > to know whether using the lock for the queues is good or bad.
> 
> out_lock is called like that because it's only writes that can be done
> from multiple threads (at both the chardev and monitor level).
> IOThreads in particular want to generate QMP events.
> 
> out_lock protects the monitor's own output buffer, while the character
> device layer has its own locking (chr_write_lock).  chr_write_lock
> protects calls to the chr_write method of the Chardev object and writes
> to the character device's logfd.
> 
> Renaming out_lock and reusing it is just fine if the lock is only held
> for short periods of time.  But maybe it's simpler to just introduce
> another lock, since the out_lock rules are very simple.

OK, let me use a new lock.  Thanks for explaining!

-- 
Peter Xu



reply via email to

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