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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

>> +                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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]