diff mbox series

[2/2] qapi: qga: Clarify when out-data and err-data are populated

Message ID 935735389830bbe8407d95ebf89632792bf11a30.1696185261.git.dxu@dxuuu.xyz
State New
Headers show
Series Small fixes for qga | expand

Commit Message

Daniel Xu Oct. 1, 2023, 6:38 p.m. UTC
If output is being captured for a guest-exec invocation, the out-data
and err-data fields of guest-exec-status are only populated after the
process is reaped. This is somewhat counter intuitive and too late to
change. Thus, it would be good to document the behavior.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 qga/qapi-schema.json | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Konstantin Kostiuk Oct. 1, 2023, 7:18 p.m. UTC | #1
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Sun, Oct 1, 2023 at 9:39 PM Daniel Xu <dxu@dxuuu.xyz> wrote:

> If output is being captured for a guest-exec invocation, the out-data
> and err-data fields of guest-exec-status are only populated after the
> process is reaped. This is somewhat counter intuitive and too late to
> change. Thus, it would be good to document the behavior.
>
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> ---
>  qga/qapi-schema.json | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
> index b720dd4379..876e2a8ea8 100644
> --- a/qga/qapi-schema.json
> +++ b/qga/qapi-schema.json
> @@ -1220,11 +1220,13 @@
>  # @signal: signal number (linux) or unhandled exception code (windows)
>  #     if the process was abnormally terminated.
>  #
> -# @out-data: base64-encoded stdout of the process
> +# @out-data: base64-encoded stdout of the process. This field will only
> +#     be populated after the process exits.
>  #
> -# @err-data: base64-encoded stderr of the process Note: @out-data and
> +# @err-data: base64-encoded stderr of the process. Note: @out-data and
>  #     @err-data are present only if 'capture-output' was specified for
> -#     'guest-exec'
> +#     'guest-exec'. This field will only be populated after the process
> +#     exits.
>  #
>  # @out-truncated: true if stdout was not fully captured due to size
>  #     limitation.
> --
> 2.42.0
>
>
Markus Armbruster Oct. 13, 2023, 1:26 p.m. UTC | #2
Daniel Xu <dxu@dxuuu.xyz> writes:

> If output is being captured for a guest-exec invocation, the out-data
> and err-data fields of guest-exec-status are only populated after the
> process is reaped. This is somewhat counter intuitive and too late to
> change. Thus, it would be good to document the behavior.
>
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> ---
>  qga/qapi-schema.json | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
> index b720dd4379..876e2a8ea8 100644
> --- a/qga/qapi-schema.json
> +++ b/qga/qapi-schema.json
> @@ -1220,11 +1220,13 @@
>  # @signal: signal number (linux) or unhandled exception code (windows)
>  #     if the process was abnormally terminated.
>  #
> -# @out-data: base64-encoded stdout of the process
> +# @out-data: base64-encoded stdout of the process. This field will only
> +#     be populated after the process exits.
>  #
> -# @err-data: base64-encoded stderr of the process Note: @out-data and
> +# @err-data: base64-encoded stderr of the process. Note: @out-data and
>  #     @err-data are present only if 'capture-output' was specified for
> -#     'guest-exec'
> +#     'guest-exec'. This field will only be populated after the process
> +#     exits.
>  #
>  # @out-truncated: true if stdout was not fully captured due to size
>  #     limitation.

Two spaces between sentences for consistency, please.

With that:
Acked-by: Markus Armbruster <armbru@redhat.com>
diff mbox series

Patch

diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index b720dd4379..876e2a8ea8 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -1220,11 +1220,13 @@ 
 # @signal: signal number (linux) or unhandled exception code (windows)
 #     if the process was abnormally terminated.
 #
-# @out-data: base64-encoded stdout of the process
+# @out-data: base64-encoded stdout of the process. This field will only
+#     be populated after the process exits.
 #
-# @err-data: base64-encoded stderr of the process Note: @out-data and
+# @err-data: base64-encoded stderr of the process. Note: @out-data and
 #     @err-data are present only if 'capture-output' was specified for
-#     'guest-exec'
+#     'guest-exec'. This field will only be populated after the process
+#     exits.
 #
 # @out-truncated: true if stdout was not fully captured due to size
 #     limitation.