|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 15/18] xenstored: add --event parameter for bootstrapping
On Thu, 2012-01-12 at 23:35 +0000, Daniel De Graaf wrote:
> 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 | 13 ++++++++++++-
> 3 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index e51f2ad..4ec63f1 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -1771,6 +1771,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' },
> @@ -1784,6 +1785,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 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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |