From patchwork Thu Jul 6 12:08:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9828121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7329460361 for ; Thu, 6 Jul 2017 12:19:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62CC028614 for ; Thu, 6 Jul 2017 12:19:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 576E428639; Thu, 6 Jul 2017 12:19:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 87C7128614 for ; Thu, 6 Jul 2017 12:19:56 +0000 (UTC) Received: from localhost ([::1]:51191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5lD-00057U-M7 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Jul 2017 08:19:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5bz-0005nZ-GJ for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dT5bv-0004rp-GI for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:23 -0400 Received: from mail-ve1eur01on0105.outbound.protection.outlook.com ([104.47.1.105]:29312 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dT5bv-0004rZ-09 for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=dh/ugRaCFtY7hp4t7kP5z80+JklWOfUkqX5PgVZf+ks=; b=V+ABpyLmGnIUzfP3fW+XzvgFrDamzW157jRbiRGtRuisPRgKABjC0Bxn+ahqR6Fg8VkrwV9/TbueihiBL+7Wz08fNOa8t7O/gFy2+jdH239rJUMO8rG41D3zcZ4cYLtobNwPKCpTKdNqpcEnnhhrXFf5Wsj8oO51VYPKCJ0bJ3U= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM5PR0801MB1985.eurprd08.prod.outlook.com (2603:10a6:203:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Thu, 6 Jul 2017 12:10:11 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Thu, 6 Jul 2017 15:08:55 +0300 Message-ID: <1499342940-56739-9-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499342940-56739-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1499342940-56739-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2PR02CA0118.apcprd02.prod.outlook.com (2a01:111:e400:79aa::44) To AM5PR0801MB1985.eurprd08.prod.outlook.com (2603:10a6:203:4b::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a84ea53-f58c-4917-f9b5-08d4c467f6ae X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM5PR0801MB1985; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 3:EpSqLUELH2e+fvL8K1zuYcNQMMTqyaCwMtYxva0tm2dPGLcM8a+JSpTDsQoxqGm+/XeRBNMXqdXFJ7mj6TE/+55K1fnslpejqvoFvkg5tQcDZ5Qj57ShGA89leAA0qXOEAjtlPRTbzvKkxpEiT4lHiny4pmimgG+V3JbuBzssPPnjFlnwx2cQnyrgRRnYef9whq7JNPRcKLp2nzSjaihbhH59/E6b/4F+z8Veuzzi//GIlSjXLDY4IjiIsKgT7qTfllIWZsmNh+tD11km8IJ9ByQ61g0glwyP9TyJsT5TESeurKrH6+5jil0k/uxuXMNcjoyx6+/CSMZZTH+Y+NcTZyj8OdesHUWRt0PoqhrOT6S7gfYN9o+zqrXVGmx9KlHlPGbC1cQnbmJrOBn/24oWtZMWpykaqrFblr2xrbJaDI6SOEtFPPiOqvZiUIoqVAbPvHIVgKQkA6Zfm7MisEwc9vOGZRAAL11kazWxCIZ9EjBkEFMXo7rqKfLyF+ZMF4N+NGgRuGkikZ8MiROMpJWGTATRxpUDW2rM9T0Mkxox+mbLZyrgXNsVBKPyqZuABb4vuTyGItG7ROzXqIJb6xdtRFeSfKowoVJ+0/gmAL5er4kp24osHbV7zqUsmGkNjckjNth4WdPKxhkwukCB3YBpU/sBJciuFwsgg8eeDfb/BTp9fsk7h34Yk9oDwcirPSfn3w/UK/BWR/d1ovU8BeuFY4nAQJy3+/19k8eIi2dMnAS+pm9zkDsJSzQKDgPtxOC X-MS-TrafficT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P+vNYptJxX8+LuMYeldjt4ZdP9IBqtQ1S201XAAE8++ONybhscQXZa5MF+c+zNzBY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(227227094722967); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0801MB1985; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0801MB1985; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 4:GajQ5BWwp6zc7bpVpEKCQco/vy3VdqKZoiO7VSIK?= =?us-ascii?Q?GhQ8vT7nHMRF3HgWl6PMwptIX4MZnoDFAVNIabTk7WxyZzqmN8uLLUnnKkZH?= =?us-ascii?Q?qLwMHv7sf/LN8HlYE8wyERfZkF3RwMb2OkGYqIgnvd0vkzE0NoE+dmFxuIhh?= =?us-ascii?Q?1VA+idjeUZXXTfeAxbtrv4p9iC08Wx1DsurKK8L9ty8IRlCTjqBwvHE9Vf+E?= =?us-ascii?Q?hcYms7syEvbgGN5DL3o2QcZLv5XiE9lPyWug1Yz+SzyAFR7IOX2LMqGSR+uq?= =?us-ascii?Q?o6RU1enZ7i06XkTAINxpDHmBWC98tdyYq2HnFUiFG0Afek09C1XBhivcddmt?= =?us-ascii?Q?o/BYPblN0HphLFPL3u3C77b4nVLe1GmMYwVun5dFJ0Zc1xPdIJlgWgqi80q2?= =?us-ascii?Q?faWPK/z3ygsXEy+XKgmMJ1n7gT+G/wZOpSK6rHFzD6XN+ZWk2sjm8/JPxwSx?= =?us-ascii?Q?+eGtcfQZhPge0zShPhlP4zt5MHtz8YiiJ+S9EM/Jm0Q+UI/5s9dI06GlVgnE?= =?us-ascii?Q?2NQLrWP6X7ht2DmQt0rEarOgbxdXwdca9NxwZ2Lss08489ApELQCVMPDkCp+?= =?us-ascii?Q?bFoVowuXh07xuifR31bsSZrcMJOiq7V+Y+i1iUOIvctgieUtRDgWBeHuw+wE?= =?us-ascii?Q?7U8mtryh4LqN5q9QsoTDHtBN0yGAEnVFX2dhg8GpLZyG/9Y4nd/lkU2DNGhO?= =?us-ascii?Q?2acrJo8C27XlAZF2bsEc5B4Te5/djHriwObJbxj2CbHDQH+OAlG7iZB48OXZ?= =?us-ascii?Q?df7oHkw+5c3FGU5GT1J1keyqgccX+aqDN7Oso3un+sdgACj94fQ58iCovOMk?= =?us-ascii?Q?jxVzaAlrUQGdbZU6k+OScywwdqaTpkeb/wMxRBVdk/7GY7eUctAy7nhZAW7f?= =?us-ascii?Q?VKYbb3SsqnrGJwsIzVGKrSiwzwEf8joIStwNlciR5mn/wbIH570eEiwJqE0q?= =?us-ascii?Q?NBwmGhMbO5GFb7K7s2NafSSG6ojRg/GuNZJe8iSduXzzxggrc0ivjRWNx8fO?= =?us-ascii?Q?kQ0Y97m5+aMBjOmGDV+vUYT4nH3RDQcSbsZhhyzEotdmSgMOW1fz/9FWecTe?= =?us-ascii?Q?JDvyZLAXDOINy09ZQyLn86cPL23JmEvZOCjNrwqi8dDAXEueUH/lT524zUlq?= =?us-ascii?Q?DJHHFLDXNHL6NdOdOnUfbCgNJimcKbNxrtpKEhBHANReBjjmWMkdrncfFKbw?= =?us-ascii?Q?YD8Mi32P6dMPcNcgkPZ7J6jywqqnK/kGTLVfXf1Re+bTIwSL152tS2c9kNOj?= =?us-ascii?Q?h+Bqy2WTOmHeO/ZtCAA=3D?= X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39400400002)(39840400002)(39410400002)(2870700001)(81166006)(8676002)(36756003)(2351001)(23676002)(50226002)(25786009)(86362001)(50466002)(305945005)(478600001)(5660300001)(189998001)(6116002)(3846002)(7736002)(4326008)(107886003)(38730400002)(66066001)(110136004)(47776003)(2950100002)(53936002)(6666003)(76176999)(6506006)(6512007)(2361001)(6916009)(33646002)(50986999)(42186005)(6486002)(2906002)(53416004); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1985; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 23:Cbzv2gjQKEZggL+PD2wGa49e1Ob4lv9C8LN0U0W?= =?us-ascii?Q?l1Re8bX5G/jPNnwe/Z6imr99wnO52O4o/dP40wRAuLp9T9BXeKeBKLFfiD+g?= =?us-ascii?Q?Fa683jHXntFiuV0VtqzEwvo5u7AS9UW51Hsa8KHQYNQGrzJT/gvF2+4kwOyb?= =?us-ascii?Q?TWP799O3T1EMiWxD1e28q3I51QDt5wrrr1jugtVlYv64ODLNrfWzyrQxH6cp?= =?us-ascii?Q?pkWMz/FKCjBW/fu+m6SRox2y8M5ZLFkhu3tW71F/UC0rT6Iz6wQc6htfMjqg?= =?us-ascii?Q?S2WZ8SFcSgnvMkvI+G/el78Tm2NcHaA+dm3hnDTRb64u48WU32JEfFIXZJWW?= =?us-ascii?Q?FlABCGo7W3vzb9OtDYldXbYHxkw1CGtFNEcXRPiKx9rh2Xhg8x+xBLw6naGl?= =?us-ascii?Q?J4XZLic2lyN+ZJ7Uxvqq9sOz0dJf3CU6McL7v2VCRaFIH3k5YJRMtnuqoD5E?= =?us-ascii?Q?cBDbalsih5CGLU14f4RY5xNLMHmaMwC3oaxhUQ5u54bP7t8LJ5J+ZsYgyrwG?= =?us-ascii?Q?eyk3magPXZSlCTYZyUokRW57yqzuVOePEuZawnUfeNlcFVRydM40vhq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Orl+LYM2mqP3QbZJIkR2dnbUBPOAo/q?= =?us-ascii?Q?jwQsMI8ngnqMGDalKnoxrREF6YM796sFMgffjQZ1io2PvGuhvZYQDSiGJA4J?= =?us-ascii?Q?fy95LHfvKmM+VlzYpiK9wYSDMXEArFQKFsaDhSpt/LwerRtP3JadWuKYhnFa?= =?us-ascii?Q?Etxw5eE0PqtibdTh3+PQDnqbd3xvk/rpzTNWEURmTbZkEfiasNy55I3mm5Xw?= =?us-ascii?Q?rDUgZY9/qr0LgmqX8QGiJt2aty6uPBYEKv/GJAwYLFl1tSEb0yOV7IBjqOfX?= =?us-ascii?Q?YlAr1+M9YXn/JRO4L1mh7WJ9NXkAijiT5dcCydbMLSXSOTIxZXb05XRSe/bP?= =?us-ascii?Q?6UUXElMOclS9pOE/hV1ia4tjXJ5McN4FupDXYKpZzjtrihbKjG3at4PZkPr4?= =?us-ascii?Q?cHFIJOLGILPPZAW36g0Mt643m8DzTbkDPidD0raC28XXcLN0qn0kzOnepnzM?= =?us-ascii?Q?nZzqGfeWMO4WlB1DBiWDOtgxCMK1av4u/HMIvVpGMC4JZN4lOTXMSNNJKoFT?= =?us-ascii?Q?V9cwbchnuaLFL2+j92LOPYhShAKjrZvZsf5x8eICXn2BmUcGP/nxVQMbEnId?= =?us-ascii?Q?sVbT0xX77HevYUtxT4c6pGPNbjbJw4jlx3WPz/GsrxTHQxTJodZuQq8ZOMTe?= =?us-ascii?Q?ipQrwRPPH9t20tAVysdn32T82crqmaGUbIUsbiotT2EgDxNdt3bTXh2sfLxc?= =?us-ascii?Q?wEE=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 5:/mnkV5DNktI0pE34KmS/EqRP462vamJZKpSo2yGBFDwVwXmVEqADuXWt3siHeMRYq0F38O/rlnxscCELclCMIJGUlTnmpjdOF3ZcNN8PahTH3aqYHREoO3w7FOQLFg8iY/TbsrFh2MzSvWvG/9m/VnOrFdm3sLyL/EwL/fBL8K7ORDPkuqL8UB7m2sD9ugKBpfqodewZYuTJb15QbYvfK0/go2Yv8R6vPsfED3dZV/D7Utm08VxDzZldRQaKM8VKrgGqa64ONZASfdFZJVna5OPShykaN5v7DatCZCfVeoYY5SBKRzdB15kI6KTK6l0gDCQHcBbRAzhGbWhpV5+MonKuwHLlzs3uLa77U18I1XvgS1Uz8emXLusUyO3Ky6htPjW8/V2XiG9bLBW5NjZOKt5yRlebDz5Qj1jlExNnk08uQE+bRet+38VkUTq3Wty0XXx9/T0MGd/vHmRwCFpCng1KHNNvyQ6BlSB1pNUK073J1T1BRLGGmRZpoYA3rAAs; 24:NZKKtIqfsDSyy2rdvyf7v5uuNNV6z+1KQPRF/rkajNCYhlVmXXdr1VRacG+KqMff7nzBwjohUu6R3c7eqEu5thsxePb2CuibMgLH/UYVDr8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 7:EZlHXbHhagCryTaBgW6wHpkoZREjFSW08W4NKxWCyGa4ne10mERx6t9x549tCtC57wqcPEGMuNHRX3ZdAN3gSD/Cm/DxHMTZ0q40GTSrA7mx8NulBMtxPPJUvrwLmXM1riYL44efVn9OHKaTIduJzgdFsJb4lG5WwnlxFNr2ifMB2dpWfJHdr5VsmkBEbiq45/FkUAzvsb1oA+tE6CFOUPrCw6/Do7dkCESjg8q5bSYJ6ST04dnWdT452WTBoQQ8u2s39IcqaY36drucoudA+47b23v2CFadurGwijSJuD1iX+RTEVaFi9t3oavHRHHg9TsK5QPxpVWJlHWsBibSoKqQfJsgUHBh7hU4ngAdwqkMZ4VzSqjaSHcZ5dgkblIXdfQHy58e6Ajl0y0Y+gr61mp9Kt1MSLGew54DfG83hOAPhh8RYULLUjMwcFqczLxP2R4SPsh9Awgf7NU98PpXcAgIRE74mKtw0CdIrgeDOs2M83EVpVq2qIfczCj5Jko+zCJZktY9uR8/KNj6AFpLe8P0aVYwX9blIAbOhu0F/g3THq+BbF6GLF3J2eQ6dFQjZ0sXxa9EfXgvtRuSf0NHKM43w5XulwN0ImhFuAmePMIgs2lnePMFrAZcQfYre+PbWUK6206WW0ZHqe3GjXW5txMT538s5ikLRcOQDZZIywBGDbMgj/HTLLBw1kok1KwjrRIBfiIjs0eq90a4Lqzz2AySys4qh0qxc0KwxuMrf1H0HOC3CtIo8UBiWPjskw3Dj9ibebXB/T3AYw8dwlXIXxPX3YTDFCTXdzfDFWpH8yI= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 20:27IKdw/FjfXpCzMyzOxyZcylXtIkoL0UB69sLsBPYYUnld+/OToiJJi/8MgTzYuTqE5fIPG4M8VGb8Q+0VE4hYFAD4EDfZybzcB+TOWnC9CWo51kxdC/GmBJt9FdQizSqpGCWl4XCkUwKFmQaHGxH5s/SRJzaNGRTf9NQaALmEw= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2017 12:10:11.6670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1985 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.1.105 Subject: [Qemu-devel] [PATCH v6 08/13] test-char: split char_file_test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anton Nefedov , den@virtuozzo.com, amit@kernel.org, mst@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP makes it possible to test the existing chardev-file Signed-off-by: Anton Nefedov Reviewed-by: Marc-André Lureau --- tests/test-char.c | 137 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 53 deletions(-) diff --git a/tests/test-char.c b/tests/test-char.c index 1265224..de72974 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -507,82 +507,110 @@ static void char_serial_test(void) } #endif -static void char_file_test(void) +#ifndef _WIN32 +static void char_file_fifo_test(void) { + Chardev *chr; + CharBackend be; char *tmp_path = g_dir_make_tmp("qemu-test-char.XXXXXX", NULL); + char *fifo = g_build_filename(tmp_path, "fifo", NULL); char *out = g_build_filename(tmp_path, "out", NULL); - char *contents = NULL; - ChardevFile file = { .out = out }; + ChardevFile file = { .in = fifo, + .has_in = true, + .out = out }; ChardevBackend backend = { .type = CHARDEV_BACKEND_KIND_FILE, .u.file.data = &file }; + FeHandler fe = { 0, }; + int fd, ret; + + if (mkfifo(fifo, 0600) < 0) { + abort(); + } + + fd = open(fifo, O_RDWR); + ret = write(fd, "fifo-in", 8); + g_assert_cmpint(ret, ==, 8); + + chr = qemu_chardev_new("label-file", TYPE_CHARDEV_FILE, &backend, + &error_abort); + + qemu_chr_fe_init(&be, chr, &error_abort); + qemu_chr_fe_set_handlers(&be, + fe_can_read, + fe_read, + fe_event, + NULL, + &fe, NULL, true); + + g_assert_cmpint(fe.last_event, !=, CHR_EVENT_BREAK); + qmp_chardev_send_break("label-foo", NULL); + g_assert_cmpint(fe.last_event, !=, CHR_EVENT_BREAK); + qmp_chardev_send_break("label-file", NULL); + g_assert_cmpint(fe.last_event, ==, CHR_EVENT_BREAK); + + main_loop(); + + close(fd); + + g_assert_cmpint(fe.read_count, ==, 8); + g_assert_cmpstr(fe.read_buf, ==, "fifo-in"); + + qemu_chr_fe_deinit(&be, true); + + g_unlink(fifo); + g_free(fifo); + g_unlink(out); + g_free(out); + g_rmdir(tmp_path); + g_free(tmp_path); +} +#endif + +static void char_file_test_internal(Chardev *ext_chr, const char *filepath) +{ + char *tmp_path = g_dir_make_tmp("qemu-test-char.XXXXXX", NULL); + char *out; Chardev *chr; + char *contents = NULL; + ChardevFile file = {}; + ChardevBackend backend = { .type = CHARDEV_BACKEND_KIND_FILE, + .u.file.data = &file }; gsize length; int ret; - chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend, - &error_abort); + if (ext_chr) { + chr = ext_chr; + out = g_strdup(filepath); + file.out = out; + } else { + out = g_build_filename(tmp_path, "out", NULL); + file.out = out; + chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend, + &error_abort); + } ret = qemu_chr_write_all(chr, (uint8_t *)"hello!", 6); g_assert_cmpint(ret, ==, 6); - object_unref(OBJECT(chr)); ret = g_file_get_contents(out, &contents, &length, NULL); g_assert(ret == TRUE); g_assert_cmpint(length, ==, 6); g_assert(strncmp(contents, "hello!", 6) == 0); - g_free(contents); - -#ifndef _WIN32 - { - CharBackend be; - FeHandler fe = { 0, }; - char *fifo = g_build_filename(tmp_path, "fifo", NULL); - int fd; - - if (mkfifo(fifo, 0600) < 0) { - abort(); - } - - fd = open(fifo, O_RDWR); - ret = write(fd, "fifo-in", 8); - g_assert_cmpint(ret, ==, 8); - - file.in = fifo; - file.has_in = true; - chr = qemu_chardev_new("label-file", TYPE_CHARDEV_FILE, &backend, - &error_abort); - qemu_chr_fe_init(&be, chr, &error_abort); - qemu_chr_fe_set_handlers(&be, - fe_can_read, - fe_read, - fe_event, - NULL, - &fe, NULL, true); - - g_assert_cmpint(fe.last_event, !=, CHR_EVENT_BREAK); - qmp_chardev_send_break("label-foo", NULL); - g_assert_cmpint(fe.last_event, !=, CHR_EVENT_BREAK); - qmp_chardev_send_break("label-file", NULL); - g_assert_cmpint(fe.last_event, ==, CHR_EVENT_BREAK); - - main_loop(); - - close(fd); - - g_assert_cmpint(fe.read_count, ==, 8); - g_assert_cmpstr(fe.read_buf, ==, "fifo-in"); - qemu_chr_fe_deinit(&be, true); - g_unlink(fifo); - g_free(fifo); + if (!ext_chr) { + object_unref(OBJECT(chr)); + g_unlink(out); } -#endif - - g_unlink(out); + g_free(contents); g_rmdir(tmp_path); g_free(tmp_path); g_free(out); } +static void char_file_test(void) +{ + char_file_test_internal(NULL, NULL); +} + static void char_null_test(void) { Error *err = NULL; @@ -660,6 +688,9 @@ int main(int argc, char **argv) g_test_add_func("/char/pipe", char_pipe_test); #endif g_test_add_func("/char/file", char_file_test); +#ifndef _WIN32 + g_test_add_func("/char/file-fifo", char_file_fifo_test); +#endif g_test_add_func("/char/socket", char_socket_test); g_test_add_func("/char/udp", char_udp_test); #ifdef HAVE_CHARDEV_SERIAL