|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] tools/libxl: pull xenstore/console domids from xenstore
# HG changeset patch
# User Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
# Date 1328812409 0
# Node ID b0d53cb93cc6e47ea467ab7c24d42ed4090259b7
# Parent f341c34b6342d597b123e02db533a75a30f86197
tools/libxl: pull xenstore/console domids from xenstore
Instead of assuming that xenstored and xenconsoled are running in dom0,
pull the domain IDs from xenstore.
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 f341c34b6342 -r b0d53cb93cc6 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c Thu Feb 09 18:25:49 2012 +0000
+++ b/tools/libxl/libxl_dom.c Thu Feb 09 18:33:29 2012 +0000
@@ -64,6 +64,7 @@
{
libxl_ctx *ctx = libxl__gc_owner(gc);
int tsc_mode;
+ char *xs_domid, *con_domid;
xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus);
libxl_set_vcpuaffinity_all(ctx, domid, info->max_vcpus, &info->cpumap);
xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
LIBXL_MAXMEM_CONSTANT);
@@ -96,9 +97,18 @@
xc_shadow_control(ctx->xch, domid,
XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION, NULL, 0, &shadow, 0, NULL);
}
- state->store_port = xc_evtchn_alloc_unbound(ctx->xch, domid, 0);
- state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid, 0);
+ xs_domid = xs_read(ctx->xsh, XBT_NULL, "/tool/xenstored/domid", NULL);
+ state->store_domid = xs_domid ? atoi(xs_domid) : 0;
+ free(xs_domid);
+
+ con_domid = xs_read(ctx->xsh, XBT_NULL, "/tool/xenconsoled/domid", NULL);
+ state->console_domid = con_domid ? atoi(con_domid) : 0;
+ free(con_domid);
+
+ state->store_port = xc_evtchn_alloc_unbound(ctx->xch, domid,
state->store_domid);
+ state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid,
state->console_domid);
state->vm_generationid_addr = 0;
+
return 0;
}
diff -r f341c34b6342 -r b0d53cb93cc6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Thu Feb 09 18:25:49 2012 +0000
+++ b/tools/libxl/libxl_internal.h Thu Feb 09 18:33:29 2012 +0000
@@ -595,9 +595,11 @@
libxl__domain_type((gc), (domid)) == LIBXL_DOMAIN_TYPE_##type
typedef struct {
uint32_t store_port;
+ uint32_t store_domid;
unsigned long store_mfn;
uint32_t console_port;
+ uint32_t console_domid;
unsigned long console_mfn;
unsigned long vm_generationid_addr;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |