[Libguestfs] [PATCH] guestfish: Redirect stdout when executing remote commands

Matthew Booth mbooth at redhat.com
Mon Sep 14 09:12:24 UTC 2009


On 12/09/09 11:03, Richard W.M. Jones wrote:
> On Fri, Sep 11, 2009 at 05:13:15PM +0100, Matthew Booth wrote:
>> guestfish --listen necessarily redirects its stdout to /dev/null so
>> as not to interfere with eval. The remote protocol doesn't contain
>> any other provision for collecting stdout for the caller, so
>> executing guestfish --remote will never generate any output.
>>
>> This patch fixes that by forwarding the caller's STDOUT to the
>> listener over the unix socket connection. The listener redirects its
>> STDOUT to the caller's STDOUT for the duration of the command, then
>> closes it again.
>
> This is a clever use of sockets.  However I can't accept the patch
> unless it contains some tests.  Luckily this should be easy to test by
> dropping some shell script(s) into regressions/

Ok. I added a new test to the existing test-remote.sh. Patch posted.

Matt
-- 
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

M:       +44 (0)7977 267231
GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490




More information about the Libguestfs mailing list