[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_op

From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_open_fd.
Date: Wed, 23 Jul 2008 09:24:13 +0100
User-agent: Mutt/1.4.1i

On Tue, Jul 22, 2008 at 08:26:59PM -0500, Anthony Liguori wrote:
> Hi,
> Ian Jackson wrote:
> >The rest of qemu assumes that IO operations on a CharDriverState do
> >not block.  Currently there are a couple of cases where such a driver
> >was set up but the calls to set nonblocking mode were missing:
> > * qemu_chr_open_pty
> > * qemu_chr_open_pipe
> > * qemu_chr_open_stdio
> >
> >This is fixed by adding two calls to socket_set_nonblock to
> >qemu_chr_open_fd.
> >  
> This changes semantics a bit.  Previously, using a pty would guarantee 
> that data is always written as qemu_chr_write does not perform any sort 
> of buffering.
> Now, that data will be silently dropped instead of causing QEMU to 
> block.  I don't think it's perfectly clear that one behaviour is clearly 
> better than the other.

In the case of the PTY backend, the only time I'd expect data to be dropped
is if there was no active slave open. If an application has the PTY open
and is interacting, then I'd want to get all data.  

My use case is that all VMs started will have a serial port configured
with '-serial pty'. The guest OS should not be blocked when writing to
the serial port if no one has the PTY open on the host, but if someone
attaches to it with 'virsh console' then I want to be guartenteed to 
get all data.

|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

reply via email to

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