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

[Xen-devel] [PATCH 16/18] xenstored: pull dom0 event port from shared page



When building the xenstored domain using xl, it is difficult to specify
the event channel number on the command line because the command line is
parsed prior to domain creation, while the event channel cannot be
created until after domain creation. To avoid needing a special domain
builder for the xenstore domain, store the event channel port in an
unused field of the shared page.

Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
 tools/xenstore/xenstored_domain.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_domain.c 
b/tools/xenstore/xenstored_domain.c
index 648eb1d..b100aa4 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -598,10 +598,18 @@ static int dom0_init(void)
        struct domain *domain;
        int domid = 0;
        evtchn_port_t port = dom0_event;
+       void *interface;
 
-       domain = new_domain(NULL, domid, port);
-       domain->interface = xc_gnttab_map_grant_ref(*xcg_handle, domid,
+       interface = xc_gnttab_map_grant_ref(*xcg_handle, domid,
                        GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
+
+       if (!port) {
+               port = *(uint16_t*)(interface +
+                       sizeof(struct xenstore_domain_interface));
+       }
+
+       domain = new_domain(NULL, domid, port);
+       domain->interface = interface;
        talloc_steal(domain->conn, domain);
 
        xc_evtchn_notify(xce_handle, domain->port);
-- 
1.7.7.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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