From patchwork Thu Mar 9 22:40:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 1754920 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.a=rsa-sha256 header.s=fm3 header.b=G+qcWFQN; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=r7XOQja9; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PXkhQ1mW4z246R for ; Fri, 10 Mar 2023 09:42:14 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paOwj-0002Zl-1S; Thu, 09 Mar 2023 17:41:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paOwh-0002ZC-5T for qemu-devel@nongnu.org; Thu, 09 Mar 2023 17:41:11 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paOwd-0003mm-Rz for qemu-devel@nongnu.org; Thu, 09 Mar 2023 17:41:10 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5530E5C019A; Thu, 9 Mar 2023 17:41:06 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 09 Mar 2023 17:41:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to; s=fm3; t=1678401666; x=1678488066; bh=zs gf/Mob0CcNqTyKreMrpZmvNoxfdtqo4ThMj9AyQrU=; b=G+qcWFQNQG77Z6pcMC 4YYGLDGmuPmuDc77IQKIJN7u0HdB5awNYQv5lNHFnoRTMuSZbxLSeoFUj+GviN0c aAfIatcnr1dkSiE0W2pWfCQOhOmNpU8i9o0kEaYKtuh/xGfkHB82xdVetKcaOdAF To3Z8MQS2yCXrKnxfhFlgAebnlxTtVd/KEAh7QId2K8abI96et93hisNQteX2EhD NuvDm+VVha090AELvBhOaLOm2XSTeIb9GkUsHy0fqvrHqaqcQjaGdA6tpfoWesbc UHJppd1fhWVhEcW/XV2t2IuOLphB7QjvkdYCdtET1OtcoV2Nzo1iWwYn+Adj+yWa n4cA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1678401666; x=1678488066; bh=zsgf/Mob0CcNq TyKreMrpZmvNoxfdtqo4ThMj9AyQrU=; b=r7XOQja9t6oCzFZWZ8i2F+hAPSgeO 9o4UZ6drYdpvEH7Mw4KlU+TjFvLafqcJ4oAcZs5cFCl2hwUgM6GML9ZXqa8obK48 tOoA4FRPSvoroMmIcAGoyWWRsP8B6ZEIACHXrZKDSrihQjxQBlMOms2323H/VPx7 tYXBuLwY9MA0xqLkOgPIE2/5i+Mvf8gbWfc446YB5TmJ8OyEQpzqfcFMP/qfvRrp WqCU4dzpMUEH0eLNu0Unm6jeWH+iQTUCYKPfsNsAzWo9cKy0j9a7UmBOwNLYt8g4 n1I8avxS3zw+xMLbGKeLFPemoicCOk6mYT31AUMQze/7LSdTbtWXT7k0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddujecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephffvufffkf fogggtgfesthekredtredtjeenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihusegu gihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpefhteevudeihfegkedtudfgleehve evhfevgeeltdehudejueetleekffeliedugfenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Mar 2023 17:41:05 -0500 (EST) From: Daniel Xu To: qemu-devel@nongnu.org, marcandre.lureau@gmail.com, berrange@redhat.com Subject: [PATCH v5 0/3] qga: Support merging output streams in guest-exec Date: Thu, 9 Mar 2023 15:40:55 -0700 Message-Id: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.25; envelope-from=dxu@dxuuu.xyz; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently, the captured output (via `capture-output`) is segregated into separate GuestExecStatus fields (`out-data` and `err-data`). This means that downstream consumers have no way to reassemble the captured data back into the original stream. This is relevant for chatty and semi-interactive (ie. read only) CLI tools. Such tools may deliberately interleave stdout and stderr for visual effect. If segregated, the output becomes harder to visually understand. This patchset adds support for merging stderr and stdout output streams via a backwards compatibile refactor and a new enum variant, `all-merge`. --- Changes from v4: * Rename `all` -> `separated` * Rename `all-merge` -> `merged` Changes from v3: * Split out ASAN fixes into separate patch series * Refactor `capture-output` flag into an enum * Avoid using /bin/bash on windows Changes from v2: * Error out if `merge-output` on windows guests * Add FIXMEs for when glib is updated * Fix memory leaks in qemu-keymap Changes from v1: * Drop invalid test fix * Do not support `merge-output` on windows guests * Fix a UAF in tests Daniel Xu (3): qga: Refactor guest-exec capture-output to take enum qga: Add `merged` variant to GuestExecCaptureOutputMode qga: test: Add tests for `merged` flag qga/commands.c | 68 ++++++++++++++++-- qga/qapi-schema.json | 35 +++++++++- tests/unit/test-qga.c | 158 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 238 insertions(+), 23 deletions(-)