From patchwork Mon Sep 18 10:54:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 1836050 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=fm1 header.b=SoQ0BhUA; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=Odl1wdkC; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 4Rq1sX1hZJz1ync for ; Mon, 18 Sep 2023 20:55:12 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiBtp-00051B-M1; Mon, 18 Sep 2023 06:54:41 -0400 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 1qiBto-00050x-Jk for qemu-devel@nongnu.org; Mon, 18 Sep 2023 06:54:40 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qiBtm-0000Ar-RS for qemu-devel@nongnu.org; Mon, 18 Sep 2023 06:54:40 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 9B0F03200564; Mon, 18 Sep 2023 06:54:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 18 Sep 2023 06:54:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1695034474; x=1695120874; bh=6HCr3S0i0x CJSyP8asVJZ843rG5WmihZHN7F3mbDiD0=; b=SoQ0BhUAr/f6H838qCMytd6VF2 Vt5biaro991czBY8EpM4TIWKuscjTByqE3ju6hR8l8C3tP6GKstc0MremiuOtf0e ySzDeUOP2xM7tyxS4fDVR75d2mG06pcxmmCyNlvLTyFCmPzgg99yRL1IUGN2VUHS 3OdTc8i9G79vZq257o0KbzBKcYqMRIY/bPahCvwB5oTEYpDFdVdFZSKbt+AL9Nqv ldJ2WFpx7qVlpaTtoq0iYS/CP3obhY2moQA01jTmTc+L8lQKh/assjsrpGuIcDEi YkCheqn8JGTWJ1suVaT1nJTfIrFszEg+QbDZuZXGI7jCJZzXIo+yWJo/oOQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm2; t=1695034474; x=1695120874; bh=6HCr3S0i0xCJS yP8asVJZ843rG5WmihZHN7F3mbDiD0=; b=Odl1wdkCtb2lgaQb2HyjxJll22v2W GE8wAb2bYalIOFffrMTUElzh6h3ld/lMNVxEtHkvUTtk237w76uK7DGyG2SMU4Io TDtoK61KoFNO+C06xjBO5HZ6HZL37Ihy2bOR/ndQENVNe8YfwDqfdJ4cDGekjg9Q aT7zwiyRx17RANMrLIy0q+uFHjpgUyvmGP1wm3pMtaUI8oOpfBpJwyrqTApD0jDe UzHuepfmEcQVIWqjNUQo2Ub700ucdhm6v119/yPUvZQYpOFWQZQ2yqz/oJCBYlPO pj2Xvn/TY3jer7repTpkzyl9m/Wfc3XQ5i7Y95GKbuGUDFepzkg4e6s/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejkedgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceougig uhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepvdeggfetgfelhefhueefke duvdfguedvhfegleejudduffffgfetueduieeikeejnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Sep 2023 06:54:32 -0400 (EDT) From: Daniel Xu To: qemu-devel@nongnu.org, berrange@redhat.com Cc: hmodi@aviatrix.com Subject: [PATCH 0/3] qga: Add optional stream-output argument to guest-exec Date: Mon, 18 Sep 2023 04:54:20 -0600 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.24; envelope-from=dxu@dxuuu.xyz; helo=wout1-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, 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, commands run through guest-exec are "silent" until they finish running. This is fine for short lived commands. But for commands that take a while, this is a bad user experience. Usually long running programs know that they will run for a while. To improve user experience, they will typically print some kind of status to output at a regular interval. So that the user knows that their command isn't just hanging. This patchset adds support for an optional stream-output parameter to guest-exec. This causes subsequent calls to guest-exec-status to return all buffered output. This allows downstream applications to be able to relay "status" to the end user. I also uncovered a latent memory leak bug with the added unit test. The fix is in commit 1. Daniel Xu (3): qga: Fix memory leak when output stream is unused qga: Add optional stream-output argument to guest-exec qga: test: Add test for guest-exec stream-output qga/commands.c | 16 +++++++-- qga/qapi-schema.json | 7 +++- tests/unit/test-qga.c | 77 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 3 deletions(-)