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

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


  • To: <qemu-devel@xxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Wed, 25 Jan 2023 00:43:52 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org 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=URxTp3Cj5zWl6imZ6G51I5Cd2LY5Q6C4OO3dPqmmi+4=; b=GYyvDxPxnwwehsB2XdCkyPJImoshu+qrGPsy3uhPQo0H+UKylWR7pgPcyVAk0nhcOIJ1b/gqcNqhRyp4P7eNHcYCxhwc6C0l9I7pXMzb+lJJz94hYJ60vlxPtCOiMMCr0hR1YHEh0CzDfU70pALAUCzBAs8hLNAl/SDGicEg4twpTiUhcohNUA0ReD4ml6zetGQwyfK2tms25c9EVEKtAhSgp57UzuVnRbbnDA8p7gDfeOArV0HNo/SeJ6eVluJ8hIUidQl32Rh7tbKpFlNM0jb62CzO1x+UmcmjSv6wpXMBOAdCVF46nn9S7xP9lExDBrZVKp91gTanUNUNCz25TA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n6GieLWep7fHehfvtO0P7hxmp62pV8AyyOXQ+4WMhZDO8667MwB5/I+XmVm8PoYlfnPNP7R1Gm7EqtCxjXDCffFD2jNV/blLYSh7sCgbuhMxjFQ9G5k9+1HE/RFC0BQVvyTJsoDGRgyLBqX2o9wglmv9pl98yIuuWlBg64eEm/GBdjmR2gacct/GYpv3JHXl2Qn4iJj3oJfFAehTQMaFt6KfkOOmAYZ94azOmYpjNzc6U/tVAgfUyP4vjhXYjMrPw96GpfRRXXLcpXvkHMKb7zDvmyZgYI4XzzfVQ/BF0CvxlVhFBm5ePei4zW1ccciPRJbNrYubS5wpt2AUZwelhw==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <vikram.garhwal@xxxxxxx>, <stefano.stabellini@xxxxxxx>, <alex.bennee@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, "Paul Durrant" <paul@xxxxxxx>
  • Delivery-date: Wed, 25 Jan 2023 08:46:49 +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 e748d8d423..94dbbe97ed 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,12 +846,44 @@ 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();
 
     xen_register_backend(state);
 
     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®.