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

[XEN][PATCH 1/2] xenstored: Default priv_domid to store_domid


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 24 Nov 2025 17:35:32 -0500
  • 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=khaXepjy+mj83tuBL39eaODPf2psvhrTF2r85Z9Phx8=; b=m1DxVODS1/tfk8fyQNJY4a91oBYeUulEBtUl5jAjp13dUeiQ1TYpCN8OD2AhHP1zebkejojSmkqb+F2vV3VuSmO/nieZrYR60qWsRc89wdZ14rJgOuEvGWyqQRuSuqSlq2pTEJXcpoSOz65Pu4w/79P73rL/r8IcD/BDI0613CPjDcm/LDdWSvPJ0mncHxlaBdVll9mbvTtD0kdCk15iYDOv/AMcjTabVIhTlX5xK/SnYzHPQGFlARW2BqUeMwtPRcVo1QjF9RKjoL7+mY1OaXKj5q2cGIHslXhIio/Zb1tdDp1m5AuwTxhWdHtDplHQYCnpamzFsNZCJEf/O0mnAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R6/ZhQIWZfsg+3XV83qk6mXwRFtzRW9pTfJAw3h084zYm6hfa/zQ22uLmWUw3G8BsKs27jJXrU9wQfcZpcRzJdmFYnCRmGp/BgpKxZp2wrl5MZy0Z/S0zukHXalpp+U9fuawPb9OR9OuzPbGebD/KDVKvdQrVDIwLIsvHEWljYA8dm5ff1v0JB3ZE2C9ATQUv/EQzWGfFETFz4BQybMOrT0xc16q4GVzlRPMQA4/YsWlK76uoEWjBr3SzL6D+OVS6VgKXCTJFNG5TV3N+XuqEFAu4GVGsWb37wURsS/Yv5ltmDna9kFPYCiS21Y32wkt/+UwcmegTDoW4VZKs1jD0w==
  • Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Mon, 24 Nov 2025 22:36:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On a system without a control domain, a hardware|xenstore domain
starting xenstored shows:
common/grant_table.c:1041:d2v0 Could not find domain 32756
gnttab: error: mmap failed: Invalid argument
Could not initialize dom32756

setup_structure() does not get called without priv_domid.  Subsequent
introduce_domain() calls will fault when calling fire_special_watches().

Default priv_domid to store_domid when there is no control domain.

Fixes: e5b0a9405571 ("tools/xenstored: Auto-introduce domains")
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
I didn't verify the segfault in fire_watches() in this situation, but I
saw that previously when working on this.  Regardless of the specific
error, xenstored was not working properly without this change.
---
 tools/xenstored/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 5ce539d640..d504e9994b 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -1388,6 +1388,12 @@ void init_domains(void)
        if (store_domid == DOMID_INVALID)
                barf("Could not determine xenstore domid\n");
 
+       if (priv_domid == DOMID_INVALID)
+       {
+               priv_domid = store_domid;
+               xprintf("priv_domid defaulted to %u\n", priv_domid);
+       }
+
        snprintf(store_domain_path, sizeof(store_domain_path),
                 "/local/domain/%u", store_domid);
 
-- 
2.51.1




 


Rackspace

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