[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed


  • To: "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 10 Nov 2023 20:42:23 +0000
  • Accept-language: en-US
  • 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
  • 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-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==
  • Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "open list:X86 Xen CPUs" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 10 Nov 2023 20:42:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaFBZoiczA8QKKJkeUUC5gOc8rQg==
  • Thread-topic: [PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

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 <oleksandr_tyshchenko@xxxxxxxx>
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
---
 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
-- 
2.42.0



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.