[libvirt] [PATCH 16/16] command: Report stdout/stderr if command fails

Eric Blake eblake at redhat.com
Wed May 11 21:58:00 UTC 2011


On 05/11/2011 04:38 AM, Daniel P. Berrange wrote:
> On Tue, May 10, 2011 at 04:07:55PM -0400, Cole Robinson wrote:
>> Just reporting the exit status isn't all that enlightening most of the
>> time. This makes the message pretty wordy, but it will reduce user confusion
>> for many errors.
>>
>> Signed-off-by: Cole Robinson <crobinso at redhat.com>

>> +                virCommandError(VIR_ERR_INTERNAL_ERROR,
>> +                        _("Child process (%s) status unexpected: %s\n%s%s"),
>> +                        cmdstr ? cmdstr: cmd->args[0], statusstr,
>> +                        (out && *out) ? outstr : "",
>> +                        (err && *err) ? errstr : "");
>> +            }
>> +
>> +            VIR_FREE(outstr);
>> +            VIR_FREE(errstr);
>> +            VIR_FREE(cmdstr);
>> +            VIR_FREE(statusstr);
>>              return -1;
>>          }
>>      } else {
> 
> Hmm, the stdout/stderr output can be pretty huge for many commands
> that we run. eg, qemu -help failing could result it a 250 line
> error message.

Could we trim it to just report the first line or two of both output and
error?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110511/18d87f09/attachment-0001.sig>


More information about the libvir-list mailing list