qemu-devel
[Top][All Lists]
Advanced

[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: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_open_fd.
Date: Wed, 23 Jul 2008 14:04:50 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Kevin Wolf wrote:
> Anthony Liguori schrieb:
>> 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.
> 
> Then we need both.
> 
> Add an option to specify non-blocking mode for stdio, pty and pipe in
> qemu_chr_open.  Blocking mode is used by default (maintaining current
> semantics), non-blocking mode if the name is prefixed with nonblock:

Doing that as config option is pusing the problem to the user and a
quite lame way to address the problem.

The IMHO best solution is to send data only if someone is connected to
the slave device (assuming we find a way to figure that).

Independant of that I think the char devices should move to non-blocking
operation.  That depends on the callers being able to handle
qemu_chr_write() doing partial writes and -EAGAIN failures though.
xenconsole code is doing fine here for example, but others probably
depend on the current behavior.  So it should probably the device
emulation code which decides whenever it can run in non-blocking mode or
not.

cheers,
  Gerd

-- 
http://kraxel.fedorapeople.org/xenner/




reply via email to

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