From patchwork Tue Feb 28 20:48:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 1749612 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=rghP0hRT; 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=P5iDzJ8H; 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 4PR8ch5zw2z2468 for ; Wed, 1 Mar 2023 07:49:40 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX6tc-0000u6-JP; Tue, 28 Feb 2023 15:48:24 -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 1pX6tZ-0000tB-5Y for qemu-devel@nongnu.org; Tue, 28 Feb 2023 15:48:21 -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 1pX6tX-0006ZP-MR for qemu-devel@nongnu.org; Tue, 28 Feb 2023 15:48:20 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4F0AF5C01C2; Tue, 28 Feb 2023 15:48:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 28 Feb 2023 15:48:18 -0500 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:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1677617298; x= 1677703698; bh=HIHkUaAmd5J5Zb5kIv9UKGwuKi6dQDwTNzuIX4wlNzo=; b=r ghP0hRTCtRE08E/pghD1fsvyFGoO2WN08Ej5oU2kYPThFuOeE8GlgDwaSDo5ivdp BFBBa7+WZ0BpktlsMifP5DMBN73CaVEkMVzpG4F0rmH+fCODdPbujufYviodMW9Z 8WFJ4HG/fykMcRTCNgyBr0B4cQ4wceaechqCxtmAYpaB/vb6JXxdDiD9VeW8mg8m DyEWuOUxaZ3c/1X/ZTBxx563pPoNsvYuzRFOVfQEORojz6cTd0sfPUqHR2hGs5bE PqiFoK6IDwIb6HvSM6EYe0cUtNwn2ZuHuWQq8SLd50W+D0PF2q9Uvy1t1BhIhcJE HHgZVPlffBcCOyQhp3nig== 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:in-reply-to:message-id:mime-version:references :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=1677617298; x= 1677703698; bh=HIHkUaAmd5J5Zb5kIv9UKGwuKi6dQDwTNzuIX4wlNzo=; b=P 5iDzJ8Hvhys1nGci+jkYXEaDpOzMK/iilAewb2DsBcKZrFfZqqc0CDyCiP8iSevC 8mUdOTKXN3+Cl3xo3sJiE4QF0EqqusoaFgZ/DX/3DIHufm0EDKlN3aR5YgBCONxq Z4ARZez0qiG27gtjzAzigL5KUdxPV8zKrd5WB24qN9+YOdtjLNChcCVHkaENTg6J jvokF2CY8069ezEi69/dajg5AlWiehXaSl0Fbky/mcN97dYYN02zG2akjMAt6CkR uU3Y5IkBhPmFCiODTyQjkhnQVxWRUQ8+Jm1xnKYh6qP6bQiyF1+anovpKvoxa8gS DBwdtAYHSQzFdawu5AgWA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudelfedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpefhvfevufffkffojghfgggtgfesthekredt redtjeenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqe enucggtffrrghtthgvrhhnpeetheekkefggfeivedvtefgleeiffdtleegfeeuledvuddt vdduhfekgfdutdevkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Feb 2023 15:48:17 -0500 (EST) From: Daniel Xu To: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_marcandre_=2E_lureau_=40_gmail_=2E_c?= =?utf-8?q?om?= Cc: qemu-devel@nongnu.org Subject: [PATCH v3 1/4] crypto/luks: Initialize stack variable to silence warning Date: Tue, 28 Feb 2023 13:48:01 -0700 Message-Id: <7d55ac8f0d021d39809298cac2f13f3826c284c8.1677617035.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: 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.001, RCVD_IN_MSPIKE_WL=0.001, 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 With `../configure --enable-sanitizers`, I was getting the following build error: In file included from /usr/include/string.h:535, from /home/dxu/dev/qemu/include/qemu/osdep.h:99, from ../crypto/block-luks.c:21: In function ‘memset’, inlined from ‘qcrypto_block_luks_store_key’ at ../crypto/block-luks.c:843:9: /usr/include/bits/string_fortified.h:59:10: error: ‘splitkeylen’ may be used uninitialized [-Werror=maybe-uninitialized] 59 | return __builtin___memset_chk (__dest, __ch, __len, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | __glibc_objsize0 (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ../crypto/block-luks.c: In function ‘qcrypto_block_luks_store_key’: ../crypto/block-luks.c:699:12: note: ‘splitkeylen’ was declared here 699 | size_t splitkeylen; | ^~~~~~~~~~~ cc1: all warnings being treated as errors The function is actually correct -- in the cleanup branch `splitkeylen` usage is guarded by checking `splitkey` nullness. But the compiler is not smart enough to realize that. Fix warning by initializing the variable. Signed-off-by: Daniel Xu Reviewed-by: Daniel P. Berrangé --- crypto/block-luks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/block-luks.c b/crypto/block-luks.c index 5688783ab1..bfdef25c80 100644 --- a/crypto/block-luks.c +++ b/crypto/block-luks.c @@ -696,7 +696,7 @@ qcrypto_block_luks_store_key(QCryptoBlock *block, QCryptoBlockLUKS *luks = block->opaque; QCryptoBlockLUKSKeySlot *slot; g_autofree uint8_t *splitkey = NULL; - size_t splitkeylen; + size_t splitkeylen = 0; g_autofree uint8_t *slotkey = NULL; g_autoptr(QCryptoCipher) cipher = NULL; g_autoptr(QCryptoIVGen) ivgen = NULL; From patchwork Tue Feb 28 20:48:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 1749611 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=HqZ6W/J9; 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=eYaYvlPV; 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 4PR8c60Yvkz245t for ; Wed, 1 Mar 2023 07:49:08 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX6tb-0000ti-7U; Tue, 28 Feb 2023 15:48:23 -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 1pX6tY-0000t7-Vj for qemu-devel@nongnu.org; Tue, 28 Feb 2023 15:48:21 -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 1pX6tX-0006ZZ-EY for qemu-devel@nongnu.org; Tue, 28 Feb 2023 15:48:20 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id ED48B5C00DF; Tue, 28 Feb 2023 15:48:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 28 Feb 2023 15:48:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1677617298; x=1677703698; bh=T4 DxE5/RjZ3mZ8CLqsE3AN6GYnJeLsyPZHiKvoacSss=; b=HqZ6W/J9saKyXG6H8F 6hrq8EQfr5V8cKyHpC/lyW/0yVSf4vzjsXAgFubwZw3whvC3ZX3tfBHzkrLspoLQ 45PKoCbQ6gknfLTAs1Qa/GPjVjVIlnROtBl3TrwfB3KvOU20grSmAoUvW43GZ7kO SMUYY1oTHhinAmzLoewnyxAoQThML9JcILeT+JtxadeXbsJ/oqSpv62K4J0My5e7 JHQa++6ONwQ+hSUdh+roA5mWqecvKr8ogbR/dGfJbXTZgqXH74obWQtfmgwcKrcG oZaG/vS+7K97eZRhco3IwibDrK+HEwlUf/+MZZx91mY+tS9sxJm8nFFfxHrjRiV+ MT4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references: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=1677617298; x=1677703698; bh=T4DxE5/RjZ3mZ 8CLqsE3AN6GYnJeLsyPZHiKvoacSss=; b=eYaYvlPVqQbtAxWH/MqM3qsFbJ1GI OKQuOnEBYJNRGbLLoyDT7jfLRBLShmChhkdoS8ZrXuQAkbuGugXteLqa836DFP3L sEOX6sEU9SE2GD1LhIlZujasuKl58boM51wVzJbEzii2h5+FDZ6Gog960kqC/S2K 6OzfQZWLN4zQ4aJdfflxGvzNGGq7Idj6vOfeNQ8tKCT0Rid/4FgL/B2dT3nDibC1 Cwbza8v14YGEEE4JsMzIDv3Su+adxuYEFW4Kuj2Mop3or+9NMkqO8tT/LNlSuYmh wnTso/CTF2ukfw2ebrCb4hJBc8xO7QlLpF6CkIy5Hgq2dpHOIKj5hvBBg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudelfedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Feb 2023 15:48:18 -0500 (EST) From: Daniel Xu To: marcandre.lureau@gmail.com Cc: qemu-devel@nongnu.org Subject: [PATCH v3 2/4] qemu-keymap: Fix memory leaks Date: Tue, 28 Feb 2023 13:48:02 -0700 Message-Id: <3f1aaa1fb5b5fa6daaf4e0080faeb4b094030a06.1677617035.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: 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.001, RCVD_IN_MSPIKE_WL=0.001, 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 When building with `--enable-sanitizers`, I was getting quite a few memory leak crashes from ASAN: [21/574] Generating pc-bios/keymaps/fr-ch with a custom command FAILED: pc-bios/keymaps/fr-ch /home/dxu/dev/qemu/build/qemu-keymap -f pc-bios/keymaps/fr-ch -l ch -v fr ================================================================= ==3232549==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1424 byte(s) in 1 object(s) allocated from: #0 0x7f32636bf411 in __interceptor_calloc /usr/src/debug/gcc/gcc/... #1 0x7f32635db73e (/usr/lib/libxkbcommon.so.0+0x2273e) Fix leaks by correctly decrementing refcounts on xkb structs. Signed-off-by: Daniel Xu Reviewed-by: Marc-André Lureau --- qemu-keymap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qemu-keymap.c b/qemu-keymap.c index 229866e004..ed8cee3467 100644 --- a/qemu-keymap.c +++ b/qemu-keymap.c @@ -203,6 +203,7 @@ int main(int argc, char *argv[]) map = xkb_keymap_new_from_names(ctx, &names, XKB_KEYMAP_COMPILE_NO_FLAGS); if (!map) { /* libxkbcommon prints error */ + xkb_context_unref(ctx); exit(1); } @@ -227,7 +228,11 @@ int main(int argc, char *argv[]) state = xkb_state_new(map); xkb_keymap_key_for_each(map, walk_map, state); xkb_state_unref(state); + xkb_keymap_unref(map); + xkb_context_unref(ctx); state = NULL; + map = NULL; + ctx = NULL; /* add quirks */ fprintf(outfile, From patchwork Tue Feb 28 20:48:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 1749613 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=tNtiYcWS; 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=UqFQJ3nx; 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 4PR8ch2jvhz245t for ; Wed, 1 Mar 2023 07:49:40 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX6td-0000ug-7E; Tue, 28 Feb 2023 15:48:25 -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 1pX6ta-0000tU-HG for qemu-devel@nongnu.org; Tue, 28 Feb 2023 15:48:22 -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 1pX6tY-0006Zm-2H for qemu-devel@nongnu.org; Tue, 28 Feb 2023 15:48:22 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 962AF5C01F5; Tue, 28 Feb 2023 15:48:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 28 Feb 2023 15:48:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1677617299; x=1677703699; bh=6h 6xHiz+RMWsiNN43+3teHwnGSIws54LO/VhKcbgmS0=; b=tNtiYcWSdhkAaAcuTR GxqeVfcDmCnG3PP2uZmp5xgeG1Kdyvw8MWt3WkJCorvKKlE4u6gXhJFQZYhu/q5F LHAgKGafGhIMQ2JtkkojFmraXktmyHdEyeAzZlj1ohgacArZDhW1qKvCnUDOUTvZ YtdlzuRxjCUn9bfBMz2Z5k34ntotpXojwWrS9LjbVU6sCNVKm/Mhro5s0jSEnvc0 OX1eYzFJ3hi5QTtPw202aUIGabnJC2f26tcJnj/Swi4STFqgIg+f/sqSNVuFp+NM DLco0Wk/bb/hgfUEwymhjj1D/g/vUkE61NsiZzXUdhYGTurBzllhM5/nmGYiPYdh AaLg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references: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=1677617299; x=1677703699; bh=6h6xHiz+RMWsi NN43+3teHwnGSIws54LO/VhKcbgmS0=; b=UqFQJ3nxYPnoMw+8pacijka4Bt6+S L3N7F5JHwyCd17lPDTbj6o8reMk0y8xQyTSKp9SK7/+7oWIoIIYFSxF3brJWKuvV q+w0+EK+o9jkJodXXvGu/EnDA9DXQKOzLkSVvqu/X1k81I5OQ9uMlrhbvbaCA2KR imzEXT0hcIae4CoRqzkNLMAE8Nijc9t58pcG2+ouDH8i2vbhFV2tzHqgIqbcX5Xv EA43Ak9USq+N323Aiaxb7XX7EaOJz8qKN8hsghlklIPOzmReHaXyLmWmz+Pk6YRe dc0oesR6GSZeMOujo1DLK3ADljAFfJuX8xoRNcuabrfksuBR14eRIuq7Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudelfedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Feb 2023 15:48:19 -0500 (EST) From: Daniel Xu To: michael.roth@amd.com, kkostiuk@redhat.com, marcandre.lureau@gmail.com Cc: qemu-devel@nongnu.org Subject: [PATCH v3 3/4] qga: Add optional `merge-output` flag to guest-exec qapi Date: Tue, 28 Feb 2023 13:48:03 -0700 Message-Id: <1575b08b853385eeaec6159b88b8c66525baec65.1677617035.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: 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.001, RCVD_IN_MSPIKE_WL=0.001, 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 commit adds a new optional flag to the guest-exec qapi to merge the output streams such that consumers can have a pristine view of the original command output. Signed-off-by: Daniel Xu --- qga/commands.c | 28 ++++++++++++++++++++++++++-- qga/qapi-schema.json | 6 +++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/qga/commands.c b/qga/commands.c index 172826f8f8..cfce13d034 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -270,12 +270,26 @@ static void guest_exec_child_watch(GPid pid, gint status, gpointer data) g_spawn_close_pid(pid); } -/** Reset ignored signals back to default. */ static void guest_exec_task_setup(gpointer data) { #if !defined(G_OS_WIN32) + bool has_merge = *(bool *)data; struct sigaction sigact; + if (has_merge) { + /* + * FIXME: When `GLIB_VERSION_MIN_REQUIRED` is bumped to 2.58+, use + * g_spawn_async_with_fds() to be portable on windows. The current + * logic does not work on windows b/c `GSpawnChildSetupFunc` is run + * inside the parent, not the child. + */ + if (dup2(STDOUT_FILENO, STDERR_FILENO) != 0) { + slog("dup2() failed to merge stderr into stdout: %s", + strerror(errno)); + } + } + + /* Reset ignored signals back to default. */ memset(&sigact, 0, sizeof(struct sigaction)); sigact.sa_handler = SIG_DFL; @@ -384,6 +398,7 @@ GuestExec *qmp_guest_exec(const char *path, bool has_env, strList *env, const char *input_data, bool has_capture_output, bool capture_output, + bool has_merge_output, bool merge_output, Error **errp) { GPid pid; @@ -397,6 +412,7 @@ GuestExec *qmp_guest_exec(const char *path, GIOChannel *in_ch, *out_ch, *err_ch; GSpawnFlags flags; bool has_output = (has_capture_output && capture_output); + bool has_merge = (has_merge_output && merge_output); g_autofree uint8_t *input = NULL; size_t ninput = 0; @@ -410,6 +426,14 @@ GuestExec *qmp_guest_exec(const char *path, } } +#if defined(G_OS_WIN32) + /* FIXME: see comment in guest_exec_task_setup() */ + if (has_merge) { + error_setg(errp, "merge-output unsupported on windows"); + return NULL; + } +#endif + argv = guest_exec_get_args(&arglist, true); envp = has_env ? guest_exec_get_args(env, false) : NULL; @@ -420,7 +444,7 @@ GuestExec *qmp_guest_exec(const char *path, } ret = g_spawn_async_with_pipes(NULL, argv, envp, flags, - guest_exec_task_setup, NULL, &pid, input_data ? &in_fd : NULL, + guest_exec_task_setup, &has_merge, &pid, input_data ? &in_fd : NULL, has_output ? &out_fd : NULL, has_output ? &err_fd : NULL, &gerr); if (!ret) { error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message); diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 796434ed34..9c2367acdf 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -1211,6 +1211,9 @@ # @input-data: data to be passed to process stdin (base64 encoded) # @capture-output: bool flag to enable capture of # stdout/stderr of running process. defaults to false. +# @merge-output: bool flag to merge stdout/stderr of running process +# into stdout. only effective if used with @capture-output. +# not effective on windows guests. defaults to false. (since 8.0) # # Returns: PID on success. # @@ -1218,7 +1221,8 @@ ## { 'command': 'guest-exec', 'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'], - '*input-data': 'str', '*capture-output': 'bool' }, + '*input-data': 'str', '*capture-output': 'bool', + '*merge-output': 'bool' }, 'returns': 'GuestExec' } From patchwork Tue Feb 28 20:48:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 1749614 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=WokOoBoW; 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=Hx5X8eSZ; 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 4PR8cj5dmXz245t for ; Wed, 1 Mar 2023 07:49:41 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX6te-0000v4-T5; Tue, 28 Feb 2023 15:48:26 -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 1pX6ta-0000tV-MO for qemu-devel@nongnu.org; Tue, 28 Feb 2023 15:48:22 -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 1pX6tY-0006Zx-Q6 for qemu-devel@nongnu.org; Tue, 28 Feb 2023 15:48:22 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5C5245C01EC; Tue, 28 Feb 2023 15:48:20 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 28 Feb 2023 15:48:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1677617300; x=1677703700; bh=qo kfXO0eNdD15vZdAmFZWrJn60AJd0dKe9QL9sF0xH8=; b=WokOoBoWjY1x4f4Gti 8J/2XnwZFzO7LeXLecCu69YXpI5SVbztWoGa3nI0ObMkxQRdmehpNbKo2jPMq1UN 3O99kMfVJNQumTqF+dRF8yKMF8k4p4pgNJKgLEWR0tZ5pT65EMUVWRDOqb4mFw6R KF7nuQrRGngEakrJEeSIuyR2vCC99qUJeE53ZiY9K86uVe2+nDeuswrPt3v3N5le dN3s/5TTjbJTCLOnPcDpQrK0V6H5OLzVHadOtmsMEGV6TlKTDa/tO4Aq3h6vm7Yg 2sgzKXPreRKrMnM0+iFsLaY2dPpNKdP79020hvRI4QYhdQ9gY1jhIjBKoo+hP+Fm EpOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references: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=1677617300; x=1677703700; bh=qokfXO0eNdD15 vZdAmFZWrJn60AJd0dKe9QL9sF0xH8=; b=Hx5X8eSZeNLgYPKe7Hd0WuYMlyoUk wAVwMPQGzSGU/GV0nw81Vu07i/+G0m0P8e13EuxBEv3FMJipenmoWJng4p6Oy46H v1JD/zM2PBV2E3qZXzKjok45gjQwzrORB7I5oOZc+M3C0Y2TCpifzvIKVftHogOZ R4ieZjitk+Pz+jcq87pExHhmGw7b0F8iOi8Lu6REdPWAnjvniyeDwcjzLbaO5y7o goKjy+p8jUHPoQ3a29dPullV4G4iWrh8RE1wBmxdr3lPregR+Rd8ytAJi57iKJfO lCnFNmEZNYIfc+KsxkVtqIZ/CPsDcm9qhyB2FATaNyUPSAImLHaP0ywYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudelfedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Feb 2023 15:48:19 -0500 (EST) From: Daniel Xu To: michael.roth@amd.com, kkostiuk@redhat.com, marcandre.lureau@gmail.com Cc: qemu-devel@nongnu.org Subject: [PATCH v3 4/4] qga: test: Add tests for `merge-output` flag Date: Tue, 28 Feb 2023 13:48:04 -0700 Message-Id: <46322f524542aa2147939efc1e814c9d1d273919.1677617035.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: 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.001, RCVD_IN_MSPIKE_WL=0.001, 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 This commit adds a test to ensure `merge-output` functions as expected. We also add a negative test to ensure we haven't regressed previous functionality. Signed-off-by: Daniel Xu --- tests/unit/test-qga.c | 157 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 140 insertions(+), 17 deletions(-) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index b4e0a14573..717f3d1103 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -755,6 +755,31 @@ static void test_qga_fsfreeze_status(gconstpointer fix) g_assert_cmpstr(status, ==, "thawed"); } +static QDict *wait_for_guest_exec_completion(int fd, int64_t pid) +{ + QDict *ret = NULL; + int64_t now; + bool exited; + QDict *val; + + now = g_get_monotonic_time(); + do { + ret = qmp_fd(fd, + "{'execute': 'guest-exec-status'," + " 'arguments': { 'pid': %" PRId64 " } }", pid); + g_assert_nonnull(ret); + val = qdict_get_qdict(ret, "return"); + exited = qdict_get_bool(val, "exited"); + if (!exited) { + qobject_unref(ret); + } + } while (!exited && + g_get_monotonic_time() < now + 5 * G_TIME_SPAN_SECOND); + g_assert(exited); + + return ret; +} + static void test_qga_guest_exec(gconstpointer fix) { const TestFixture *fixture = fix; @@ -762,9 +787,8 @@ static void test_qga_guest_exec(gconstpointer fix) QDict *val; const gchar *out; g_autofree guchar *decoded = NULL; - int64_t pid, now, exitcode; + int64_t pid, exitcode; gsize len; - bool exited; /* exec 'echo foo bar' */ ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {" @@ -777,23 +801,10 @@ static void test_qga_guest_exec(gconstpointer fix) g_assert_cmpint(pid, >, 0); qobject_unref(ret); - /* wait for completion */ - now = g_get_monotonic_time(); - do { - ret = qmp_fd(fixture->fd, - "{'execute': 'guest-exec-status'," - " 'arguments': { 'pid': %" PRId64 " } }", pid); - g_assert_nonnull(ret); - val = qdict_get_qdict(ret, "return"); - exited = qdict_get_bool(val, "exited"); - if (!exited) { - qobject_unref(ret); - } - } while (!exited && - g_get_monotonic_time() < now + 5 * G_TIME_SPAN_SECOND); - g_assert(exited); + ret = wait_for_guest_exec_completion(fixture->fd, pid); /* check stdout */ + val = qdict_get_qdict(ret, "return"); exitcode = qdict_get_int(val, "exitcode"); g_assert_cmpint(exitcode, ==, 0); out = qdict_get_str(val, "out-data"); @@ -802,6 +813,114 @@ static void test_qga_guest_exec(gconstpointer fix) g_assert_cmpstr((char *)decoded, ==, "\" test_str \""); } +static void test_qga_guest_exec_output_no_merge(gconstpointer fix) +{ + const TestFixture *fixture = fix; + g_autoptr(QDict) ret = NULL; + QDict *val; + const gchar *out, *err; + g_autofree guchar *out_decoded = NULL; + g_autofree guchar *err_decoded = NULL; + int64_t pid, exitcode; + gsize len; + + /* exec 'echo foo bar' */ + ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {" + " 'path': '/bin/bash'," + " 'arg': [ '-c', 'for i in $(seq 4); do if (( $i %% 2 )); then echo stdout; else echo stderr 1>&2; fi; done;' ]," + " 'capture-output': true } }"); + g_assert_nonnull(ret); + qmp_assert_no_error(ret); + val = qdict_get_qdict(ret, "return"); + pid = qdict_get_int(val, "pid"); + g_assert_cmpint(pid, >, 0); + qobject_unref(ret); + + ret = wait_for_guest_exec_completion(fixture->fd, pid); + + val = qdict_get_qdict(ret, "return"); + exitcode = qdict_get_int(val, "exitcode"); + g_assert_cmpint(exitcode, ==, 0); + + /* check stdout */ + out = qdict_get_str(val, "out-data"); + out_decoded = g_base64_decode(out, &len); + g_assert_cmpint(len, ==, 14); + g_assert_cmpstr((char *)out_decoded, ==, "stdout\nstdout\n"); + + /* check stderr */ + err = qdict_get_try_str(val, "err-data"); + err_decoded = g_base64_decode(err, &len); + g_assert_cmpint(len, ==, 14); + g_assert_cmpstr((char *)err_decoded, ==, "stderr\nstderr\n"); +} + +#if defined(G_OS_WIN32) +static void test_qga_guest_exec_output_merge(gconstpointer fix) +{ + const TestFixture *fixture = fix; + g_autoptr(QDict) ret = NULL; + QDict *val; + const gchar *class, *desc; + g_autofree guchar *decoded = NULL; + + /* exec 'echo foo bar' */ + ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {" + " 'path': '/bin/bash'," + " 'arg': [ '-c', 'for i in $(seq 4); do if (( $i %% 2 )); then echo stdout; else echo stderr 1>&2; fi; done;' ]," + " 'capture-output': true," + " 'merge-output': true } }"); + + g_assert_nonnull(ret); + val = qdict_get_qdict(ret, "error"); + g_assert_nonnull(val); + class = qdict_get_str(val, "class"); + desc = qdict_get_str(val, "desc"); + g_assert_cmpstr(class, ==, "GenericError"); + g_assert_cmpint(strlen(desc), >, 0); +} +#else +static void test_qga_guest_exec_output_merge(gconstpointer fix) +{ + const TestFixture *fixture = fix; + g_autoptr(QDict) ret = NULL; + QDict *val; + const gchar *out, *err; + g_autofree guchar *decoded = NULL; + int64_t pid, exitcode; + gsize len; + + /* exec 'echo foo bar' */ + ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {" + " 'path': '/bin/bash'," + " 'arg': [ '-c', 'for i in $(seq 4); do if (( $i %% 2 )); then echo stdout; else echo stderr 1>&2; fi; done;' ]," + " 'capture-output': true," + " 'merge-output': true } }"); + g_assert_nonnull(ret); + qmp_assert_no_error(ret); + val = qdict_get_qdict(ret, "return"); + pid = qdict_get_int(val, "pid"); + g_assert_cmpint(pid, >, 0); + qobject_unref(ret); + + ret = wait_for_guest_exec_completion(fixture->fd, pid); + + val = qdict_get_qdict(ret, "return"); + exitcode = qdict_get_int(val, "exitcode"); + g_assert_cmpint(exitcode, ==, 0); + + /* check stdout */ + out = qdict_get_str(val, "out-data"); + decoded = g_base64_decode(out, &len); + g_assert_cmpint(len, ==, 28); + g_assert_cmpstr((char *)decoded, ==, "stdout\nstderr\nstdout\nstderr\n"); + + /* check stderr */ + err = qdict_get_try_str(val, "err-data"); + g_assert_null(err); +} +#endif + static void test_qga_guest_exec_invalid(gconstpointer fix) { const TestFixture *fixture = fix; @@ -972,6 +1091,10 @@ int main(int argc, char **argv) g_test_add_data_func("/qga/blockedrpcs", NULL, test_qga_blockedrpcs); g_test_add_data_func("/qga/config", NULL, test_qga_config); g_test_add_data_func("/qga/guest-exec", &fix, test_qga_guest_exec); + g_test_add_data_func("/qga/guest-exec-output-no-merge", &fix, + test_qga_guest_exec_output_no_merge); + g_test_add_data_func("/qga/guest-exec-output-merge", &fix, + test_qga_guest_exec_output_merge); g_test_add_data_func("/qga/guest-exec-invalid", &fix, test_qga_guest_exec_invalid); g_test_add_data_func("/qga/guest-get-osinfo", &fix,