Daniel P. Berrange wrote:
There are several system calls in the virExec function for which we
don't
or can't report errors. This patch does a couple of things to improve the
situation. It moves the code for setting non-block/close-exec to before the
fork() so we can report errors for it. It removes the 'dom' and 'net'
params
from the ReportError function since we deprecated those long ago and all
callers simply pass in NULL. It resets the 'virErrorHandler' callback to
NULL in the child, so that errors raised will get reported to stderr
instead of invoking a callback which is likely no longer valid in the child
process. It reports failures to exec the binary and dup file descriptors.
All errors in the child will end up on stderr, so they will at least be
visible on the parent's console, or a logfile if one was setup for the
child. Previously there would just be silent failure.
Daniel
Related question: is there any practical way to return error output
from a virRun command in a libvirt error message?
In testing some of the storage code I hit a few bugs where we improperly
called out to another app, and the raised libvirt error had no output.
I would have to manually run libvirtd and watch what output the commands
dumped.
I guess the other option would be to set up log files for the different
storage operations similar to how qemu domain logfiles work, or maybe
just a general libvirtd output log.
- Cole