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

[Xen-changelog] [xen-unstable] xenstored: add --event parameter for bootstrapping



# HG changeset patch
# User Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
# Date 1328812415 0
# Node ID c442ebf5834d7b1a08d40a99a2babd0517e02713
# Parent  f371834bac0998d1eaa0cb5d8943f1c231afc5d1
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>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r f371834bac09 -r c442ebf5834d tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Thu Feb 09 18:33:34 2012 +0000
+++ b/tools/xenstore/xenstored_core.c   Thu Feb 09 18:33:35 2012 +0000
@@ -1749,6 +1749,7 @@
        { "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' },
@@ -1763,6 +1764,7 @@
        { NULL, 0, NULL, 0 } };
 
 extern void dump_conn(struct connection *conn); 
+int dom0_event = 0;
 
 int main(int argc, char *argv[])
 {
@@ -1820,6 +1822,9 @@
                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 -r f371834bac09 -r c442ebf5834d tools/xenstore/xenstored_core.h
--- a/tools/xenstore/xenstored_core.h   Thu Feb 09 18:33:34 2012 +0000
+++ b/tools/xenstore/xenstored_core.h   Thu Feb 09 18:33:35 2012 +0000
@@ -168,6 +168,7 @@
 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);
@@ -190,6 +191,8 @@
 /* Open a pipe for signal handling */
 void init_pipe(int reopen_log_pipe[2]);
 
+xc_gnttab **xcg_handle;
+
 #endif /* _XENSTORED_CORE_H */
 
 /*
diff -r f371834bac09 -r c442ebf5834d tools/xenstore/xenstored_domain.c
--- a/tools/xenstore/xenstored_domain.c Thu Feb 09 18:33:34 2012 +0000
+++ b/tools/xenstore/xenstored_domain.c Thu Feb 09 18:33:35 2012 +0000
@@ -35,7 +35,7 @@
 #include <xen/grant_table.h>
 
 static xc_interface **xc_handle;
-static xc_gnttab **xcg_handle;
+xc_gnttab **xcg_handle;
 static evtchn_port_t virq_port;
 
 xc_evtchn *xce_handle = NULL;
diff -r f371834bac09 -r c442ebf5834d tools/xenstore/xenstored_minios.c
--- a/tools/xenstore/xenstored_minios.c Thu Feb 09 18:33:34 2012 +0000
+++ b/tools/xenstore/xenstored_minios.c Thu Feb 09 18:33:35 2012 +0000
@@ -46,15 +46,17 @@
 
 evtchn_port_t xenbus_evtchn(void)
 {
-       return -1;
+       return dom0_event;
 }
 
 void *xenbus_map(void)
 {
-       return NULL;
+       return xc_gnttab_map_grant_ref(*xcg_handle, 0,
+                       GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
 }
 
 void unmap_xenbus(void *interface)
 {
+       xc_gnttab_munmap(*xcg_handle, interface, 1);
 }
 

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


 


Rackspace

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