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

[QEMU][PATCH v2 06/11] hw/xen/xen-hvm-common: skip ioreq creation on ioreq registration failure


  • To: <qemu-dev@xxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Thu, 1 Dec 2022 18:59:58 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xilinx.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=xRRFGuFvueAPG6dlfB7wV8P+a2w87xfPGOLdmtUaYEQ=; b=k1Yr3MFayRr2IbB21sR/cIzsYcOAQYr15iVnz0F6tTwsz99VJnIm+BZtWO6DfX4dq4xczcwZukooQa3sMC/Z/uatf0YBeubGmI9BHoJkxjggv588Y1tpQDZzh3H5NAmaNzz3NpFvdoW56ly2PZQ/zI/vBAAW5aBncfOFUvcPxlHAeenWfggyHekiOw+V1W92fHQU79UqPRlx9UI0qjyDzddBC/OpSXlNTep0hXSMwhW1hCG37j9Ww7q0/Q6bv8ZCLjiSwh9z/38nD229h90zXuUNCaxZrAy0NDLpxKUK/YcxTRxyKbosu1efxq5UyxN4HTc220YwaMzn8qlLJmvJLg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E/w54uctNl1NIZaOHl5i9kGa0YNO308rr13xsV0u2MjImQK6z1SQheBHw4gXUIJ9mht5hAp+m25XSTIhIBDO0HDOZ8n7C44SH30EDZNf6v7uRmAAoxZ//FP1D9dFko/KS4mCyuvZPndlgxDiDCG6I5j/attPb658mXRI5MdM0LOq63OvesdrRhVm6tBGQFjjFhVABnoBvwO22Ttxy5rhgRJneroFI859bYGDA8XYNHVg8OXVZ9NTGqPr/4+pHO9FW5ww/86z5hqV01Yo2CUkawgxOAmmPwrRq0gP/PxflVX8ooRA2Gl90zCJn6bdU4vo1m4Dh/RsQ4zX4pFJETft4Q==
  • Cc: <stefano.stabellini@xxxxxxx>, <alex.bennee@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Vikram Garhwal <vikram.garhwal@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "open list:All patches CC here" <qemu-devel@xxxxxxxxxx>
  • Delivery-date: Fri, 02 Dec 2022 03:00:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Stefano Stabellini <stefano.stabellini@xxxxxxx>

On ARM it is possible to have a functioning xenpv machine with only the
PV backends and no IOREQ server. If the IOREQ server creation fails continue
to the PV backends initialization.

Also, moved the IOREQ registration and mapping subroutine to new function
xen_do_ioreq_register().

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
---
 hw/xen/xen-hvm-common.c | 53 ++++++++++++++++++++++++++++-------------
 1 file changed, 36 insertions(+), 17 deletions(-)

diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
index 403b2eebbf..03128e575b 100644
--- a/hw/xen/xen-hvm-common.c
+++ b/hw/xen/xen-hvm-common.c
@@ -777,25 +777,12 @@ err:
     exit(1);
 }
 
-void xen_register_ioreq(XenIOState *state, unsigned int max_cpus,
-                        MemoryListener xen_memory_listener)
+static void xen_do_ioreq_register(XenIOState *state,
+                                           unsigned int max_cpus,
+                                           MemoryListener xen_memory_listener)
 {
     int i, rc;
 
-    state->xce_handle = xenevtchn_open(NULL, 0);
-    if (state->xce_handle == NULL) {
-        perror("xen: event channel open");
-        goto err;
-    }
-
-    state->xenstore = xs_daemon_open();
-    if (state->xenstore == NULL) {
-        perror("xen: xenstore open");
-        goto err;
-    }
-
-    xen_create_ioreq_server(xen_domid, &state->ioservid);
-
     state->exit.notify = xen_exit_notifier;
     qemu_add_exit_notifier(&state->exit);
 
@@ -859,10 +846,42 @@ void xen_register_ioreq(XenIOState *state, unsigned int 
max_cpus,
     QLIST_INIT(&state->dev_list);
     device_listener_register(&state->device_listener);
 
+    return;
+
+err:
+    error_report("xen hardware virtual machine initialisation failed");
+    exit(1);
+}
+
+void xen_register_ioreq(XenIOState *state, unsigned int max_cpus,
+                        MemoryListener xen_memory_listener)
+{
+    int rc;
+
+    state->xce_handle = xenevtchn_open(NULL, 0);
+    if (state->xce_handle == NULL) {
+        perror("xen: event channel open");
+        goto err;
+    }
+
+    state->xenstore = xs_daemon_open();
+    if (state->xenstore == NULL) {
+        perror("xen: xenstore open");
+        goto err;
+    }
+
+    rc = xen_create_ioreq_server(xen_domid, &state->ioservid);
+    if (!rc) {
+        xen_do_ioreq_register(state, max_cpus, xen_memory_listener);
+    } else {
+        warn_report("xen: failed to create ioreq server");
+    }
+
     xen_bus_init();
 
     return;
+
 err:
-    error_report("xen hardware virtual machine initialisation failed");
+    error_report("xen hardware virtual machine backend registration failed");
     exit(1);
 }
-- 
2.17.0




 


Rackspace

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