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

[Xen-devel] [PATCH 15/18] xenstored: add --event parameter for bootstrapping



When xenstored is run in a minios domain, it needs a bootstrap
connection to dom0 so that additional domain introduce messages can be
sent to it.

Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
 tools/xenstore/xenstored_core.c   |    5 +++++
 tools/xenstore/xenstored_core.h   |    1 +
 tools/xenstore/xenstored_domain.c |   13 ++++++++++++-
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 2d4a7e1..7b63a68 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1774,6 +1774,7 @@ static struct option options[] = {
        { "no-domain-init", 0, NULL, 'D' },
        { "entry-nb", 1, NULL, 'E' },
        { "pid-file", 1, NULL, 'F' },
+       { "event", 1, NULL, 'e' },
        { "help", 0, NULL, 'H' },
        { "no-fork", 0, NULL, 'N' },
        { "output-pid", 0, NULL, 'P' },
@@ -1787,6 +1788,7 @@ static struct option options[] = {
        { NULL, 0, NULL, 0 } };
 
 extern void dump_conn(struct connection *conn); 
+int dom0_event = 0;
 
 int main(int argc, char *argv[])
 {
@@ -1849,6 +1851,9 @@ int main(int argc, char *argv[])
                case 'W':
                        quota_nb_watch_per_domain = strtol(optarg, NULL, 10);
                        break;
+               case 'e':
+                       dom0_event = strtol(optarg, NULL, 10);
+                       break;
                }
        }
        if (optind != argc)
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index c487089..d3040ba 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -168,6 +168,7 @@ void trace(const char *fmt, ...);
 void dtrace_io(const struct connection *conn, const struct buffered_data 
*data, int out);
 
 extern int event_fd;
+extern int dom0_event;
 
 /* Map the kernel's xenstore page. */
 void *xenbus_map(void);
diff --git a/tools/xenstore/xenstored_domain.c 
b/tools/xenstore/xenstored_domain.c
index aca2149..648eb1d 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -593,8 +593,19 @@ void restore_existing_connections(void)
 }
 
 #ifdef __MINIOS__
-static inline int dom0_init(void) 
+static int dom0_init(void)
 {
+       struct domain *domain;
+       int domid = 0;
+       evtchn_port_t port = dom0_event;
+
+       domain = new_domain(NULL, domid, port);
+       domain->interface = xc_gnttab_map_grant_ref(*xcg_handle, domid,
+                       GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
+       talloc_steal(domain->conn, domain);
+
+       xc_evtchn_notify(xce_handle, domain->port);
+
        return 0;
 }
 #else
-- 
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®.