On 03/14/2012 07:19 AM, Alon Levy wrote: >> Also, when returning the image via fd, we could offload its writing to >> a bh. This would give us a poor man's async support, where the biggest >> drawback would the lack of error detection (can this operation fail anyway?). >> > > It leaves detection of completion up to the user, so inotify / parsing > the file to see if it's complete (header says size X, but file is still > Y<X, not done..), which looks like as big a drawback.
Notification on a pipe is easy - the reader gets EOF when the writer closes the fd, with no need to use inotify. The only remaining issue is whether the writer closes the fd early on error, so that the reader gets an incomplete file. But then the client can tell after getting EOF whether the image file is complete (read the header, final file size is too small), without having to have the intermediate management app parsing headers during the streaming, although it would be a bonus if there were a way to tell the management app that an error occurred and qemu closed the write end early. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature