This patch renames libxc to libxenctrl and updates everything else
accordingly.
Regards,
Anthony Liguori
# HG changeset patch
# User Anthony Liguori <aliguori@xxxxxxxxxx>
# Node ID 54370eeeb3311db2bcacfc797766a5993a079b4c
# Parent b74c15e4dd4f77b11ecb3eb112b94e0dbbc14607
Rename libxc => libxenctrl and xc.h => xen/xenctrl.h
Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/blktap/blktaplib.h
--- a/tools/blktap/blktaplib.h Wed Aug 24 16:15:42 2005
+++ b/tools/blktap/blktaplib.h Wed Aug 24 20:38:03 2005
@@ -7,7 +7,7 @@
#ifndef __BLKTAPLIB_H__
#define __BLKTAPLIB_H__
-#include <xc.h>
+#include <xenctrl.h>
#include <sys/user.h>
#include <xen/xen.h>
#include <xen/io/blkif.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/blktap/parallax/block-async.h
--- a/tools/blktap/parallax/block-async.h Wed Aug 24 16:15:42 2005
+++ b/tools/blktap/parallax/block-async.h Wed Aug 24 20:38:03 2005
@@ -7,7 +7,7 @@
#define _BLOCKASYNC_H_
#include <assert.h>
-#include <xc.h>
+#include <xenctrl.h>
#include "vdi.h"
struct io_ret
diff -r b74c15e4dd4f -r 54370eeeb331 tools/blktap/parallax/blockstore.h
--- a/tools/blktap/parallax/blockstore.h Wed Aug 24 16:15:42 2005
+++ b/tools/blktap/parallax/blockstore.h Wed Aug 24 20:38:03 2005
@@ -10,7 +10,7 @@
#define __BLOCKSTORE_H__
#include <netinet/in.h>
-#include <xc.h>
+#include <xenctrl.h>
#define BLOCK_SIZE 4096
#define BLOCK_SHIFT 12
diff -r b74c15e4dd4f -r 54370eeeb331 tools/console/Makefile
--- a/tools/console/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/console/Makefile Wed Aug 24 20:38:03 2005
@@ -26,11 +26,11 @@
xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
$(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
- -lxc -lxenstore
+ -lxenctrl -lxenstore
xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
$(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
- -lxc -lxenstore
+ -lxenctrl -lxenstore
install: $(BIN)
$(INSTALL_DIR) -p $(DESTDIR)/$(DAEMON_INSTALL_DIR)
diff -r b74c15e4dd4f -r 54370eeeb331 tools/console/client/main.c
--- a/tools/console/client/main.c Wed Aug 24 16:15:42 2005
+++ b/tools/console/client/main.c Wed Aug 24 20:38:03 2005
@@ -36,7 +36,7 @@
#include <errno.h>
#include <pty.h>
-#include "xc.h"
+#include "xenctrl.h"
#include "xs.h"
#define ESCAPE_CHARACTER 0x1d
diff -r b74c15e4dd4f -r 54370eeeb331 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Wed Aug 24 16:15:42 2005
+++ b/tools/console/daemon/io.c Wed Aug 24 20:38:03 2005
@@ -23,7 +23,7 @@
#include "utils.h"
#include "io.h"
-#include "xc.h"
+#include "xenctrl.h"
#include "xs.h"
#include "xen/io/domain_controller.h"
#include "xcs_proto.h"
diff -r b74c15e4dd4f -r 54370eeeb331 tools/console/daemon/main.c
--- a/tools/console/daemon/main.c Wed Aug 24 16:15:42 2005
+++ b/tools/console/daemon/main.c Wed Aug 24 20:38:03 2005
@@ -25,7 +25,7 @@
#include <unistd.h>
#include <sys/types.h>
-#include "xc.h"
+#include "xenctrl.h"
#include "xen/io/domain_controller.h"
#include "xcs_proto.h"
diff -r b74c15e4dd4f -r 54370eeeb331 tools/console/daemon/utils.c
--- a/tools/console/daemon/utils.c Wed Aug 24 16:15:42 2005
+++ b/tools/console/daemon/utils.c Wed Aug 24 20:38:03 2005
@@ -33,7 +33,7 @@
#include <sys/un.h>
#include <string.h>
-#include "xc.h"
+#include "xenctrl.h"
#include "xen/io/domain_controller.h"
#include "xcs_proto.h"
diff -r b74c15e4dd4f -r 54370eeeb331
tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c
--- a/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c
Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c
Wed Aug 24 20:38:03 2005
@@ -35,7 +35,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include <xc.h>
+#include <xenctrl.h>
#define TRACE_ENTER /* printf("enter %s\n", __FUNCTION__) */
long (*myptrace)(enum __ptrace_request, pid_t, long, long);
int (*myxcwait)(int domain, int *status, int options) ;
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/libxendebug/Makefile
--- a/tools/debugger/libxendebug/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/libxendebug/Makefile Wed Aug 24 20:38:03 2005
@@ -20,7 +20,7 @@
CFLAGS += -Wp,-MD,.$(@F).d
DEPS = .*.d
-LDFLAGS += -L$(XEN_ROOT)/tools/libxc -lxc
+LDFLAGS += -L$(XEN_ROOT)/tools/libxc -lxenctrl
LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/libxendebug/xendebug.c
--- a/tools/debugger/libxendebug/xendebug.c Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/libxendebug/xendebug.c Wed Aug 24 20:38:03 2005
@@ -12,7 +12,7 @@
#include <string.h>
#include <errno.h>
#include <sys/mman.h>
-#include <xc.h>
+#include <xenctrl.h>
#include "list.h"
#if defined(__i386__)
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/libxendebug/xendebug.h
--- a/tools/debugger/libxendebug/xendebug.h Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/libxendebug/xendebug.h Wed Aug 24 20:38:03 2005
@@ -9,7 +9,7 @@
#ifndef _XENDEBUG_H_DEFINED
#define _XENDEBUG_H_DEFINED
-#include <xc.h>
+#include <xenctrl.h>
int xendebug_attach(int xc_handle,
u32 domid,
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/pdb/pdb_caml_domain.c
--- a/tools/debugger/pdb/pdb_caml_domain.c Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/pdb/pdb_caml_domain.c Wed Aug 24 20:38:03 2005
@@ -6,7 +6,7 @@
* PDB's OCaml interface library for debugging domains
*/
-#include <xc.h>
+#include <xenctrl.h>
#include <xendebug.h>
#include <errno.h>
#include <stdio.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/pdb/pdb_caml_evtchn.c
--- a/tools/debugger/pdb/pdb_caml_evtchn.c Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/pdb/pdb_caml_evtchn.c Wed Aug 24 20:38:03 2005
@@ -6,7 +6,7 @@
* PDB's OCaml interface library for event channels
*/
-#include <xc.h>
+#include <xenctrl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/pdb/pdb_caml_process.c
--- a/tools/debugger/pdb/pdb_caml_process.c Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/pdb/pdb_caml_process.c Wed Aug 24 20:38:03 2005
@@ -15,7 +15,7 @@
#include <caml/memory.h>
#include <caml/mlvalues.h>
-#include <xc.h>
+#include <xenctrl.h>
#include <xen/xen.h>
#include <xen/io/domain_controller.h>
#include <xen/linux/privcmd.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/pdb/pdb_caml_xc.c
--- a/tools/debugger/pdb/pdb_caml_xc.c Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/pdb/pdb_caml_xc.c Wed Aug 24 20:38:03 2005
@@ -6,7 +6,7 @@
* PDB's OCaml interface library for debugging domains
*/
-#include <xc.h>
+#include <xenctrl.h>
#include <xendebug.h>
#include <errno.h>
#include <stdio.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/pdb/pdb_caml_xcs.c
--- a/tools/debugger/pdb/pdb_caml_xcs.c Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/pdb/pdb_caml_xcs.c Wed Aug 24 20:38:03 2005
@@ -17,7 +17,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <errno.h>
-#include <xc.h>
+#include <xenctrl.h>
#include <xen/xen.h>
#include <xen/io/domain_controller.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/debugger/pdb/pdb_xen.c
--- a/tools/debugger/pdb/pdb_xen.c Wed Aug 24 16:15:42 2005
+++ b/tools/debugger/pdb/pdb_xen.c Wed Aug 24 20:38:03 2005
@@ -7,7 +7,7 @@
* PDB interface library for accessing Xen
*/
-#include <xc.h>
+#include <xenctrl.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/firmware/acpi/acpi2_0.h
--- a/tools/firmware/acpi/acpi2_0.h Wed Aug 24 16:15:42 2005
+++ b/tools/firmware/acpi/acpi2_0.h Wed Aug 24 20:38:03 2005
@@ -18,7 +18,7 @@
#ifndef _ACPI_2_0_H_
#define _ACPI_2_0_H_
-#include "xc.h" // for u8, u16, u32, u64 definition
+#include "xenctrl.h" // for u8, u16, u32, u64 definition
#pragma pack (1)
diff -r b74c15e4dd4f -r 54370eeeb331 tools/ioemu/hw/i8254.c
--- a/tools/ioemu/hw/i8254.c Wed Aug 24 16:15:42 2005
+++ b/tools/ioemu/hw/i8254.c Wed Aug 24 20:38:03 2005
@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
#include "vl.h"
-#include "xc.h"
+#include "xenctrl.h"
#include <io/ioreq.h>
//#define DEBUG_PIT
diff -r b74c15e4dd4f -r 54370eeeb331 tools/ioemu/hw/i8259.c
--- a/tools/ioemu/hw/i8259.c Wed Aug 24 16:15:42 2005
+++ b/tools/ioemu/hw/i8259.c Wed Aug 24 20:38:03 2005
@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
#include "vl.h"
-#include "xc.h"
+#include "xenctrl.h"
#include <io/ioreq.h>
/* debug PIC */
diff -r b74c15e4dd4f -r 54370eeeb331 tools/ioemu/hw/ioapic.h
--- a/tools/ioemu/hw/ioapic.h Wed Aug 24 16:15:42 2005
+++ b/tools/ioemu/hw/ioapic.h Wed Aug 24 20:38:03 2005
@@ -26,7 +26,7 @@
#ifndef __IOAPIC_H
#define __IOAPIC_H
-#include "xc.h"
+#include "xenctrl.h"
#include <io/ioreq.h>
#include <io/vmx_vlapic.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/ioemu/target-i386-dm/Makefile
--- a/tools/ioemu/target-i386-dm/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/ioemu/target-i386-dm/Makefile Wed Aug 24 20:38:03 2005
@@ -188,7 +188,7 @@
#########################################################
DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-DAPIC_SUPPORT
-LIBS+=-lm -L../../libxc -lxc
+LIBS+=-lm -L../../libxc -lxenctrl
ifndef CONFIG_USER_ONLY
LIBS+=-lz
endif
diff -r b74c15e4dd4f -r 54370eeeb331 tools/ioemu/target-i386-dm/helper2.c
--- a/tools/ioemu/target-i386-dm/helper2.c Wed Aug 24 16:15:42 2005
+++ b/tools/ioemu/target-i386-dm/helper2.c Wed Aug 24 20:38:03 2005
@@ -47,7 +47,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
-#include "xc.h"
+#include "xenctrl.h"
#include <io/ioreq.h>
#include "cpu.h"
diff -r b74c15e4dd4f -r 54370eeeb331 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Wed Aug 24 16:15:42 2005
+++ b/tools/ioemu/vl.c Wed Aug 24 20:38:03 2005
@@ -72,7 +72,7 @@
#endif
#endif /* CONFIG_SDL */
-#include "xc.h"
+#include "xenctrl.h"
#include "exec-all.h"
//#define DO_TB_FLUSH
diff -r b74c15e4dd4f -r 54370eeeb331 tools/libxc/Makefile
--- a/tools/libxc/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/libxc/Makefile Wed Aug 24 20:38:03 2005
@@ -48,8 +48,8 @@
LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
-LIB := libxc.a libxc-pic.a
-LIB += libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
+LIB := libxenctrl.a libxenctrl-pic.a
+LIB += libxenctrl.so libxenctrl.so.$(MAJOR)
libxenctrl.so.$(MAJOR).$(MINOR)
all: build
build: check-for-zlib mk-symlinks
@@ -77,11 +77,11 @@
install: build
[ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR)
$(DESTDIR)/usr/$(LIBDIR)
[ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
- $(INSTALL_PROG) libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
- $(INSTALL_DATA) libxc.a $(DESTDIR)/usr/$(LIBDIR)
- ln -sf libxc.so.$(MAJOR).$(MINOR)
$(DESTDIR)/usr/$(LIBDIR)/libxc.so.$(MAJOR)
- ln -sf libxc.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxc.so
- $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
+ $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
+ $(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
+ ln -sf libxenctrl.so.$(MAJOR).$(MINOR)
$(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
+ ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
+ $(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include/xen
.PHONY: TAGS clean rpm install all
@@ -100,18 +100,18 @@
mv staging/i386/*.rpm .
rm -rf staging
-libxc.a: $(LIB_OBJS)
+libxenctrl.a: $(LIB_OBJS)
$(AR) rc $@ $^
-libxc-pic.a: $(PIC_OBJS)
+libxenctrl-pic.a: $(PIC_OBJS)
$(AR) rc $@ $^
-libxc.so: libxc.so.$(MAJOR)
+libxenctrl.so: libxenctrl.so.$(MAJOR)
ln -sf $< $@
-libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(MINOR)
+libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
ln -sf $< $@
-libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o
$@ $^ -lz
+libxenctrl.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenctrl.so.$(MAJOR)
-shared -o $@ $^ -lz
-include $(DEPS)
diff -r b74c15e4dd4f -r 54370eeeb331 tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h Wed Aug 24 16:15:42 2005
+++ b/tools/libxc/xc_private.h Wed Aug 24 20:38:03 2005
@@ -14,7 +14,7 @@
#include <errno.h>
#include <string.h>
-#include "xc.h"
+#include "xenctrl.h"
#include <xen/linux/privcmd.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/misc/Makefile
--- a/tools/misc/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/misc/Makefile Wed Aug 24 20:38:03 2005
@@ -50,4 +50,4 @@
$(CC) -c $(CFLAGS) -o $@ $<
$(TARGETS): %: %.o Makefile
- $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc
+ $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxenctrl
diff -r b74c15e4dd4f -r 54370eeeb331 tools/misc/cpuperf/Makefile
--- a/tools/misc/cpuperf/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/misc/cpuperf/Makefile Wed Aug 24 20:38:03 2005
@@ -37,7 +37,7 @@
$(CC) $(CFLAGS) -o $@ $<
cpuperf-xen: cpuperf.c $(HDRS) Makefile
- $(CC) $(CFLAGS) -I $(XEN_LIBXC) -L$(XEN_LIBXC) -lxc -DXENO -o $@ $<
+ $(CC) $(CFLAGS) -I $(XEN_LIBXC) -L$(XEN_LIBXC) -lxenctrl -DXENO -o $@ $<
cpuperf-perfcntr: cpuperf.c $(HDRS) Makefile
$(CC) $(CFLAGS) -DPERFCNTR -o $@ $<
diff -r b74c15e4dd4f -r 54370eeeb331 tools/misc/cpuperf/cpuperf_xeno.h
--- a/tools/misc/cpuperf/cpuperf_xeno.h Wed Aug 24 16:15:42 2005
+++ b/tools/misc/cpuperf/cpuperf_xeno.h Wed Aug 24 20:38:03 2005
@@ -9,7 +9,7 @@
*
*/
-#include <xc.h>
+#include <xenctrl.h>
static int xc_handle;
diff -r b74c15e4dd4f -r 54370eeeb331 tools/misc/xc_shadow.c
--- a/tools/misc/xc_shadow.c Wed Aug 24 16:15:42 2005
+++ b/tools/misc/xc_shadow.c Wed Aug 24 20:38:03 2005
@@ -11,7 +11,7 @@
*/
-#include <xc.h>
+#include <xenctrl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/misc/xenperf.c
--- a/tools/misc/xenperf.c Wed Aug 24 16:15:42 2005
+++ b/tools/misc/xenperf.c Wed Aug 24 20:38:03 2005
@@ -11,7 +11,7 @@
*/
-#include <xc.h>
+#include <xenctrl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/python/setup.py
--- a/tools/python/setup.py Wed Aug 24 16:15:42 2005
+++ b/tools/python/setup.py Wed Aug 24 20:38:03 2005
@@ -17,7 +17,7 @@
XEN_ROOT + "/tools/xenstore",
]
-libraries = [ "xc", "xenstore" ]
+libraries = [ "xenctrl", "xenstore" ]
xc = Extension("xc",
extra_compile_args = extra_compile_args,
@@ -41,7 +41,7 @@
sources = [ "xen/lowlevel/xs/xs.c" ])
setup(name = 'xen',
- version = '2.0',
+ version = '3.0',
description = 'Xen',
packages = ['xen',
'xen.lowlevel',
diff -r b74c15e4dd4f -r 54370eeeb331 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Wed Aug 24 16:15:42 2005
+++ b/tools/python/xen/lowlevel/xc/xc.c Wed Aug 24 20:38:03 2005
@@ -5,7 +5,7 @@
*/
#include <Python.h>
-#include <xc.h>
+#include <xenctrl.h>
#include <zlib.h>
#include <fcntl.h>
#include <netinet/in.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/python/xen/lowlevel/xu/xu.c
--- a/tools/python/xen/lowlevel/xu/xu.c Wed Aug 24 16:15:42 2005
+++ b/tools/python/xen/lowlevel/xu/xu.c Wed Aug 24 20:38:03 2005
@@ -21,7 +21,7 @@
#include <unistd.h>
#include <errno.h>
#include <signal.h>
-#include <xc.h>
+#include <xenctrl.h>
#include <xen/xen.h>
#include <xen/io/domain_controller.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xcs/Makefile
--- a/tools/xcs/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/xcs/Makefile Wed Aug 24 20:38:03 2005
@@ -34,10 +34,10 @@
xcsdump: xcsdump.c dump.c
$(CC) $(CFLAGS) -o xcsdump xcsdump.c -L$(XEN_LIBXC) \
- ctrl_interface.c evtchn.c dump.c -lxc
+ ctrl_interface.c evtchn.c dump.c -lxenctrl
$(BIN): $(OBJS)
- $(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -lxc
+ $(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -lxenctrl
$(OBJS): $(HDRS)
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xcs/dump.h
--- a/tools/xcs/dump.h Wed Aug 24 16:15:42 2005
+++ b/tools/xcs/dump.h Wed Aug 24 20:38:03 2005
@@ -20,7 +20,7 @@
#define XENCTLD_ERROR_H
#include <stdint.h>
-#include <xc.h>
+#include <xenctrl.h>
#include <xen/io/domain_controller.h>
void dump_msg(const control_msg_t *msg, uint64_t flags);
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xcs/xcs.h
--- a/tools/xcs/xcs.h Wed Aug 24 16:15:42 2005
+++ b/tools/xcs/xcs.h Wed Aug 24 20:38:03 2005
@@ -11,7 +11,7 @@
#define __XCS_H__
#include <pthread.h>
-#include <xc.h>
+#include <xenctrl.h>
#include <xen/xen.h>
#include <xen/io/domain_controller.h>
#include <xen/linux/privcmd.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xcs/xcsdump.c
--- a/tools/xcs/xcsdump.c Wed Aug 24 16:15:42 2005
+++ b/tools/xcs/xcsdump.c Wed Aug 24 20:38:03 2005
@@ -16,7 +16,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <ctype.h>
-#include <xc.h>
+#include <xenctrl.h>
#include <xen/xen.h>
#include <xen/io/domain_controller.h>
#include <getopt.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xcutils/Makefile
--- a/tools/xcutils/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/xcutils/Makefile Wed Aug 24 20:38:03 2005
@@ -30,7 +30,7 @@
PROGRAMS = xc_restore xc_save
-LDLIBS = -L$(XEN_LIBXC) -lxc
+LDLIBS = -L$(XEN_LIBXC) -lxenctrl
.PHONY: all
all: build
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xcutils/xc_restore.c
--- a/tools/xcutils/xc_restore.c Wed Aug 24 16:15:42 2005
+++ b/tools/xcutils/xc_restore.c Wed Aug 24 20:38:03 2005
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <err.h>
-#include <xc.h>
+#include <xenctrl.h>
int
main(int argc, char **argv)
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xcutils/xc_save.c
--- a/tools/xcutils/xc_save.c Wed Aug 24 16:15:42 2005
+++ b/tools/xcutils/xc_save.c Wed Aug 24 20:38:03 2005
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <err.h>
-#include <xc.h>
+#include <xenctrl.h>
int
main(int argc, char **argv)
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xenstore/Makefile
--- a/tools/xenstore/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/xenstore/Makefile Wed Aug 24 20:38:03 2005
@@ -32,7 +32,7 @@
ln -sf $(XEN_ROOT)/xen/include/public $@
xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o
xenstored_transaction.o xs_lib.o talloc.o utils.o
- $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxc -o $@
+ $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
xenstored_test: xenstored_core_test.o xenstored_watch_test.o
xenstored_domain_test.o xenstored_transaction_test.o xs_lib.o talloc_test.o
fake_libxc.o utils.o
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
@@ -103,7 +103,7 @@
export $(TESTENV); PID=`./xenstored_test --output-pid
--trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
xs_dom0_test: xs_dom0_test.o utils.o
- $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxc -o $@
+ $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
TAGS:
etags `find . -name '*.[ch]'`
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xenstore/xs_dom0_test.c
--- a/tools/xenstore/xs_dom0_test.c Wed Aug 24 16:15:42 2005
+++ b/tools/xenstore/xs_dom0_test.c Wed Aug 24 20:38:03 2005
@@ -3,7 +3,7 @@
#include <sys/ioctl.h>
#include "xs.h"
#include "utils.h"
-#include <xc.h>
+#include <xenctrl.h>
#include <xen/linux/privcmd.h>
#include <stdio.h>
#include <unistd.h>
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xenstore/xs_lib.h
--- a/tools/xenstore/xs_lib.h Wed Aug 24 16:15:42 2005
+++ b/tools/xenstore/xs_lib.h Wed Aug 24 20:38:03 2005
@@ -22,7 +22,7 @@
#include <stdbool.h>
#include <limits.h>
-#include <xc.h>
+#include <xenctrl.h>
/* Bitmask of permissions. */
enum xs_perm_type {
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xentrace/Makefile
--- a/tools/xentrace/Makefile Wed Aug 24 16:15:42 2005
+++ b/tools/xentrace/Makefile Wed Aug 24 20:38:03 2005
@@ -36,4 +36,4 @@
$(RM) *.a *.so *.o *.rpm $(BIN)
%: %.c $(HDRS) Makefile
- $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc
+ $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxenctrl
diff -r b74c15e4dd4f -r 54370eeeb331 tools/xentrace/xenctx.c
--- a/tools/xentrace/xenctx.c Wed Aug 24 16:15:42 2005
+++ b/tools/xentrace/xenctx.c Wed Aug 24 20:38:03 2005
@@ -21,7 +21,7 @@
#include <argp.h>
#include <signal.h>
-#include "xc.h"
+#include "xenctrl.h"
#ifdef __i386__
void print_ctx(vcpu_guest_context_t *ctx1)
diff -r b74c15e4dd4f -r 54370eeeb331 tools/libxc/xenctrl.h
--- /dev/null Wed Aug 24 16:15:42 2005
+++ b/tools/libxc/xenctrl.h Wed Aug 24 20:38:03 2005
@@ -0,0 +1,558 @@
+/******************************************************************************
+ * xenctrl.h
+ *
+ * A library for low-level access to the Xen control interfaces.
+ *
+ * Copyright (c) 2003-2004, K A Fraser.
+ */
+
+#ifndef __XC_H__
+#define __XC_H__
+
+#include <stdint.h>
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+typedef int8_t s8;
+typedef int16_t s16;
+typedef int32_t s32;
+typedef int64_t s64;
+
+#include <sys/ptrace.h>
+#include <xen/xen.h>
+#include <xen/dom0_ops.h>
+#include <xen/event_channel.h>
+#include <xen/sched_ctl.h>
+#include <xen/acm.h>
+
+#ifdef __ia64__
+#define XC_PAGE_SHIFT 14
+#else
+#define XC_PAGE_SHIFT 12
+#endif
+#define XC_PAGE_SIZE (1UL << XC_PAGE_SHIFT)
+#define XC_PAGE_MASK (~(XC_PAGE_SIZE-1))
+
+/*
+ * DEFINITIONS FOR CPU BARRIERS
+ */
+
+#if defined(__i386__)
+#define mb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
+#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
+#define wmb() __asm__ __volatile__ ( "" : : : "memory")
+#elif defined(__x86_64__)
+#define mb() __asm__ __volatile__ ( "mfence" : : : "memory")
+#define rmb() __asm__ __volatile__ ( "lfence" : : : "memory")
+#define wmb() __asm__ __volatile__ ( "" : : : "memory")
+#elif defined(__ia64__)
+/* FIXME */
+#define mb()
+#define rmb()
+#define wmb()
+#else
+#error "Define barriers"
+#endif
+
+/*
+ * INITIALIZATION FUNCTIONS
+ */
+
+/**
+ * This function opens a handle to the hypervisor interface. This function can
+ * be called multiple times within a single process. Multiple processes can
+ * have an open hypervisor interface at the same time.
+ *
+ * Each call to this function should have a corresponding call to
+ * xc_interface_close().
+ *
+ * This function can fail if the caller does not have superuser permission or
+ * if a Xen-enabled kernel is not currently running.
+ *
+ * @return a handle to the hypervisor interface or -1 on failure
+ */
+int xc_interface_open(void);
+
+/**
+ * This function closes an open hypervisor interface.
+ *
+ * This function can fail if the handle does not represent an open interface or
+ * if there were problems closing the interface.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @return 0 on success, -1 otherwise.
+ */
+int xc_interface_close(int xc_handle);
+
+/*
+ * DOMAIN DEBUGGING FUNCTIONS
+ */
+
+typedef struct xc_core_header {
+ unsigned int xch_magic;
+ unsigned int xch_nr_vcpus;
+ unsigned int xch_nr_pages;
+ unsigned int xch_ctxt_offset;
+ unsigned int xch_index_offset;
+ unsigned int xch_pages_offset;
+} xc_core_header_t;
+
+
+long xc_ptrace(enum __ptrace_request request,
+ u32 domid,
+ long addr,
+ long data);
+
+long xc_ptrace_core(enum __ptrace_request request,
+ u32 domid,
+ long addr,
+ long data);
+
+int xc_waitdomain(int domain,
+ int *status,
+ int options);
+
+int xc_waitdomain_core(int domain,
+ int *status,
+ int options);
+
+/*
+ * DOMAIN MANAGEMENT FUNCTIONS
+ */
+
+typedef struct {
+ u32 domid;
+ u32 ssidref;
+ unsigned int dying:1, crashed:1, shutdown:1,
+ paused:1, blocked:1, running:1;
+ unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
+ unsigned long nr_pages;
+ unsigned long shared_info_frame;
+ u64 cpu_time;
+ unsigned long max_memkb;
+ unsigned int vcpus;
+ s32 vcpu_to_cpu[MAX_VIRT_CPUS];
+ cpumap_t cpumap[MAX_VIRT_CPUS];
+} xc_dominfo_t;
+
+typedef dom0_getdomaininfo_t xc_domaininfo_t;
+int xc_domain_create(int xc_handle,
+ u32 ssidref,
+ u32 *pdomid);
+
+
+int xc_domain_dumpcore(int xc_handle,
+ u32 domid,
+ const char *corename);
+
+
+/**
+ * This function pauses a domain. A paused domain still exists in memory
+ * however it does not receive any timeslices from the hypervisor.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm domid the domain id to pause
+ * @return 0 on success, -1 on failure.
+ */
+int xc_domain_pause(int xc_handle,
+ u32 domid);
+/**
+ * This function unpauses a domain. The domain should have been previously
+ * paused.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm domid the domain id to unpause
+ * return 0 on success, -1 on failure
+ */
+int xc_domain_unpause(int xc_handle,
+ u32 domid);
+
+/**
+ * This function will destroy a domain. Destroying a domain removes the domain
+ * completely from memory. This function should be called after sending the
+ * domain a SHUTDOWN control message to free up the domain resources.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm domid the domain id to destroy
+ * @return 0 on success, -1 on failure
+ */
+int xc_domain_destroy(int xc_handle,
+ u32 domid);
+int xc_domain_pincpu(int xc_handle,
+ u32 domid,
+ int vcpu,
+ cpumap_t *cpumap);
+/**
+ * This function will return information about one or more domains. It is
+ * designed to iterate over the list of domains. If a single domain is
+ * requested, this function will return the next domain in the list - if
+ * one exists. It is, therefore, important in this case to make sure the
+ * domain requested was the one returned.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm first_domid the first domain to enumerate information from. Domains
+ * are currently enumerate in order of creation.
+ * @parm max_doms the number of elements in info
+ * @parm info an array of max_doms size that will contain the information for
+ * the enumerated domains.
+ * @return the number of domains enumerated or -1 on error
+ */
+int xc_domain_getinfo(int xc_handle,
+ u32 first_domid,
+ unsigned int max_doms,
+ xc_dominfo_t *info);
+
+/**
+ * This function will return information about one or more domains, using a
+ * single hypercall. The domain information will be stored into the supplied
+ * array of xc_domaininfo_t structures.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm first_domain the first domain to enumerate information from.
+ * Domains are currently enumerate in order of creation.
+ * @parm max_domains the number of elements in info
+ * @parm info an array of max_doms size that will contain the information for
+ * the enumerated domains.
+ * @return the number of domains enumerated or -1 on error
+ */
+int xc_domain_getinfolist(int xc_handle,
+ u32 first_domain,
+ unsigned int max_domains,
+ xc_domaininfo_t *info);
+
+/**
+ * This function returns information about one domain. This information is
+ * more detailed than the information from xc_domain_getinfo().
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm domid the domain to get information from
+ * @parm info a pointer to an xc_domaininfo_t to store the domain information
+ * @parm ctxt a pointer to a structure to store the execution context of the
+ * domain
+ * @return 0 on success, -1 on failure
+ */
+int xc_domain_get_vcpu_context(int xc_handle,
+ u32 domid,
+ u32 vcpu,
+ vcpu_guest_context_t *ctxt);
+
+int xc_domain_setcpuweight(int xc_handle,
+ u32 domid,
+ float weight);
+long long xc_domain_get_cpu_usage(int xc_handle,
+ domid_t domid,
+ int vcpu);
+
+
+typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
+int xc_shadow_control(int xc_handle,
+ u32 domid,
+ unsigned int sop,
+ unsigned long *dirty_bitmap,
+ unsigned long pages,
+ xc_shadow_control_stats_t *stats);
+
+
+#define XCFLAGS_VERBOSE 1
+#define XCFLAGS_LIVE 2
+#define XCFLAGS_DEBUG 4
+#define XCFLAGS_CONFIGURE 8
+
+struct XcIOContext;
+
+/**
+ * This function will save a domain running Linux.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm fd the file descriptor to save a domain to
+ * @parm dom the id of the domain
+ * @return 0 on success, -1 on failure
+ */
+int xc_linux_save(int xc_handle, int fd, u32 dom);
+
+/**
+ * This function will restore a saved domain running Linux.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm fd the file descriptor to restore a domain from
+ * @parm dom the id of the domain
+ * @parm nr_pfns the number of pages
+ * @parm store_evtchn the store event channel for this domain to use
+ * @parm store_mfn returned with the mfn of the store page
+ * @return 0 on success, -1 on failure
+ */
+int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
+ unsigned int store_evtchn, unsigned long *store_mfn);
+
+int xc_linux_build(int xc_handle,
+ u32 domid,
+ const char *image_name,
+ const char *ramdisk_name,
+ const char *cmdline,
+ unsigned int control_evtchn,
+ unsigned long flags,
+ unsigned int vcpus,
+ unsigned int store_evtchn,
+ unsigned long *store_mfn);
+
+struct mem_map;
+int xc_vmx_build(int xc_handle,
+ u32 domid,
+ int memsize,
+ const char *image_name,
+ struct mem_map *memmap,
+ const char *ramdisk_name,
+ const char *cmdline,
+ unsigned int control_evtchn,
+ unsigned long flags,
+ unsigned int vcpus,
+ unsigned int store_evtchn,
+ unsigned long *store_mfn);
+
+int xc_bvtsched_global_set(int xc_handle,
+ unsigned long ctx_allow);
+
+int xc_bvtsched_domain_set(int xc_handle,
+ u32 domid,
+ u32 mcuadv,
+ int warpback,
+ s32 warpvalue,
+ long long warpl,
+ long long warpu);
+
+int xc_bvtsched_global_get(int xc_handle,
+ unsigned long *ctx_allow);
+
+int xc_bvtsched_domain_get(int xc_handle,
+ u32 domid,
+ u32 *mcuadv,
+ int *warpback,
+ s32 *warpvalue,
+ long long *warpl,
+ long long *warpu);
+
+int xc_sedf_domain_set(int xc_handle,
+ u32 domid,
+ u64 period, u64 slice, u64 latency, u16 extratime,
u16 weight);
+
+int xc_sedf_domain_get(int xc_handle,
+ u32 domid,
+ u64* period, u64 *slice, u64 *latency, u16
*extratime, u16* weight);
+
+typedef evtchn_status_t xc_evtchn_status_t;
+
+/*
+ * EVENT CHANNEL FUNCTIONS
+ */
+
+/**
+ * This function allocates an unbound port. Ports are named endpoints used for
+ * interdomain communication. This function is most useful in opening a
+ * well-known port within a domain to receive events on.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm dom the ID of the domain. This maybe DOMID_SELF
+ * @parm port a pointer to a port. This is an in/out parameter. If *port is
+ * 0, then a new port will be assigned, if port is > 0 then that
+ * port is allocated if the port is unallocated.
+ * @return 0 on success, -1 on failure
+ */
+int xc_evtchn_alloc_unbound(int xc_handle,
+ u32 dom,
+ int *port);
+
+/**
+ * This function creates a pair of ports between two domains. A port can only
+ * be bound once within a domain.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm dom1 one of the two domains to connect. Can be DOMID_SELF.
+ * @parm dom2 the other domain to connect. Can be DOMID_SELF.
+ * @parm port1 an in/out parameter. If > 0, then try to connect *port. If
+ * 0, then allocate a new port and store the port in *port.
+ * @parm port2 the port connected on port2. This parameter behaves the same
+ * way as port1.
+ * @return 0 on success, -1 on error.
+ */
+int xc_evtchn_bind_interdomain(int xc_handle,
+ u32 dom1,
+ u32 dom2,
+ int *port1,
+ int *port2);
+int xc_evtchn_bind_virq(int xc_handle,
+ int virq,
+ int *port);
+
+/**
+ * This function will close a single port on an event channel.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm dom the domain that the port exists on. May be DOMID_SELF.
+ * @parm port the port to close
+ * @return 0 on success, -1 on error
+ */
+int xc_evtchn_close(int xc_handle,
+ u32 dom, /* may be DOMID_SELF */
+ int port);
+
+/**
+ * This function generates a notify event on a bound port.
+ *
+ * Notifies can be read within Linux by opening /dev/xen/evtchn and reading
+ * a 16 bit value. The result will be the port the event occurred on. When
+ * events occur, the port is masked until the 16 bit port value is written back
+ * to the file. When /dev/xen/evtchn is opened, it has to be bound via an
+ * ioctl to each port to listen on. The ioctl for binding is _IO('E', 2). The
+ * parameter is the port to listen on.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm local_port the port to generate the notify on
+ * @return 0 on success, -1 on error
+ */
+int xc_evtchn_send(int xc_handle,
+ int local_port);
+int xc_evtchn_status(int xc_handle,
+ u32 dom, /* may be DOMID_SELF */
+ int port,
+ xc_evtchn_status_t *status);
+
+int xc_physdev_pci_access_modify(int xc_handle,
+ u32 domid,
+ int bus,
+ int dev,
+ int func,
+ int enable);
+
+int xc_readconsolering(int xc_handle,
+ char **pbuffer,
+ unsigned int *pnr_chars,
+ int clear);
+
+typedef dom0_physinfo_t xc_physinfo_t;
+int xc_physinfo(int xc_handle,
+ xc_physinfo_t *info);
+
+int xc_sched_id(int xc_handle,
+ int *sched_id);
+
+int xc_domain_setmaxmem(int xc_handle,
+ u32 domid,
+ unsigned int max_memkb);
+
+int xc_domain_memory_increase_reservation(int xc_handle,
+ u32 domid,
+ unsigned int mem_kb);
+
+typedef dom0_perfc_desc_t xc_perfc_desc_t;
+/* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
+int xc_perfc_control(int xc_handle,
+ u32 op,
+ xc_perfc_desc_t *desc);
+
+/* read/write msr */
+long long xc_msr_read(int xc_handle, int cpu_mask, int msr);
+int xc_msr_write(int xc_handle, int cpu_mask, int msr, unsigned int low,
+ unsigned int high);
+
+/**
+ * Memory maps a range within one domain to a local address range. Mappings
+ * should be unmapped with munmap and should follow the same rules as mmap
+ * regarding page alignment. Returns NULL on failure.
+ *
+ * In Linux, the ring queue for the control channel is accessible by mapping
+ * the shared_info_frame (from xc_domain_getinfo()) + 2048. The structure
+ * stored there is of type control_if_t.
+ *
+ * @parm xc_handle a handle on an open hypervisor interface
+ * @parm dom the domain to map memory from
+ * @parm size the amount of memory to map (in multiples of page size)
+ * @parm prot same flag as in mmap().
+ * @parm mfn the frame address to map.
+ */
+void *xc_map_foreign_range(int xc_handle, u32 dom,
+ int size, int prot,
+ unsigned long mfn );
+
+void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
+ unsigned long *arr, int num );
+
+int xc_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf,
+ unsigned long max_pfns);
+
+int xc_ia64_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf,
+ unsigned int start_page, unsigned int nr_pages);
+
+/*\
+ * GRANT TABLE FUNCTIONS
+\*/
+
+/**
+ * This function opens a handle to the more restricted grant table hypervisor
+ * interface. This may be used where the standard interface is not
+ * available because the domain is not privileged.
+ * This function can be called multiple times within a single process.
+ * Multiple processes can have an open hypervisor interface at the same time.
+ *
+ * Each call to this function should have a corresponding call to
+ * xc_grant_interface_close().
+ *
+ * This function can fail if a Xen-enabled kernel is not currently running.
+ *
+ * @return a handle to the hypervisor grant table interface or -1 on failure
+ */
+int xc_grant_interface_open(void);
+
+/**
+ * This function closes an open grant table hypervisor interface.
+ *
+ * This function can fail if the handle does not represent an open interface or
+ * if there were problems closing the interface.
+ *
+ * @parm xc_handle a handle to an open grant table hypervisor interface
+ * @return 0 on success, -1 otherwise.
+ */
+int xc_grant_interface_close(int xc_handle);
+
+int xc_gnttab_map_grant_ref(int xc_handle,
+ u64 host_virt_addr,
+ u32 dom,
+ u16 ref,
+ u16 flags,
+ s16 *handle,
+ u64 *dev_bus_addr);
+
+int xc_gnttab_unmap_grant_ref(int xc_handle,
+ u64 host_virt_addr,
+ u64 dev_bus_addr,
+ u16 handle,
+ s16 *status);
+
+int xc_gnttab_setup_table(int xc_handle,
+ u32 dom,
+ u16 nr_frames,
+ s16 *status,
+ unsigned long **frame_list);
+
+/* Grant debug builds only: */
+int xc_gnttab_dump_table(int xc_handle,
+ u32 dom,
+ s16 *status);
+
+/* Get current total pages allocated to a domain. */
+long xc_get_tot_pages(int xc_handle, u32 domid);
+
+/* Execute a privileged dom0 operation. */
+int xc_dom0_op(int xc_handle, dom0_op_t *op);
+
+/* Initializes the store (for dom0)
+ remote_port should be the remote end of a bound interdomain channel between
+ the store and dom0.
+
+ This function returns a shared frame that should be passed to
+ xs_introduce_domain
+ */
+long xc_init_store(int xc_handle, int remote_port);
+
+#endif /* __XC_H__ */
diff -r b74c15e4dd4f -r 54370eeeb331 tools/libxc/xc.h
--- a/tools/libxc/xc.h Wed Aug 24 16:15:42 2005
+++ /dev/null Wed Aug 24 20:38:03 2005
@@ -1,558 +0,0 @@
-/******************************************************************************
- * xc.h
- *
- * A library for low-level access to the Xen control interfaces.
- *
- * Copyright (c) 2003-2004, K A Fraser.
- */
-
-#ifndef __XC_H__
-#define __XC_H__
-
-#include <stdint.h>
-
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint64_t u64;
-typedef int8_t s8;
-typedef int16_t s16;
-typedef int32_t s32;
-typedef int64_t s64;
-
-#include <sys/ptrace.h>
-#include <xen/xen.h>
-#include <xen/dom0_ops.h>
-#include <xen/event_channel.h>
-#include <xen/sched_ctl.h>
-#include <xen/acm.h>
-
-#ifdef __ia64__
-#define XC_PAGE_SHIFT 14
-#else
-#define XC_PAGE_SHIFT 12
-#endif
-#define XC_PAGE_SIZE (1UL << XC_PAGE_SHIFT)
-#define XC_PAGE_MASK (~(XC_PAGE_SIZE-1))
-
-/*
- * DEFINITIONS FOR CPU BARRIERS
- */
-
-#if defined(__i386__)
-#define mb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define wmb() __asm__ __volatile__ ( "" : : : "memory")
-#elif defined(__x86_64__)
-#define mb() __asm__ __volatile__ ( "mfence" : : : "memory")
-#define rmb() __asm__ __volatile__ ( "lfence" : : : "memory")
-#define wmb() __asm__ __volatile__ ( "" : : : "memory")
-#elif defined(__ia64__)
-/* FIXME */
-#define mb()
-#define rmb()
-#define wmb()
-#else
-#error "Define barriers"
-#endif
-
-/*
- * INITIALIZATION FUNCTIONS
- */
-
-/**
- * This function opens a handle to the hypervisor interface. This function can
- * be called multiple times within a single process. Multiple processes can
- * have an open hypervisor interface at the same time.
- *
- * Each call to this function should have a corresponding call to
- * xc_interface_close().
- *
- * This function can fail if the caller does not have superuser permission or
- * if a Xen-enabled kernel is not currently running.
- *
- * @return a handle to the hypervisor interface or -1 on failure
- */
-int xc_interface_open(void);
-
-/**
- * This function closes an open hypervisor interface.
- *
- * This function can fail if the handle does not represent an open interface or
- * if there were problems closing the interface.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @return 0 on success, -1 otherwise.
- */
-int xc_interface_close(int xc_handle);
-
-/*
- * DOMAIN DEBUGGING FUNCTIONS
- */
-
-typedef struct xc_core_header {
- unsigned int xch_magic;
- unsigned int xch_nr_vcpus;
- unsigned int xch_nr_pages;
- unsigned int xch_ctxt_offset;
- unsigned int xch_index_offset;
- unsigned int xch_pages_offset;
-} xc_core_header_t;
-
-
-long xc_ptrace(enum __ptrace_request request,
- u32 domid,
- long addr,
- long data);
-
-long xc_ptrace_core(enum __ptrace_request request,
- u32 domid,
- long addr,
- long data);
-
-int xc_waitdomain(int domain,
- int *status,
- int options);
-
-int xc_waitdomain_core(int domain,
- int *status,
- int options);
-
-/*
- * DOMAIN MANAGEMENT FUNCTIONS
- */
-
-typedef struct {
- u32 domid;
- u32 ssidref;
- unsigned int dying:1, crashed:1, shutdown:1,
- paused:1, blocked:1, running:1;
- unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
- unsigned long nr_pages;
- unsigned long shared_info_frame;
- u64 cpu_time;
- unsigned long max_memkb;
- unsigned int vcpus;
- s32 vcpu_to_cpu[MAX_VIRT_CPUS];
- cpumap_t cpumap[MAX_VIRT_CPUS];
-} xc_dominfo_t;
-
-typedef dom0_getdomaininfo_t xc_domaininfo_t;
-int xc_domain_create(int xc_handle,
- u32 ssidref,
- u32 *pdomid);
-
-
-int xc_domain_dumpcore(int xc_handle,
- u32 domid,
- const char *corename);
-
-
-/**
- * This function pauses a domain. A paused domain still exists in memory
- * however it does not receive any timeslices from the hypervisor.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm domid the domain id to pause
- * @return 0 on success, -1 on failure.
- */
-int xc_domain_pause(int xc_handle,
- u32 domid);
-/**
- * This function unpauses a domain. The domain should have been previously
- * paused.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm domid the domain id to unpause
- * return 0 on success, -1 on failure
- */
-int xc_domain_unpause(int xc_handle,
- u32 domid);
-
-/**
- * This function will destroy a domain. Destroying a domain removes the domain
- * completely from memory. This function should be called after sending the
- * domain a SHUTDOWN control message to free up the domain resources.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm domid the domain id to destroy
- * @return 0 on success, -1 on failure
- */
-int xc_domain_destroy(int xc_handle,
- u32 domid);
-int xc_domain_pincpu(int xc_handle,
- u32 domid,
- int vcpu,
- cpumap_t *cpumap);
-/**
- * This function will return information about one or more domains. It is
- * designed to iterate over the list of domains. If a single domain is
- * requested, this function will return the next domain in the list - if
- * one exists. It is, therefore, important in this case to make sure the
- * domain requested was the one returned.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm first_domid the first domain to enumerate information from. Domains
- * are currently enumerate in order of creation.
- * @parm max_doms the number of elements in info
- * @parm info an array of max_doms size that will contain the information for
- * the enumerated domains.
- * @return the number of domains enumerated or -1 on error
- */
-int xc_domain_getinfo(int xc_handle,
- u32 first_domid,
- unsigned int max_doms,
- xc_dominfo_t *info);
-
-/**
- * This function will return information about one or more domains, using a
- * single hypercall. The domain information will be stored into the supplied
- * array of xc_domaininfo_t structures.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm first_domain the first domain to enumerate information from.
- * Domains are currently enumerate in order of creation.
- * @parm max_domains the number of elements in info
- * @parm info an array of max_doms size that will contain the information for
- * the enumerated domains.
- * @return the number of domains enumerated or -1 on error
- */
-int xc_domain_getinfolist(int xc_handle,
- u32 first_domain,
- unsigned int max_domains,
- xc_domaininfo_t *info);
-
-/**
- * This function returns information about one domain. This information is
- * more detailed than the information from xc_domain_getinfo().
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm domid the domain to get information from
- * @parm info a pointer to an xc_domaininfo_t to store the domain information
- * @parm ctxt a pointer to a structure to store the execution context of the
- * domain
- * @return 0 on success, -1 on failure
- */
-int xc_domain_get_vcpu_context(int xc_handle,
- u32 domid,
- u32 vcpu,
- vcpu_guest_context_t *ctxt);
-
-int xc_domain_setcpuweight(int xc_handle,
- u32 domid,
- float weight);
-long long xc_domain_get_cpu_usage(int xc_handle,
- domid_t domid,
- int vcpu);
-
-
-typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
-int xc_shadow_control(int xc_handle,
- u32 domid,
- unsigned int sop,
- unsigned long *dirty_bitmap,
- unsigned long pages,
- xc_shadow_control_stats_t *stats);
-
-
-#define XCFLAGS_VERBOSE 1
-#define XCFLAGS_LIVE 2
-#define XCFLAGS_DEBUG 4
-#define XCFLAGS_CONFIGURE 8
-
-struct XcIOContext;
-
-/**
- * This function will save a domain running Linux.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm fd the file descriptor to save a domain to
- * @parm dom the id of the domain
- * @return 0 on success, -1 on failure
- */
-int xc_linux_save(int xc_handle, int fd, u32 dom);
-
-/**
- * This function will restore a saved domain running Linux.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm fd the file descriptor to restore a domain from
- * @parm dom the id of the domain
- * @parm nr_pfns the number of pages
- * @parm store_evtchn the store event channel for this domain to use
- * @parm store_mfn returned with the mfn of the store page
- * @return 0 on success, -1 on failure
- */
-int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
- unsigned int store_evtchn, unsigned long *store_mfn);
-
-int xc_linux_build(int xc_handle,
- u32 domid,
- const char *image_name,
- const char *ramdisk_name,
- const char *cmdline,
- unsigned int control_evtchn,
- unsigned long flags,
- unsigned int vcpus,
- unsigned int store_evtchn,
- unsigned long *store_mfn);
-
-struct mem_map;
-int xc_vmx_build(int xc_handle,
- u32 domid,
- int memsize,
- const char *image_name,
- struct mem_map *memmap,
- const char *ramdisk_name,
- const char *cmdline,
- unsigned int control_evtchn,
- unsigned long flags,
- unsigned int vcpus,
- unsigned int store_evtchn,
- unsigned long *store_mfn);
-
-int xc_bvtsched_global_set(int xc_handle,
- unsigned long ctx_allow);
-
-int xc_bvtsched_domain_set(int xc_handle,
- u32 domid,
- u32 mcuadv,
- int warpback,
- s32 warpvalue,
- long long warpl,
- long long warpu);
-
-int xc_bvtsched_global_get(int xc_handle,
- unsigned long *ctx_allow);
-
-int xc_bvtsched_domain_get(int xc_handle,
- u32 domid,
- u32 *mcuadv,
- int *warpback,
- s32 *warpvalue,
- long long *warpl,
- long long *warpu);
-
-int xc_sedf_domain_set(int xc_handle,
- u32 domid,
- u64 period, u64 slice, u64 latency, u16 extratime,
u16 weight);
-
-int xc_sedf_domain_get(int xc_handle,
- u32 domid,
- u64* period, u64 *slice, u64 *latency, u16
*extratime, u16* weight);
-
-typedef evtchn_status_t xc_evtchn_status_t;
-
-/*
- * EVENT CHANNEL FUNCTIONS
- */
-
-/**
- * This function allocates an unbound port. Ports are named endpoints used for
- * interdomain communication. This function is most useful in opening a
- * well-known port within a domain to receive events on.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm dom the ID of the domain. This maybe DOMID_SELF
- * @parm port a pointer to a port. This is an in/out parameter. If *port is
- * 0, then a new port will be assigned, if port is > 0 then that
- * port is allocated if the port is unallocated.
- * @return 0 on success, -1 on failure
- */
-int xc_evtchn_alloc_unbound(int xc_handle,
- u32 dom,
- int *port);
-
-/**
- * This function creates a pair of ports between two domains. A port can only
- * be bound once within a domain.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm dom1 one of the two domains to connect. Can be DOMID_SELF.
- * @parm dom2 the other domain to connect. Can be DOMID_SELF.
- * @parm port1 an in/out parameter. If > 0, then try to connect *port. If
- * 0, then allocate a new port and store the port in *port.
- * @parm port2 the port connected on port2. This parameter behaves the same
- * way as port1.
- * @return 0 on success, -1 on error.
- */
-int xc_evtchn_bind_interdomain(int xc_handle,
- u32 dom1,
- u32 dom2,
- int *port1,
- int *port2);
-int xc_evtchn_bind_virq(int xc_handle,
- int virq,
- int *port);
-
-/**
- * This function will close a single port on an event channel.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm dom the domain that the port exists on. May be DOMID_SELF.
- * @parm port the port to close
- * @return 0 on success, -1 on error
- */
-int xc_evtchn_close(int xc_handle,
- u32 dom, /* may be DOMID_SELF */
- int port);
-
-/**
- * This function generates a notify event on a bound port.
- *
- * Notifies can be read within Linux by opening /dev/xen/evtchn and reading
- * a 16 bit value. The result will be the port the event occurred on. When
- * events occur, the port is masked until the 16 bit port value is written back
- * to the file. When /dev/xen/evtchn is opened, it has to be bound via an
- * ioctl to each port to listen on. The ioctl for binding is _IO('E', 2). The
- * parameter is the port to listen on.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm local_port the port to generate the notify on
- * @return 0 on success, -1 on error
- */
-int xc_evtchn_send(int xc_handle,
- int local_port);
-int xc_evtchn_status(int xc_handle,
- u32 dom, /* may be DOMID_SELF */
- int port,
- xc_evtchn_status_t *status);
-
-int xc_physdev_pci_access_modify(int xc_handle,
- u32 domid,
- int bus,
- int dev,
- int func,
- int enable);
-
-int xc_readconsolering(int xc_handle,
- char **pbuffer,
- unsigned int *pnr_chars,
- int clear);
-
-typedef dom0_physinfo_t xc_physinfo_t;
-int xc_physinfo(int xc_handle,
- xc_physinfo_t *info);
-
-int xc_sched_id(int xc_handle,
- int *sched_id);
-
-int xc_domain_setmaxmem(int xc_handle,
- u32 domid,
- unsigned int max_memkb);
-
-int xc_domain_memory_increase_reservation(int xc_handle,
- u32 domid,
- unsigned int mem_kb);
-
-typedef dom0_perfc_desc_t xc_perfc_desc_t;
-/* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
-int xc_perfc_control(int xc_handle,
- u32 op,
- xc_perfc_desc_t *desc);
-
-/* read/write msr */
-long long xc_msr_read(int xc_handle, int cpu_mask, int msr);
-int xc_msr_write(int xc_handle, int cpu_mask, int msr, unsigned int low,
- unsigned int high);
-
-/**
- * Memory maps a range within one domain to a local address range. Mappings
- * should be unmapped with munmap and should follow the same rules as mmap
- * regarding page alignment. Returns NULL on failure.
- *
- * In Linux, the ring queue for the control channel is accessible by mapping
- * the shared_info_frame (from xc_domain_getinfo()) + 2048. The structure
- * stored there is of type control_if_t.
- *
- * @parm xc_handle a handle on an open hypervisor interface
- * @parm dom the domain to map memory from
- * @parm size the amount of memory to map (in multiples of page size)
- * @parm prot same flag as in mmap().
- * @parm mfn the frame address to map.
- */
-void *xc_map_foreign_range(int xc_handle, u32 dom,
- int size, int prot,
- unsigned long mfn );
-
-void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
- unsigned long *arr, int num );
-
-int xc_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf,
- unsigned long max_pfns);
-
-int xc_ia64_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf,
- unsigned int start_page, unsigned int nr_pages);
-
-/*\
- * GRANT TABLE FUNCTIONS
-\*/
-
-/**
- * This function opens a handle to the more restricted grant table hypervisor
- * interface. This may be used where the standard interface is not
- * available because the domain is not privileged.
- * This function can be called multiple times within a single process.
- * Multiple processes can have an open hypervisor interface at the same time.
- *
- * Each call to this function should have a corresponding call to
- * xc_grant_interface_close().
- *
- * This function can fail if a Xen-enabled kernel is not currently running.
- *
- * @return a handle to the hypervisor grant table interface or -1 on failure
- */
-int xc_grant_interface_open(void);
-
-/**
- * This function closes an open grant table hypervisor interface.
- *
- * This function can fail if the handle does not represent an open interface or
- * if there were problems closing the interface.
- *
- * @parm xc_handle a handle to an open grant table hypervisor interface
- * @return 0 on success, -1 otherwise.
- */
-int xc_grant_interface_close(int xc_handle);
-
-int xc_gnttab_map_grant_ref(int xc_handle,
- u64 host_virt_addr,
- u32 dom,
- u16 ref,
- u16 flags,
- s16 *handle,
- u64 *dev_bus_addr);
-
-int xc_gnttab_unmap_grant_ref(int xc_handle,
- u64 host_virt_addr,
- u64 dev_bus_addr,
- u16 handle,
- s16 *status);
-
-int xc_gnttab_setup_table(int xc_handle,
- u32 dom,
- u16 nr_frames,
- s16 *status,
- unsigned long **frame_list);
-
-/* Grant debug builds only: */
-int xc_gnttab_dump_table(int xc_handle,
- u32 dom,
- s16 *status);
-
-/* Get current total pages allocated to a domain. */
-long xc_get_tot_pages(int xc_handle, u32 domid);
-
-/* Execute a privileged dom0 operation. */
-int xc_dom0_op(int xc_handle, dom0_op_t *op);
-
-/* Initializes the store (for dom0)
- remote_port should be the remote end of a bound interdomain channel between
- the store and dom0.
-
- This function returns a shared frame that should be passed to
- xs_introduce_domain
- */
-long xc_init_store(int xc_handle, int remote_port);
-
-#endif /* __XC_H__ */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|