On 10/24/2012 09:49 AM, Michal Privoznik wrote:
Currently, we use iohelper when saving/restoring a domain.
However, if there's some kind of error (like I/O) it is not
propagated to libvirt. Since it is not qemu who is doing
the actual write() it will not get error. The iohelper does.
Therefore we should check for iohelper errors as it makes
libvirt more user friendly.
---
diff to v1:
-incorporate the event loop to read iohelper's stderr
@@ -3282,9 +3283,11 @@ doCoreDump(struct qemud_driver *driver,
+ /* deliberately don't use virCommandNonblockingFDs here as it is all or
+ * nothing. And we want iohelper's stdin to block. */
+ if (virSetNonBlock(ret->err_fd) < 0) {
This comment is confusing, since you say we don't use nonblocking and
then immediately set our side of stderr to nonblocking. Maybe you meant
to say that we leave helper's stdin or stdout alone (default blocking)
because they are not tied to our event loop, but set our side of stderr
to be nonblocking so we can read it from our event loop.
ACK once you fix up that comment.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org