From 25a5ea09653d87c01db10c045324cc414067bc87 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 20 Feb 2007 19:54:00 +0000 Subject: [PATCH] allow tfd to override stderr/stdout --- doc/README.virtualisation-server | 3 +++ virt-subproc/VirtSubproc.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/doc/README.virtualisation-server b/doc/README.virtualisation-server index 1bb7766..3c3835d 100644 --- a/doc/README.virtualisation-server +++ b/doc/README.virtualisation-server @@ -112,6 +112,9 @@ Protocol If this feature is available, execute-debug will be advertised. Only one such plumbing is available. + may be 1 or 2, in which case no output will + be written to the or files. + * Commands copydown copyup diff --git a/virt-subproc/VirtSubproc.py b/virt-subproc/VirtSubproc.py index 2c5e4f6..71b7725 100644 --- a/virt-subproc/VirtSubproc.py +++ b/virt-subproc/VirtSubproc.py @@ -158,11 +158,13 @@ def cmd_execute(c, ce): gobody = " import sys\n" stdout = None + tfd = None if debug_g: (tfd,hfd) = m.groups() gobody += " os.dup2(1,%d)\n" % int(tfd) stdout = int(hfd) for ioe in range(3): + if ioe == tfd: continue gobody += " setfd(%d,'%s',%d)\n" % ( ioe, ce[ioe+2], ioe>0 ) gobody += " os.chdir(urllib.unquote('" + ce[5] +"'))\n" -- 2.30.2