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

[Xen-devel] [PATCH 18/21] 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>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/xenstore/xenstored_core.c   |    5 +++++
 tools/xenstore/xenstored_core.h   |    1 +
 tools/xenstore/xenstored_domain.c |   11 +++++++++++
 3 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 66ca555..aad0298 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1775,6 +1775,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' },
@@ -1788,6 +1789,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[])
 {
@@ -1847,6 +1849,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 435f76a..6a0dbc2 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -602,6 +602,17 @@ void restore_existing_connections(void)
 #ifdef __MINIOS__
 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®.