qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 0/8] (v2) chardev, virtio-console: flow cont


From: Paul Brook
Subject: Re: [Qemu-devel] Re: [PATCH 0/8] (v2) chardev, virtio-console: flow control, error handling, fixes
Date: Mon, 12 Apr 2010 12:42:49 +0100
User-agent: KMail/1.12.4 (Linux/2.6.33-2-amd64; KDE/4.3.4; x86_64; ; )

> >> The qemu chardevs can now return -EAGAIN when a non-blocking remote
> >> isn't ready to accept more data.
> >>
> >> Comments?
> >
> > This is a major change in semantics. Are you sure all users handle this
> > correctly? My guess is that most of the devices don't.
> 
> I don't expect trouble here.  EAGAIN is returned only for file handles
> in non-blocking mode.  I doubt existing users use non-blocking I/O as
> this makes the current unix_write() code go busy-loop in case the
> outgoing pipe is full.

I'm pretty sure existing devices emulation assumes qemu_chr_write either fully 
completes or fails with an error. Whether a FD is nonblocking is determined by 
the backend used to implement the chardev, not the emulated device using the 
chardev.

For the device emulation side of the API, unix write() semantics are IMO a bad 
solution.  What we really want is an API for posting asynchronous writes.

Paul




reply via email to

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