[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: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_open_fd.
Date: Wed, 23 Jul 2008 13:43:12 +0200
User-agent: Thunderbird (X11/20071114)

Ian Jackson schrieb:
> Kevin Wolf writes ("Re: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode 
> for      qemu_chr_open_fd."):
>> +    if (strstart(filename, "nonblock:", &filename))
>> +        block = 0;
> This is definitely wrong, because the need for (non)blocking behaviour
> is determined statically by the code which is using the driver.

It is better than what we have today because I can set non-blocking mode
if I don't want to open the pty immediately and I can set blocking mode
whenever I don't want to lose data and I'm sure to attach to the pty.
This is a decision which your code cannot make statically but one which
is influenced by which behaviour the user wants to have.

Of course, you can always say "we can do even better". But as long as
you don't provide code for non-blocking mode where all data is
guaranteed to be delivered (and still works with a limited buffer...),
it is reasonable to let the user decide.

> Perhaps there should be two writing interfaces, qemu_chr_write and
> qemu_chr_write_(non)block.

And which one will be used if you don't want the user to decide?


reply via email to

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