From patchwork Wed Jul 5 14:01:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9826591 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 20E7C60317 for ; Wed, 5 Jul 2017 14:09:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05FF1283C0 for ; Wed, 5 Jul 2017 14:09:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEBC42850D; Wed, 5 Jul 2017 14:09:32 +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 E2C13283C0 for ; Wed, 5 Jul 2017 14:09:31 +0000 (UTC) Received: from localhost ([::1]:46409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSkzj-0001J9-26 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Jul 2017 10:09:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSkt3-0004mW-ON for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSksz-0007oQ-Rs for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:37 -0400 Received: from mail-eopbgr40115.outbound.protection.outlook.com ([40.107.4.115]:5184 helo=EUR03-DB5-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 1dSksz-0007nB-Aj for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:33 -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=IsO9WmEVv/JdeA4UQX/dRoNvG9clyc3SSTxCeubOCQ0wJ899YhVyyknSWC6wOrI9U0NYQYVdbdbYvhrN225cJ466Ni1yna4mpH/7gwYp0jAZ83dzyHRot6MbHBqK7HMMIFwdzD7SI4y6xnJk3S50DFhH8cO8HB4Vs4d0t7AgPh4= 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 HE1PR0801MB1996.eurprd08.prod.outlook.com (2603:10a6:3:50::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Wed, 5 Jul 2017 14:02:30 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 17:01:59 +0300 Message-ID: <1499263324-15184-9-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499263324-15184-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1499263324-15184-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR02CA0007.eurprd02.prod.outlook.com (2603:10a6:6:15::20) To HE1PR0801MB1996.eurprd08.prod.outlook.com (2603:10a6:3:50::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0509b664-1d75-497e-78b0-08d4c3ae7a8e 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:HE1PR0801MB1996; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 3:eheVZF1lOD+1FjmUqgoOpgSdh+xCEStbjrpWfINHxvR8bYZSyFkVVYQgBT4qu4aP8UjksgxLfTF6+N6Tm+Roj3+q/gr29wa6fNqCcSYfj8pYBS1kIpaMYLJoBTLhWdTpl4z3xnEL2hdLSKE9xZH9bEfBrxckiOBE/A+t8pddDVXlX03DbzqMfk626h+rDYpGmS0GrzaMA1m19MdJERJqgvhIaJwOMnjtsvL/hHprZ+vUFosAQFeGIeX2kO3Bv4b8+G3qhaoDvNBdAtFZQiAuhjMmyGXHijhKRd3yfqYqsgX4Oz2y5nxI9eVL7bUmNguo/IGHmEN9iqcOSIwr+ty6Gxviem1rDGPsUonefJdymLpdgEWvSBE70Ga+1QA0jcQoQ/M0kKIypryY3ENRTuZGNoV9KuyUb8I/KlfHiLNw4eecqcaeUzVVpvOD2lK9RAnvNeQ/kUicVMwobnrQFm9Zi/7nHN52Q8co/sQpput0wlIpunOSnTIWAqsE7NNRfBgc5SyIWdBmskQSt3wwqBiCSTfF4Sq2RFjTjy3XOKWMvHenl7FxWtSYX39OdAvW9+NJoRCrPgCv5ahntO3vT0MzOD1xr0LP4Vzk65ZxC/uQNdkjm8UT2jymaS82LF1LTW8MeQe5M3T4fzSNafooxh7HvVSEibRBRLLNqC905sLy3v/RKO5O2R3X4sRXo0N6gkrIC6DuyvUubQYspMxCSmhKKeRG0xqlD1YV1ThAVdfWjHffsm8b7l2Am56CGZuNVYfi X-MS-TrafficTypeDiagnostic: HE1PR0801MB1996: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 25:dvevg0Jn8XVve5EqQx+i4J/LDGd54n6zHPEfm+cBezoAqSim7oVpLxyiV2k9wnd6QkAKYXsaIIW6jrwI3XDHroGadTIQZkRzjxEANf9D7EVxeRstKWFRCfK6GV8tE8oRvJdeIUoIA9mQgbTp6LH4x88zcocCce12AHCd/j5M8Gmi6DPITQ3N1AuGwU/YbxJ5uHj5wNJ1aNrkg9ZcyZDnov8INbtrKzjuX0hrHUMxiJ1BsycurN4kpvnrni27wHYdc3PirrasjoeG6IEzn3XyQFrwzTL1wP1L680QTo5B0LI3PiN8d0Vedsm6isS7RTXYWChO4aDactBsCdigfPqVnB6goOXmi1qnv3hhYT7KZVg8MkBpdsD6WG1hjQkDf6VNhm3xSIeEIkOigUtOMw9uqThgA1RO9XsBfUpgcoQfE2y0Cpm2OBbnfiAlXpCwvWY+BDi0qw8ed6fBJteoNaulKU2N/c95ba1vB/INEATogDFKvn0+fW0g+MuKinOF2aj1mKFeXVMsm+7/Q8rJlZN9EV1gjAvuFjIYPnMWkq0QlhjQ76eF+CD+VBdV/9yhl8MoMoImy8wyeW524KoYQZdJLfL75bp5lA32UQ7xm3U4iTN/HDC6f/jrZozK69M1OuWM5XiDiay58vVLXUefJee2uu040ZPt/rm+DMRpFNYpvOm4S828GJlLmIBQeas0kKbgP7AVDdFfrVRDDcmB/aWQIO7+iicdcu+ZCoPPEEUj734RAqY4yKymQIaedrdeoS4dlwJIAY6NIHeQqBDTEjnhBVoi5MukxfeIU2SUyw6FoTFgl2fS51JrsUOObwv4GRCzHOBslimtjRn909H1wxCbrUp5mijanTtcHcSLH3cpMmwreUlw1rMDRTvIJdZb/pb133XK8afLoG0Wn2EGEExoFg7uvC0+AqMaqPxwfG4aPyw= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 31:VP7j1E9xxkRIrax5CPM8SmEU7WiaGrgu2aPq13qKsjagn3WQ9+5+h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1ZDnGUPa69IUvVXWMSHk= 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123560025)(20161123558100)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0801MB1996; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0801MB1996; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 4:+833aMblgRErQfrW72Evtp2KoeGaC5G8tMMvXaM1?= =?us-ascii?Q?ilJwx3TKxA8Qzzcs2pwoqaWKLa0Bj774nwSnb97uSHyF9hP2VfQk2aJeA2nk?= =?us-ascii?Q?4UxPbW/Mf2vyE+rsD3huorcyAkzxtFyBYlluA/47VowCCiry77pLZlqssQQQ?= =?us-ascii?Q?x2JPcq9KCE+bmQjwEFWMuaD3zmYDBz0LS02s6u8x+vHrtfljtnRBgSAzy5mr?= =?us-ascii?Q?QLLT42CYWMbtAu7ARl+Pj9vn6iv1l+wcCHfd8V+rQiqJtH344lUALeiHip6l?= =?us-ascii?Q?0M31ZnxDI8ZfImoy4ZvyRQYRa1pdJny+UtpSyJaCCTE9q3J6Y2JM+EJY9MiW?= =?us-ascii?Q?vW9pyXMzDNR3MU+nlDHYeCHK0kvqD+JI6GuWqQ47WwmeuuDXOVTX7NXZlV4S?= =?us-ascii?Q?9i/Qa5Id7G6jdTZyR15V/j2dfX0s8PaiJvu9BLKthM60RsEWRAOPZ/QHuACY?= =?us-ascii?Q?beiUHlqqNSYYze8yoaBpD1lfjDa5t0Hegmo+Krme1IFi5H3b2iTH9KUkM2X4?= =?us-ascii?Q?/AL3x5sIdNJbgkHmq71DATlGKXA/COfvPT9VnNXsKs/D0myROPhnkg4z4Hi6?= =?us-ascii?Q?RfrmRIWF1FICOmuCzfj9CzuHie2gOZ1anRhKTyyqhUr/QvDpuOpuBOp2HZm2?= =?us-ascii?Q?mxKJ48RT4IFDfyKSpvqCyEHN5PlIaAWkuEIBmV6WvgfqN9asgeTMu1Lb9XKH?= =?us-ascii?Q?896KmE9oOUQ941P2vC/HFfgjV0dY5bqJeWmpJmizp/J6hj0CPMYh+iT4zOB1?= =?us-ascii?Q?BSDkPJhurFx6Wzi48eknPOkC9/Hz3MLdJ8GJ0yAomLWU8wHpuQrsNnM7tOP7?= =?us-ascii?Q?dJpUDww5FuU4SdbTHIDlpKDfB4JgHGvU2W2PDjALon0Lb1CALFX7jBi2oj5B?= =?us-ascii?Q?ljSisfOe+vsm2Bfrl33U22QkWfJ49AdA1CnZ5C92ye4HFE+8/ImFfgpUh0VF?= =?us-ascii?Q?EnTaFWxBo44dPTliNoX14CExUCJoTC5HYwgaH1rnZ9s+ZncgkZ69OhU4W3py?= =?us-ascii?Q?mB5w/yuNkQc6ba4lVJeXdBoPCnzHxsGjirzCMcAgIkWQyUJc8u7tWIQefjMk?= =?us-ascii?Q?K7O8V6nmEYm6clLuJsFHmG5C8C84Jgs5pDOUpc8Y3petYmFh8zHUoazNIAEg?= =?us-ascii?Q?b+RBl9X3zQDAzq/9xlW2mvSoS5oXd1CkKZSq90ExomGRdxQ+FGSvDrBqF/B8?= =?us-ascii?Q?Af0p5GnZxqqfKQX4F3TcfI3vEAM/hanl4uY5bwjxKq6i0l2IkufA6ARrCw?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 0359162B6D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(6116002)(3846002)(8676002)(2950100002)(2361001)(6666003)(33646002)(2351001)(53936002)(86362001)(2906002)(38730400002)(107886003)(110136004)(50226002)(42186005)(6512007)(81166006)(4326008)(25786009)(50986999)(478600001)(189998001)(2870700001)(76176999)(5660300001)(6506006)(6486002)(66066001)(50466002)(36756003)(23676002)(7736002)(6916009)(47776003)(305945005)(53416004); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1996; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 23:5Fskhjv9HcAj3gd0RCnpk972PuzZS6vfIqtFWm+?= =?us-ascii?Q?JXpQEJDuZsNuRiANqo9MTYxAtWgkDHVa7pXR9S4JqKt0+7/1s6waKZEk7j1F?= =?us-ascii?Q?QOv67k4zoKK+zlauOKwtm2g7XzYlCIc3AE3uy/UKrRRAnls9mQyHnICaTGJ0?= =?us-ascii?Q?jdLhSvtZyHGWvwXWM2w94OwtaZQOxGUyS6KZMSitUH7yVUH19PPoVZnAjhgO?= =?us-ascii?Q?CHWhtwx9Vx7Jgha49fzlResqX8AuciFfGAioCQGSQtqsH77CerIDE6zAlTcq?= =?us-ascii?Q?U7ygeZaVFhVaz7LVLTf0ITZxJ+PRwHRnbhgxnOwKh+8d8RurnqxrxgZTrnHm?= =?us-ascii?Q?cC705xKfdEZPZ6/bgrzwuUncnCtNk1tdaBYQ8qOcRCmICjetpULMPWzWE+uM?= =?us-ascii?Q?osCjKFuyOAhdoho2leM0xcOuQONwewrQNtHAekPrPAiM/wlgTGfdDsKJdtw0?= =?us-ascii?Q?kQ3p8P8aiFXvNlj10CA/ZQIiZqlQZQPA8gCZNBZzlRpiKPJlrDxvDUQrCFhW?= =?us-ascii?Q?k7JbGUTu269Czw7+jOTAOPwJ+RbNQp/U4BlDyLymm3Z/JjJtVuT5c9XwveU9?= =?us-ascii?Q?2przxph4GInTx6J4DS4AKn2RmoMww7QSNiu9RmT3PHZ3rW4wAYT1nOJ4nwQV?= =?us-ascii?Q?JKIWP4HzrdMoHJmjS9HxoOwhKcvb83iCf+1JFd7MrpTb6pObOy6JpoLHpT9z?= =?us-ascii?Q?cRG3uoFe7VARB+wyPdn/nzJn6tLgZfhVSqOcGTVxuV7UsZClmvCruB1xQQQl?= =?us-ascii?Q?a5m+hOLv91mI/VpkiDUmGqFwS6WXM6mJ+a4PgBHhGxa7taUZ5LghkhBegpD9?= =?us-ascii?Q?weArD7NWhM6Zga1QWAcF1mneF5phjK+SIGF05/F2HgPbusWxIdrEqTiiFK59?= =?us-ascii?Q?SaDlvHbCfmjOIR+csW9dbFcvF5GdwbxqMT+aKYX6MU6ZmKSTlfu/dV0p7oKz?= =?us-ascii?Q?nXeH4GYUM5sw8W4thKwuPXMNo/YLwHR1WRsDNefeoifPBvGlhQF+xr5TQBHV?= =?us-ascii?Q?Hd9cVQ2msChla+3HA2bYjCrumrx6c1evvApP2GwbGWlFT1ku77XKOfpAuze/?= =?us-ascii?Q?7un+3OvUzV2rf1lXdB8/BCTnAiGLY?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 6:oxoZWuQFc4Lzcq9c8iKFl2p79fW2GPR0jrTmZh7U?= =?us-ascii?Q?JwUkmJNVgSDdZ+raO5YhLGXVW4PoNjk7W0ezmr7BFDWOokibcct2Py1yW684?= =?us-ascii?Q?/sCjQ3LRUhzJLQXtZu0Iou6L/rirx8Jvq+9yFT9ccdHYtLoZWnax55VnRgzf?= =?us-ascii?Q?C6/hp27FKveJL5U8WAKrI43ftAqJzsR0poFVGscisB7ycw+hnhG0211D7T4n?= =?us-ascii?Q?pFgcSMG1NntQBLznTsuYMlzLwNFH2JekPNNQ0P/nLcdOokQ6/J5Y0HHmxXk/?= =?us-ascii?Q?SKViADnzNdYNs/Qi8hklVQCZg7UO5yQ5gKgxVdh4d04MoTdr7k1OjaOmvCmv?= =?us-ascii?Q?ZR8eJEtnxkdqEzZ0JFjdb7wHaj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6DSvuwqDuf7gJmB7EDIrmZRNsJAYAKvNjtdj/SsHBT4xKf+SQYgxUaK86Z+QLB04TkYzoU8JgZaPVgASCdlYQnz/kuQryz+BQ+2DudCmCwIEK9MzMfZMA/ZTlo+7q2hvlW2ubWiANOJwQbJLkjRJrsNwW4cMqjpYtP1mkAegWugLHvV3/Er/xR5z+byDM= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 20:cDIzbGwZwYOyNCXiYZKmmJByE1mD5p75RSHp4pM5x43zwf7kAs34kFmt3PkaucEljpH6Ihv7a2F47kCOChN8ob0fsMy45VVAu3hHxm9Lq8JulbuF07IlB/+0WTWUIKjSQiRljowexahisSMNg8D78ErvvvI37tgyPXY/m5VItdg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2017 14:02:30.1934 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1996 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.4.115 Subject: [Qemu-devel] [PATCH v5 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