[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2.1 32/36] qemu-char: do not call chr_write dire
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 2.1 32/36] qemu-char: do not call chr_write directly |
Date: |
Thu, 19 Jun 2014 08:47:08 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 06/18/2014 12:43 AM, Paolo Bonzini wrote:
> Make the mux always go through qemu_chr_fe_write, so that we'll get
> the mutex for the underlying chardev.
>
> Reviewed-by: Fam Zheng <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> qemu-char.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
> @@ -301,10 +301,10 @@ static int mux_chr_write(CharDriverState *chr, const
> uint8_t *buf, int len)
> (secs / 60) % 60,
> secs % 60,
> (int)(ti % 1000));
> - d->drv->chr_write(d->drv, (uint8_t *)buf1, strlen(buf1));
> + qemu_chr_fe_write(d->drv, (uint8_t *)buf1, strlen(buf1));
> d->linestart = 0;
> }
> - ret += d->drv->chr_write(d->drv, buf+i, 1);
> + ret += qemu_chr_fe_write(d->drv, buf+i, 1);
Worth fixing the spacing around + while at it?
> @@ -370,7 +370,7 @@ static int mux_proc_byte(CharDriverState *chr, MuxDriver
> *d, int ch)
> case 'x':
> {
> const char *term = "QEMU: Terminated\n\r";
> - chr->chr_write(chr,(uint8_t *)term,strlen(term));
> + qemu_chr_fe_write(chr, (uint8_t *)term, strlen(term));
> exit(0);
> break;
The break is dead code; you could clean it up while in the area.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 2.1 26/36] qapi event: convert SPICE events, (continued)
- [Qemu-devel] [PATCH 2.1 26/36] qapi event: convert SPICE events, Paolo Bonzini, 2014/06/18
- [Qemu-devel] [PATCH 2.1 27/36] qapi event: convert BALLOON_CHANGE, Paolo Bonzini, 2014/06/18
- [Qemu-devel] [PATCH 2.1 28/36] qapi event: convert GUEST_PANICKED, Paolo Bonzini, 2014/06/18
- [Qemu-devel] [PATCH 2.1 29/36] qapi event: convert QUORUM events, Paolo Bonzini, 2014/06/18
- [Qemu-devel] [PATCH 2.1 30/36] qapi event: clean up, Paolo Bonzini, 2014/06/18
- [Qemu-devel] [PATCH 2.1 32/36] qemu-char: do not call chr_write directly, Paolo Bonzini, 2014/06/18
- Re: [Qemu-devel] [PATCH 2.1 32/36] qemu-char: do not call chr_write directly,
Eric Blake <=
- [Qemu-devel] [PATCH 2.1 33/36] qemu-char: move pty_chr_update_read_handler around, Paolo Bonzini, 2014/06/18
- [Qemu-devel] [PATCH 2.1 35/36] monitor: protect outbuf and mux_out with mutex, Paolo Bonzini, 2014/06/18
- [Qemu-devel] [PATCH 2.1 34/36] qemu-char: make writes thread-safe, Paolo Bonzini, 2014/06/18
- [Qemu-devel] [PATCH 2.1 36/36] monitor: protect event emission, Paolo Bonzini, 2014/06/18
- Message not available
- Re: [Qemu-devel] [PATCH 2.1 00/36] Pending monitor patches for 2.1, Luiz Capitulino, 2014/06/19
- Re: [Qemu-devel] [PATCH 2.1 00/36] Pending monitor patches for 2.1, Eric Blake, 2014/06/20