On 2025-04-01 04:07, Jan Beulich wrote:
On 31.03.2025 23:46, Jason Andryuk wrote:
It is useful for a domain to know its own domid. Xenstored has command
line flags to set --master-domid (the local domid) and --priv-domid, but
it would be better to autodetect those. Also, domids are necessary to
set xenstore permissions - DOMID_SELF is not supported today.
Setting permissions for oneself?
Any call to xs_set_permissions(), AIUI. Say you have two domUs, dom1 &
dom2. dom1 wants to create a shared xenstore node with full permissions
for itself, but read-only permission for dom2. dom1 needs to know its
own domid to set the permissions:
* struct xs_permissions perms[2];
*
* perms[0].id = domid1;
* perms[0].perms = XS_PERM_NONE;
* perms[1].id = domid2;
* perms[1].perms = XS_PERM_READ;
perms[].id doesn't handle DOMID_SELF
Since guests have ways to figure out their IDs, there's probably nothing
wrong with having a dedicated means for them to obtain them. It just needs
to be made very clear that the ID can (and, at least for now, typically
will) change across migration. As to the mechanism thereof, I stand by my
views voiced in that earlier thread you point at.
Thanks,
Jason