aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xc
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-04-08 16:40:13 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-04-08 16:40:13 +0000
commitf677efb823a2c576236e96510ca45e5c54df96d1 (patch)
treed95f76f404c96fb8d579520004fddac53b474cd7 /tools/xc
parent98da02c11d9f6226418a7d692bc961ab24ae9ce6 (diff)
downloadxen-f677efb823a2c576236e96510ca45e5c54df96d1.tar.gz
xen-f677efb823a2c576236e96510ca45e5c54df96d1.tar.bz2
xen-f677efb823a2c576236e96510ca45e5c54df96d1.zip
bitkeeper revision 1.856 (4075806dGVuPwXtbZgPbDT2-zKk0gw)
New control-interface functionality for Xenolinux. Also extended start_info_t to include the event-channel index for the controller interface.
Diffstat (limited to 'tools/xc')
-rw-r--r--tools/xc/lib/Makefile1
-rw-r--r--tools/xc/lib/xc.h6
-rw-r--r--tools/xc/lib/xc_linux_build.c16
-rw-r--r--tools/xc/lib/xc_netbsd_build.c16
-rw-r--r--tools/xc/lib/xc_private.h3
-rw-r--r--tools/xc/py/Xc.c24
6 files changed, 44 insertions, 22 deletions
diff --git a/tools/xc/lib/Makefile b/tools/xc/lib/Makefile
index 35a7b392fa..79dce046df 100644
--- a/tools/xc/lib/Makefile
+++ b/tools/xc/lib/Makefile
@@ -6,6 +6,7 @@ SONAME = libxc.so.$(MAJOR)
CC = gcc
CFLAGS = -c -Wall -O3 -fno-strict-aliasing
CFLAGS += -I../../../xen/include/hypervisor-ifs
+CFLAGS += -I../../xend/lib
CFLAGS += -I../../../xenolinux-sparse/include
HDRS = $(wildcard *.h)
diff --git a/tools/xc/lib/xc.h b/tools/xc/lib/xc.h
index 48b296b40a..936dd852c0 100644
--- a/tools/xc/lib/xc.h
+++ b/tools/xc/lib/xc.h
@@ -69,12 +69,14 @@ int xc_linux_build(int xc_handle,
u64 domid,
const char *image_name,
const char *ramdisk_name,
- const char *cmdline);
+ const char *cmdline,
+ unsigned int control_evtchn);
int xc_netbsd_build(int xc_handle,
u64 domid,
const char *image_name,
- const char *cmdline);
+ const char *cmdline,
+ unsigned int control_evtchn);
int xc_bvtsched_global_set(int xc_handle,
unsigned long ctx_allow);
diff --git a/tools/xc/lib/xc_linux_build.c b/tools/xc/lib/xc_linux_build.c
index 3acfc2173d..6f10afde1a 100644
--- a/tools/xc/lib/xc_linux_build.c
+++ b/tools/xc/lib/xc_linux_build.c
@@ -72,7 +72,8 @@ static int setup_guestos(int xc_handle,
unsigned long *pvsi, unsigned long *pvke,
dom0_builddomain_t *builddomain,
const char *cmdline,
- unsigned long shared_info_frame)
+ unsigned long shared_info_frame,
+ unsigned int control_evtchn)
{
l1_pgentry_t *vl1tab=NULL, *vl1e=NULL;
l2_pgentry_t *vl2tab=NULL, *vl2e=NULL;
@@ -80,7 +81,7 @@ static int setup_guestos(int xc_handle,
unsigned long l2tab;
unsigned long l1tab;
unsigned long count, i;
- start_info_t *start_info;
+ extended_start_info_t *start_info;
shared_info_t *shared_info;
mmu_t *mmu = NULL;
int pm_handle=-1, rc;
@@ -272,13 +273,14 @@ static int setup_guestos(int xc_handle,
start_info->pt_base = vpt_start;
start_info->nr_pt_frames = nr_pt_pages;
start_info->mfn_list = vphysmap_start;
+ start_info->domain_controller_evtchn = control_evtchn;
if ( initrd_len != 0 )
{
start_info->mod_start = vinitrd_start;
start_info->mod_len = initrd_len;
}
- strncpy(start_info->cmd_line, cmdline, MAX_CMD_LEN);
- start_info->cmd_line[MAX_CMD_LEN-1] = '\0';
+ strncpy(start_info->cmd_line, cmdline, MAX_CMDLINE);
+ start_info->cmd_line[MAX_CMDLINE-1] = '\0';
unmap_pfn(pm_handle, start_info);
/* shared_info page starts its life empty. */
@@ -379,7 +381,8 @@ int xc_linux_build(int xc_handle,
u64 domid,
const char *image_name,
const char *ramdisk_name,
- const char *cmdline)
+ const char *cmdline,
+ unsigned int control_evtchn)
{
dom0_op_t launch_op, op;
int initrd_fd = -1;
@@ -436,7 +439,8 @@ int xc_linux_build(int xc_handle,
initrd_gfd, initrd_size, nr_pages,
&vstartinfo_start, &vkern_entry,
&launch_op.u.builddomain, cmdline,
- op.u.getdomaininfo.shared_info_frame) < 0 )
+ op.u.getdomaininfo.shared_info_frame,
+ control_evtchn) < 0 )
{
ERROR("Error constructing guest OS");
goto error_out;
diff --git a/tools/xc/lib/xc_netbsd_build.c b/tools/xc/lib/xc_netbsd_build.c
index a53018297c..db5552d26e 100644
--- a/tools/xc/lib/xc_netbsd_build.c
+++ b/tools/xc/lib/xc_netbsd_build.c
@@ -61,7 +61,8 @@ static int setup_guestos(int xc_handle,
unsigned long *virt_load_addr,
dom0_builddomain_t *builddomain,
const char *cmdline,
- unsigned long shared_info_frame)
+ unsigned long shared_info_frame,
+ unsigned int control_evtchn)
{
l1_pgentry_t *vl1tab=NULL, *vl1e=NULL;
l2_pgentry_t *vl2tab=NULL, *vl2e=NULL;
@@ -71,7 +72,7 @@ static int setup_guestos(int xc_handle,
unsigned long l1tab;
unsigned long count, pt_start;
unsigned long symtab_addr = 0, symtab_len = 0;
- start_info_t *start_info;
+ extended_start_info_t *start_info;
shared_info_t *shared_info;
unsigned long ksize;
mmu_t *mmu = NULL;
@@ -176,8 +177,9 @@ static int setup_guestos(int xc_handle,
start_info->nr_pages = tot_pages;
start_info->shared_info = shared_info_frame << PAGE_SHIFT;
start_info->flags = 0;
- strncpy(start_info->cmd_line, cmdline, MAX_CMD_LEN);
- start_info->cmd_line[MAX_CMD_LEN-1] = '\0';
+ start_info->domain_controller_evtchn = control_evtchn;
+ strncpy(start_info->cmd_line, cmdline, MAX_CMDLINE);
+ start_info->cmd_line[MAX_CMDLINE-1] = '\0';
unmap_pfn(pm_handle, start_info);
/* shared_info page starts its life empty. */
@@ -210,7 +212,8 @@ static int setup_guestos(int xc_handle,
int xc_netbsd_build(int xc_handle,
u64 domid,
const char *image_name,
- const char *cmdline)
+ const char *cmdline,
+ unsigned int control_evtchn)
{
dom0_op_t launch_op, op;
unsigned long load_addr;
@@ -259,7 +262,8 @@ int xc_netbsd_build(int xc_handle,
if ( setup_guestos(xc_handle, domid, kernel_gfd, tot_pages,
&virt_startinfo_addr,
&load_addr, &launch_op.u.builddomain, cmdline,
- op.u.getdomaininfo.shared_info_frame) < 0 )
+ op.u.getdomaininfo.shared_info_frame,
+ control_evtchn) < 0 )
{
ERROR("Error constructing guest OS");
goto error_out;
diff --git a/tools/xc/lib/xc_private.h b/tools/xc/lib/xc_private.h
index dda04a9f8d..b6c78b74fd 100644
--- a/tools/xc/lib/xc_private.h
+++ b/tools/xc/lib/xc_private.h
@@ -25,6 +25,9 @@
#include <event_channel.h>
#include <sched_ctl.h>
+/* from xend/lib */
+#include <domain_controller.h>
+
#define _PAGE_PRESENT 0x001
#define _PAGE_RW 0x002
#define _PAGE_USER 0x004
diff --git a/tools/xc/py/Xc.c b/tools/xc/py/Xc.c
index 5114b52afe..3c6fd7abd9 100644
--- a/tools/xc/py/Xc.c
+++ b/tools/xc/py/Xc.c
@@ -225,14 +225,18 @@ static PyObject *pyxc_linux_build(PyObject *self,
u64 dom;
char *image, *ramdisk = NULL, *cmdline = "";
+ int control_evtchn;
- static char *kwd_list[] = { "dom", "image", "ramdisk", "cmdline", NULL };
+ static char *kwd_list[] = { "dom", "control_evtchn",
+ "image", "ramdisk", "cmdline", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "Ls|ss", kwd_list,
- &dom, &image, &ramdisk, &cmdline) )
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "Lis|ss", kwd_list,
+ &dom, &control_evtchn,
+ &image, &ramdisk, &cmdline) )
return NULL;
- if ( xc_linux_build(xc->xc_handle, dom, image, ramdisk, cmdline) != 0 )
+ if ( xc_linux_build(xc->xc_handle, dom, image,
+ ramdisk, cmdline, control_evtchn) != 0 )
return PyErr_SetFromErrno(xc_error);
Py_INCREF(zero);
@@ -247,14 +251,18 @@ static PyObject *pyxc_netbsd_build(PyObject *self,
u64 dom;
char *image, *ramdisk = NULL, *cmdline = "";
+ int control_evtchn;
- static char *kwd_list[] = { "dom", "image", "ramdisk", "cmdline", NULL };
+ static char *kwd_list[] = { "dom", "control_evtchn",
+ "image", "ramdisk", "cmdline", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "Ls|ss", kwd_list,
- &dom, &image, &ramdisk, &cmdline) )
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "Lis|ss", kwd_list,
+ &dom, &control_evtchn,
+ &image, &ramdisk, &cmdline) )
return NULL;
- if ( xc_netbsd_build(xc->xc_handle, dom, image, cmdline) != 0 )
+ if ( xc_netbsd_build(xc->xc_handle, dom, image,
+ cmdline, control_evtchn) != 0 )
return PyErr_SetFromErrno(xc_error);
Py_INCREF(zero);