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: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC v2 13/22] monitor: separate QMP parser and dispatcher
Date: Fri, 20 Oct 2017 11:19:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

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.

Paolo



reply via email to

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