From patchwork Fri Nov 10 20:42:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 13452791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94B45C4167D for ; Fri, 10 Nov 2023 20:43:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.630796.983909 (Exim 4.92) (envelope-from ) id 1r1YKs-0005O9-JK; Fri, 10 Nov 2023 20:42:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 630796.983909; Fri, 10 Nov 2023 20:42:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKs-0005Mt-E6; Fri, 10 Nov 2023 20:42:38 +0000 Received: by outflank-mailman (input) for mailman id 630796; Fri, 10 Nov 2023 20:42:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKq-0004yp-V4 for xen-devel@lists.xenproject.org; Fri, 10 Nov 2023 20:42:36 +0000 Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ac2cad76-8009-11ee-9b0e-b553b5be7939; Fri, 10 Nov 2023 21:42:33 +0100 (CET) Received: from pps.filterd (m0174677.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAKIjQw010025; Fri, 10 Nov 2023 20:42:29 GMT Received: from eur05-am6-obe.outbound.protection.outlook.com (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3u9kkysufj-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 20:42:29 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DB3PR0302MB8991.eurprd03.prod.outlook.com (2603:10a6:10:437::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Fri, 10 Nov 2023 20:42:24 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%5]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 20:42:24 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ac2cad76-8009-11ee-9b0e-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l7P7vS5qGnKmGuBUQrXZQz8y8GUn3VwSxrXtQW6EIfrO1OYgVCG3NI8LKeAU9n914lSb3/7RudL2L1zFPqgMsqKbf8lp3BAc1ur7NEyTMQLpbSzOqxgqPr0AyLVx1hHZwonqxLwdacXs/F/MIG0sNG+X0rtgtUKCs01g/JjWRnNsr0d4U1S3TMyL0x+ie5PoOjiwVTLv3NFgKGxstuy+HR9HSSv2NCrQiAtPLOmGSBXle5CHKgBYDtR/sy+vBTpgs8GNIucb5qGnoQVGF9+e+0vrQu/EBaLNDAO9ceHy4lt8NkNv5yys6gAUerrS7WVUzmBgUMu6bYh+3zOOjzdUIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MrOm9LNsn91tP/CeZzcWh0KSoCIqcM3e2ReDFqdpkMs=; b=MWJuumrsANCXTTfhbrqqArsfoSGQwtAwmOkSD/68Vu/CQrn32XKYlzt46IehEyGs76XNFOn8u0wRJgv0qEsp8JNas2oCSpOJHKeHEIo+UL77ONGpELLH96N41XB6vySXFVTreMTg/suptPTgpWyKt2HiUoYFp1BEcUKCWwlygfzTkWXpCuXXqxn7J2QuXaIyJeF5F9CUfUSGfY4o39mDtH841Z+drLBLblBQKgrIt1OJHahP6wMDL2HepsY132iMlyxHcOftAhwUSwma0rYiskBJJRxuAOGgt3iHUZXOaO6eg+/WRn4RYAnrbePEFgWGDPVuRjTn7VGErVHEE5rpOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MrOm9LNsn91tP/CeZzcWh0KSoCIqcM3e2ReDFqdpkMs=; b=Z7wiTcmSJVEYD+hzPUh9SND3rduTyjqI49Pzvlv3ttOvIbFD0ahOjQyJDKF1vNiBblW6tx9NnUfBTsEtWoinQ6jVCNnTWXseLDmoLPI00G+Z+in4UHSNLpZJwV/NXAPAadccu91FKjq01BD2rtLetUGYlxzqPm78OHH8ZRac+AJ46LDF4f75FT0KuZGOPOmNCiW2c8Qq/Pp90skmxd0kbJVfjZGkoMGrbYnHSJh1Tf4+tQxUWfh8psQdXYCeAfYXWxWHijhJvGPP2MAKhmk5/RmtLZmv/s3nw9LuE8l70Yjrr183wwxe39AKieiCcOhDA8H+c9xR6YX2GDElTWVvCA== From: Volodymyr Babchuk To: "qemu-devel@nongnu.org" CC: Oleksandr Tyshchenko , Volodymyr Babchuk , Stefano Stabellini , Anthony Perard , Paul Durrant , "open list:X86 Xen CPUs" Subject: [PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed Thread-Topic: [PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed Thread-Index: AQHaFBZoiczA8QKKJkeUUC5gOc8rQg== Date: Fri, 10 Nov 2023 20:42:23 +0000 Message-ID: <20231110204207.2927514-6-volodymyr_babchuk@epam.com> References: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB3PR0302MB8991:EE_ x-ms-office365-filtering-correlation-id: 5703c808-08b1-42e3-7423-08dbe22d8b58 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sOWUR49bPCHq2MDz4OKjUebc6vL1/adN+YxOBCawkCdh289XyABMU17ZIHdt3zae6BUL+oTOpbcJXoTxvHuFAlMMBdU4OpWAizWs9lMQK//lueKKf6qyLFESjY2jB3oeokSVEjy9RVENSfxXQxjE4gNQFUY2dWbXxGvEKzHLXTnTYLj7tZjkYO7Nyj8dPGDdjf8tt7Zs2DDwce5uwZhfo921VZgNjvITHh2ujworYJbsDOHgVtRVpeO7Z4LbZm/G0kUC/77WNeHe8mDV1I5Nc6Inb2RcglR/fWAByZaorDGtN+nv0ZD/lr96uHRwpeOux5bnQRu0YB2tvytlLCcTQ4STX5FUTsWcUL+cPlH+oT9dBgwa0cIF5hsWSRrakdZdq48q1zE7YPcMVAvqHZjOa9Cx7R30Xy1Ml2CFFN6ImtuWYeHvmm20BmBDCvOFZl83fnl9w/K0NzSV2C0+U9D9yVbo8GwIL0BmJaBDLSmrGnYmNePe0LEeGawADZG4zL3EHFBeMlU7qzPANauGyOtgGiL4l8566K1a6gAsi+EoMJRNu/DiDAUdjmvgpjPTTMADKfsW9jQyS6jd5e3DSegNUEFEz5xcXoWiw8AB9UlTONY+TWChdATiKpD5IE81hVov x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(346002)(39860400002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(41300700001)(2906002)(8936002)(4326008)(4744005)(86362001)(5660300002)(38070700009)(8676002)(316002)(36756003)(83380400001)(38100700002)(478600001)(2616005)(1076003)(6512007)(6486002)(71200400001)(122000001)(6506007)(55236004)(91956017)(76116006)(66556008)(66446008)(26005)(6916009)(64756008)(66476007)(66946007)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?/FSoOQPzYuRmlIFZl0HXXBf?= =?iso-8859-1?q?rupib9qLujN5V2UPKaGu12YeZkQV23hCfFkIqFiACkHR/djiff0fcA4ZNhYa?= =?iso-8859-1?q?MK9IxiFtlSRDRsijprxBJBuQuuqSXDnqCK+DyaoeqL2HYkiOeQ0+AUt7h9p4?= =?iso-8859-1?q?BT/gOzz07KEGNuHXeT5I2Fd0RcN15o3yFJ2tJ0yjgkY3qIu06ctw7CTPejOj?= =?iso-8859-1?q?aV1smIyET0rJdS5oCA1UlyxOrWWqjZjJ4XaV7BJxfKthmVkR5OlQQk5+4v3f?= =?iso-8859-1?q?nm85NT/tC7hkoLyBDXbQfG+UuUFCgsMGm+z+7I4IIu9w0rbH2NVKmrWIBaqy?= =?iso-8859-1?q?1QvHD++HmD0t6LYptgfOBVI3aKAoHouX2F63KQ9uRBVpD4TEqWZudwcSpapv?= =?iso-8859-1?q?ASL7Rw8vI9DIg3o0Glcg1a3r5xdA1HLRzHZth3LrdlA0qxeAK7z9a66lAdtf?= =?iso-8859-1?q?FJNaicvUOvR/GFB8pCxx8yz58LLUJooh/y65oIne7sUGBKwnWGSk2MEj5zse?= =?iso-8859-1?q?9xoab65QhVvlgSPDeEhSTW0+u+TxYhUvcAs4bqohYXZe40m4AtIy52afhka3?= =?iso-8859-1?q?e1L3jDhTGFSy/XAshd2zfT4yVFS9sygxLdztItiUfn6svZKNSC0s8mh7H0/p?= =?iso-8859-1?q?ryfS8CK0ZrvWft/Q7W3pEpUymKULw0A0IFLZ5pzXbrRryXUBSJdxZFzgNihg?= =?iso-8859-1?q?2yNH+cwLS1oc2ClujJ8fspHqotmPzWqxe9jAMNJqXU5p9LPzYovKsjE2C1DZ?= =?iso-8859-1?q?QXO6vdvXAFB4yLSBdSBZTSFBna/JoGW8Nbic5Y0fLXC/6ZKBaSSsieBon96z?= =?iso-8859-1?q?cub2lpj7F/7y5hMNKI3jIRC+HoXyBgdkPAgfIABBIO+Lgj55zzNWt1sduw24?= =?iso-8859-1?q?RTunpHhu5PXc4mX9yAoglRNpxmfH/pKJq4xnjwShiV6bLT3zVnoSftaCRdeU?= =?iso-8859-1?q?JKTcuV0iPwYE4pYwELXhcTTTkUaKXMXO7n7UXIh29ztnqT+3COt9vlYVbVQ7?= =?iso-8859-1?q?xNHKTQRsr+kK71Cqv71NUAnipe6qUM+fHKlZPzhUk3tv+0tw66LPEm/YBW73?= =?iso-8859-1?q?+rhCmo/EM/hQfpoc3e1QN3pwbalqIbugHmIK3Kya5+NslVuKAFqKxg0Kwhyv?= =?iso-8859-1?q?j8eE3RwuZ57zC3CGe9LqgMe8MyZgtHaFn7DNRyjRY7yHxYnXGh1Y90OhmPqX?= =?iso-8859-1?q?X5k5BWTjOC9aDZK4kEsGBgORGgRQqUV59/KaAZ/lwMBiym4d3A8A/AbUWX6x?= =?iso-8859-1?q?HEmZZ/s7egmwdYJ/YBSxWLapFLDCb/Fn1cyhVJaKuu0Bkcvt+YAI4eXgKTkQ?= =?iso-8859-1?q?NQTa3VwlaxCYajiGtKcBl1wLqRRk79rgE+3PLlbsEZTPKJHNO933G4DV0i76?= =?iso-8859-1?q?V9iGXEOQKmb8Qu2iW5ZNsc2bas/w598Pbbe5YvfHw1G6gCtM/Tfn3Eky3LvG?= =?iso-8859-1?q?8FOkLLRDYgDrEh4/vSeLKH//+1MsW+gT/ZMbj02oAASgtlW4wzrinkl2g1/h?= =?iso-8859-1?q?NGbIaAj65ve4K/ilPvuL6hXVMs4m9X1GE5XtPNMSz3blAAu4LA0VVtGD/Gso?= =?iso-8859-1?q?rcoRHHpMEKuOrOZ1bAOzHipr2caAfcaAPmxWN6lAmfU7Q1CN9s1v9NSJYOaU?= =?iso-8859-1?q?+B/wptAQpBLo5G+cNgFpG5rKnjIWD7K+T7FFSZA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5703c808-08b1-42e3-7423-08dbe22d8b58 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 20:42:23.5860 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: h4tOOluxqO/4qLsSZ71s/8uGodtx/tTK1A/oB/q+pw/PxM7PTNVc6xuXjWs7VmAOigTjSZvqrWFoM+hJ+tEiGM8NqVj0JTH0+SPYRQUxg3Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8991 X-Proofpoint-GUID: CO5DezGelvZJUtJQjvaAJuNKkslVZEkG X-Proofpoint-ORIG-GUID: CO5DezGelvZJUtJQjvaAJuNKkslVZEkG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100172 From: Oleksandr Tyshchenko Both state (XenbusStateClosed) and online (0) are expected by toolstack/xl devd to completely destroy the device. But "offline" is never being set by the backend resulting in timeout during domain destruction, garbage in Xestore and still running Qemu instance. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/xen/xen-bus.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 75474d4b43..6e7ec3af64 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -519,6 +519,10 @@ static void xen_device_backend_changed(void *opaque, const char *path) xen_device_backend_set_state(xendev, XenbusStateClosed); } + if (xen_device_backend_get_state(xendev) == XenbusStateClosed) { + xen_device_backend_set_online(xendev, false); + } + /* * If a backend is still 'online' then we should leave it alone but, * if a backend is not 'online', then the device is a candidate