<html><body>
<p><font size="2" face="sans-serif">Hi Eric,</font><br>
<br>
<font size="2" face="sans-serif">Thanks for continuing work on this.</font><br>
<br>
<font size="2" face="sans-serif">To repeat my test:</font><br>
<font size="2" face="sans-serif">Make a small disk image (50MB) and mount it at /usr/local/var/lib/libvirt/qemu/save/.</font><br>
<font size="2" face="sans-serif">Then attempt to managed save a guest whose memory is larger, say 256MB.</font><br>
<font size="2" face="sans-serif">The image will quickly fill and you should see the "Unexpected Error" message but nothing more.</font><br>
<br>
<font size="2" face="sans-serif">I was unable to get any meaningful error info from iohelper. I'll try your "goodbye world" patch and see what I get. Things might get interesting if my result is different :).</font><br>

<ul style="padding-left: 18pt"><font size="2" face="sans-serif">- Jason J. Herne<br>
z/VM CP Development<br>
IBM Corporation, Endicott, NY <br>
Email - jjherne@us.ibm.com<br>
Phone 607-429-5136 or tie-line 620-5136 </font></ul>
<br>
<img width="16" height="16" src="cid:1__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for Eric Blake ---07/16/2014 07:57:47 PM---On 07/16/2014 05:20 PM, Eric Blake wrote: > But if I then rewo"><font size="2" color="#424282" face="sans-serif">Eric Blake ---07/16/2014 07:57:47 PM---On 07/16/2014 05:20 PM, Eric Blake wrote: > But if I then rework the iohelper patch:</font><br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">From:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">Eric Blake <eblake@redhat.com></font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">To:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">Jason Herne/Endicott/IBM@IBMUS, libvir-list@redhat.com, </font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Date:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">07/16/2014 07:57 PM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Subject:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=08BBF7B6DFDE621F8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">Re: [libvirt] [PATCH] Fix reporting of i/o errors by iohelper process</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">On 07/16/2014 05:20 PM, Eric Blake wrote:<br>
<br>
> But if I then rework the iohelper patch:<br>
> <br>
> diff --git i/src/util/iohelper.c w/src/util/iohelper.c<br>
> index 8a3c377..efb1366 100644<br>
> --- i/src/util/iohelper.c<br>
> +++ w/src/util/iohelper.c<br>
> @@ -301,6 +301,7 @@ main(int argc, char **argv)<br>
>          exit(EXIT_FAILURE);<br>
>      }<br>
> <br>
> +    fprintf(stderr, _("goodbye world\n")); goto error;<br>
>      if (fd < 0 || runIO(path, fd, oflags, length) < 0)<br>
>          goto error;<br>
> <br>
> <br>
> the error is now:<br>
> <br>
> error: Failed to save domain testvm1 to /tmp/save<br>
> error: operation failed: domain save job: unexpectedly failed<br>
<br>
and with your patch, I see:<br>
<br>
error: Failed to save domain testvm1 to /tmp/save<br>
error: internal error: Child process (LIBVIRT_LOG_OUTPUTS=1:stderr<br>
/home/eblake/libvirt/src/libvirt_iohelper /tmp/save 0 1) unexpected exit<br>
status 1: goodbye world<br>
/home/eblake/libvirt/src/libvirt_iohelper: unknown failure with /tmp/save<br>
<br>
on the console, but this longer spew in libvirt's log:<br>
<br>
2014-07-16 23:34:23.855+0000: 25406: error :<br>
qemuMigrationUpdateJobStatus:1788 : operation failed: domain save job:<br>
unexpectedly failed<br>
2014-07-16 23:34:23.857+0000: 25406: error : virCommandWait:2423 :<br>
internal error: Child process (LIBVIRT_LOG_OUTPUTS=1:stderr<br>
/home/eblake/libvirt/src/libvirt_iohelper /tmp/save 0 1) unexpected exit<br>
status 1: goodbye world<br>
/home/eblake/libvirt/src/libvirt_iohelper: unknown failure with /tmp/save<br>
<br>
2014-07-16 23:34:23.857+0000: 25406: warning : virFileWrapperFdClose:326<br>
: iohelper reports: goodbye world<br>
/home/eblake/libvirt/src/libvirt_iohelper: unknown failure with /tmp/save<br>
<br>
<br>
so the act of closing the wrapperfd is losing the earlier error message<br>
from being reported to the user (seems okay in this case, but might not<br>
always be), AND logging the stderr contents twice (once via the error<br>
reported to the user, and again due to a VIR_WARN).<br>
<br>
> <br>
> So the problem is that we have _two_ possible sources of errors (qemu<br>
> reporting failure because it can't write to iohelper, and iohelper<br>
> reporting an error from whatever other reason, such as disk full).  If<br>
> qemu finishes, we have only the iohelper message and properly report it;<br>
> but if we have both failures, then the qemu error takes priority, and in<br>
> this case it is lower priority.  There are also cases where qemu will<br>
> error out but iohelper succeeds (such as if qemu refuses to migrate<br>
> because the guest has hostdev passthrough).<br>
> <br>
> So I _think_ what we want to do is always check BOTH places for error;<br>
> if only one of the two fails, use that message.  If both fail, then I<br>
> don't know whether it is possible to have a heuristic for which failure<br>
> message is more meaningful, or whether it is better to report both<br>
> errors (even though it will often be the case that one error was a<br>
> knock-on effect from the other).  But I'm a bit stuck on the best way to<br>
> implement that.<br>
<br>
I'm still thinking about the best solution<br>
<br>
-- <br>
Eric Blake   eblake redhat com    +1-919-301-3266<br>
Libvirt virtualization library </font></tt><tt><font size="2"><a href="http://libvirt.org">http://libvirt.org</a></font></tt><tt><font size="2"><br>
<br>
[attachment "signature.asc" deleted by Jason Herne/Endicott/IBM] </font></tt><br>
<br>
</body></html>