[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/3] monitor: rename out_lock to mon_lock
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/3] monitor: rename out_lock to mon_lock |
Date: |
Wed, 2 May 2018 14:33:35 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Mon, Apr 30, 2018 at 10:56:49AM +0100, Stefan Hajnoczi wrote:
> On Wed, Apr 18, 2018 at 05:02:37PM +0800, Peter Xu wrote:
> > The out_lock was only protecting out buffers. In the future the monitor
> > code will start to run in multiple threads. We turn it into a bigger
> > lock to protect not only the out buffer but also all the rest. We split
> > this lock until necessary. So far I don't see a reason to complicate
> > lock usage for monitors.
> >
> > Since at it, arrange the Monitor struct a bit.
> >
> > Signed-off-by: Peter Xu <address@hidden>
> > ---
> > monitor.c | 39 ++++++++++++++++++---------------------
> > 1 file changed, 18 insertions(+), 21 deletions(-)
> >
> > diff --git a/monitor.c b/monitor.c
> > index 39f8ee17ba..c93aa4e22b 100644
> > --- a/monitor.c
> > +++ b/monitor.c
> > @@ -202,20 +202,17 @@ typedef struct {
> >
> > struct Monitor {
> > CharBackend chr;
> > + /* We can't access guest memory when holding the lock */
> > + QemuMutex mon_lock;
>
> Please document which field this lock protects. For example, outbuf and
> out_watch need a comment.
Sure!
--
Peter Xu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v2 1/3] monitor: rename out_lock to mon_lock,
Peter Xu <=