mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xenstored: Use priv_domid for manual nodes and permission
Usually, priv_domid == dom0_domid == 0, and that is what is expected. If we rename s/dom0_domid/store_domid/, it seems more likely we want to actually have the priv_domid as the owner. That leads to follow on changes to ensure that the priv_domid is created first. Signed-off-by: Jason Andryuk <jason.andryuk@amd.com> Reviewed-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
1 parent
1b4e935f45
commit
c67def341a
2 files changed
+9
-9
No files matched your search
@@ -2269,7 +2269,7 @@ struct connection *get_connection_by_id(unsigned int conn_id)
|
||||
static void manual_node(const char *name, const char *child)
|
||||
{
|
||||
struct node *node;
|
||||
struct xs_permissions perms = { .id = dom0_domid,
|
||||
struct xs_permissions perms = { .id = priv_domid,
|
||||
.perms = XS_PERM_NONE };
|
||||
|
||||
node = talloc_zero(NULL, struct node);
|
||||
@@ -2320,7 +2320,7 @@ void setup_structure(bool live_update)
|
||||
manual_node("/tool/xenstored", NULL);
|
||||
manual_node("@releaseDomain", NULL);
|
||||
manual_node("@introduceDomain", NULL);
|
||||
domain_nbentry_fix(dom0_domid, 5, true);
|
||||
domain_nbentry_fix(priv_domid, 5, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1026,7 +1026,7 @@ static struct domain *introduce_domain(const void *ctx,
|
||||
struct domain *domain;
|
||||
int rc;
|
||||
struct xenstore_domain_interface *interface;
|
||||
bool is_master_domain = (domid == xenbus_master_domid());
|
||||
bool is_priv_domain = (domid == priv_domid);
|
||||
|
||||
domain = find_or_alloc_domain(ctx, domid);
|
||||
if (!domain)
|
||||
@@ -1051,13 +1051,13 @@ static struct domain *introduce_domain(const void *ctx,
|
||||
if (!restore)
|
||||
interface->server_features = domain->features;
|
||||
|
||||
if (is_master_domain)
|
||||
if (is_priv_domain)
|
||||
setup_structure(restore);
|
||||
|
||||
/* Now domain belongs to its connection. */
|
||||
talloc_steal(domain->conn, domain);
|
||||
|
||||
if (!is_master_domain && !restore)
|
||||
if (!is_priv_domain && !restore)
|
||||
fire_special_watches("@introduceDomain");
|
||||
} else {
|
||||
/* Use XS_INTRODUCE for recreating the xenbus event-channel. */
|
||||
@@ -1392,15 +1392,15 @@ void init_domains(void)
|
||||
barf("Could not determine xenstore domid\n");
|
||||
|
||||
/*
|
||||
* Local domid must be first to setup structures for firing the special
|
||||
* watches.
|
||||
* Privileged domid must be first to setup structures for firing the
|
||||
* special watches.
|
||||
*/
|
||||
if (init_domain(dom0_domid))
|
||||
if (init_domain(priv_domid))
|
||||
introduce_count++;
|
||||
|
||||
for (unsigned int i = 0; i < nr_domids; i++) {
|
||||
domid = domids[i];
|
||||
if (domid == dom0_domid)
|
||||
if (domid == priv_domid)
|
||||
continue;
|
||||
|
||||
if (init_domain(domid))
|
||||
|
||||