diff options
author | Daniel Xu <dxu@dxuuu.xyz> | 2023-03-22 18:19:26 -0600 |
---|---|---|
committer | Konstantin Kostiuk <kkostiuk@redhat.com> | 2023-05-04 09:12:48 +0000 |
commit | 9c5ccc52abe3977be53e42af84a6e590b3e1db19 (patch) | |
tree | 6a4b963a45d7375c02bee6bb9401155710071213 /qga/qapi-schema.json | |
parent | 5a954e0221376e568b1419b6e120af0be83d78bb (diff) | |
download | qemu-9c5ccc52abe3977be53e42af84a6e590b3e1db19.zip qemu-9c5ccc52abe3977be53e42af84a6e590b3e1db19.tar.gz qemu-9c5ccc52abe3977be53e42af84a6e590b3e1db19.tar.bz2 |
qga: Refactor guest-exec capture-output to take enum
Previously capture-output was an optional boolean flag that either
captured all output or captured none. While this is OK in most cases, it
lacks flexibility for more advanced capture cases, such as wanting to
only capture stdout.
This commits refactors guest-exec qapi to take an enum for capture mode
instead while preserving backwards compatibility.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Diffstat (limited to 'qga/qapi-schema.json')
-rw-r--r-- | qga/qapi-schema.json | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 6a20eeb..44e44c2 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -1201,6 +1201,37 @@ 'data': { 'pid': 'int'} } ## +# @GuestExecCaptureOutputMode: +# +# An enumeration of guest-exec capture modes. +# +# @none: do not capture any output +# @stdout: only capture stdout +# @stderr: only capture stderr +# @separated: capture both stdout and stderr, but separated into +# GuestExecStatus out-data and err-data, respectively +# +# Since: 8.0 +## + { 'enum': 'GuestExecCaptureOutputMode', + 'data': [ 'none', 'stdout', 'stderr', 'separated' ] } + +## +# @GuestExecCaptureOutput: +# +# Controls what guest-exec output gets captures. +# +# @flag: captures both stdout and stderr if true. Equivalent +# to GuestExecCaptureOutputMode::all. (since 2.5) +# @mode: capture mode; preferred interface +# +# Since: 8.0 +## + { 'alternate': 'GuestExecCaptureOutput', + 'data': { 'flag': 'bool', + 'mode': 'GuestExecCaptureOutputMode'} } + +## # @guest-exec: # # Execute a command in the guest @@ -1218,7 +1249,7 @@ ## { 'command': 'guest-exec', 'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'], - '*input-data': 'str', '*capture-output': 'bool' }, + '*input-data': 'str', '*capture-output': 'GuestExecCaptureOutput' }, 'returns': 'GuestExec' } |