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

[PATCH v3 6/8] tools/init-dom0less: Remove use of err()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 26 Aug 2025 17:08:45 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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 (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=vmz6tXiI9igMexXwJMlZ7JfZtLtNIFmz/j0H60IpHMU=; b=KXRR2LQM6N3otoCvC/1Imtn3oyq3tHsDLIO0XeU1if+9pq0X31n0QK8AVUgz7rDCcQldxXL9lhOJn+VL2bJpEFcsD6K+SOMr+SrO2broHlalls4prK624uh/SORIguv0yE9lBNjperbaUoqOg+DtLE2hDY/jGx93cSi4lqGtT6c6N359CLPfIr3N9+Pl+d09XWquS+NlU9J6+ikYXJkX297mY1I2nR9lr7wPjFOTkre1X2UIXcZXSn0TO2iw33CLYG1TBnhdWhwUrAJhLnNQV4/bzC4pjm/A4MvEliA/7K5o3cs76gOXU5Z7O/GlIwGFOELDzL0Zt2xuGjzTMVgyIg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TmXnxjrb5hHVt3v1GJGOt/pBc0m86jlBPRuqMoD3I7ePzwNTwj2rwGr0SZJy2bDM5PQhpwSF5ifmhiJ7niZhNfo8uVQd5ddNmD40ZsVU3p8lAysNJPoSATFZBaHwW9Z4Ag4S1RUOmK/FpYa0/POc2QxsHvkYdkuu4WqlSZlEEBBkTvr4hIJHvi22ahUMItau7MKP4UbDmA7xYljRpTvB7xyziesa6RLTzI4KJB4MmSMjcGsV9EQjQAwkPAEwXI7a9EofPWzl8g21jXXSt+Z50+rqDyz0OMDpNq9jdkMYffM1Kv6Xms0BEd13yNQCFuc+JnlUVBWTr6d5CZ/a9KGlkA==
  • Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Tue, 26 Aug 2025 21:09:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

err() is fatal - print a message and exit.  We want init-dom0less to
continue on as much as possible, so replace with returning an error.

Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
v3:
New
---
 tools/helpers/init-dom0less.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
index a4de40aeac..d08b0b1362 100644
--- a/tools/helpers/init-dom0less.c
+++ b/tools/helpers/init-dom0less.c
@@ -300,8 +300,10 @@ static int configure_xenstore(libxl_dominfo *info,
 
         rc = xc_dom_gnttab_seed(xch, info->domid, true,
                                 (xen_pfn_t)-1, *xenstore_pfn, 0, 0);
-        if (rc)
-               err(1, "xc_dom_gnttab_seed");
+        if (rc) {
+            printf("xc_dom_gnttab_seed");
+            return 1;
+        }
     }
 
     return 0;
@@ -329,18 +331,24 @@ static int init_domain(libxl_dominfo *info)
     xc_domain_sethandle(xch, info->domid, libxl_uuid_bytearray(&uuid));
 
     rc = gen_stub_json_config(info->domid, &uuid);
-    if (rc)
-        err(1, "gen_stub_json_config");
+    if (rc) {
+        printf("gen_stub_json_config");
+        return 1;
+    }
 
     rc = create_xenstore(info, uuid, xenstore_pfn, xenstore_evtchn);
-    if (rc)
-        err(1, "writing to xenstore");
+    if (rc) {
+        printf("writing to xenstore");
+        return 1;
+    }
 
     if (!introduced) {
         rc = xs_introduce_domain(xsh, info->domid, xenstore_pfn,
                                  xenstore_evtchn);
-        if (!rc)
-            err(1, "xs_introduce_domain");
+        if (!rc) {
+            printf("xs_introduce_domain");
+            return 1;
+        }
     }
 
     return 0;
-- 
2.50.1




 


Rackspace

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