From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXKwM-0000Wm-Re for qemu-devel@nongnu.org; Tue, 18 Jul 2017 01:21:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXKwJ-0005b1-LR for qemu-devel@nongnu.org; Tue, 18 Jul 2017 01:20:58 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41239) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXKwJ-0005aO-BG for qemu-devel@nongnu.org; Tue, 18 Jul 2017 01:20:55 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6I5JSFt089329 for ; Tue, 18 Jul 2017 01:20:54 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bsbx40cwr-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 18 Jul 2017 01:20:54 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jul 2017 23:20:52 -0600 From: Michael Roth Date: Tue, 18 Jul 2017 00:20:13 -0500 In-Reply-To: <1500355216-23603-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1500355216-23603-1-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Message-Id: <1500355216-23603-6-git-send-email-mdroth@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 5/8] qga: report error on keyfile dump error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Cc:qemu-trivial@nongnu.org Signed-off-by: Michael Roth --- qga/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qga/main.c b/qga/main.c index dcd6104..1b381d0 100644 --- a/qga/main.c +++ b/qga/main.c @@ -1074,7 +1074,12 @@ static void config_dump(GAConfig *config) g_free(tmp); =20 tmp =3D g_key_file_to_data(keyfile, NULL, &error); - printf("%s", tmp); + if (error) { + g_critical("Failed to dump keyfile: %s", error->message); + g_clear_error(&error); + } else { + printf("%s", tmp); + } =20 g_free(tmp); g_key_file_free(keyfile); --=20 2.7.4