mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
bitkeeper revision 1.1010.1.9 (40dc4078vvvprFxMFMTOULzuaeEQoQ)
Renaming 'xenmgr' to 'xen.xend'.
This commit is contained in:
1 parent
4bdb243a88
commit
9bdbe09f07
78 files changed
+2217
-294
No files matched your search
@@ -198,6 +198,58 @@
|
||||
3fbd0a3dTwnDcfdw0-v46dPbX98zDw tools/xc/py/Makefile
|
||||
3fbd0a42l40lM0IICw2jXbQBVZSdZg tools/xc/py/Xc.c
|
||||
3fbd0a40yT6G3M9hMpaz5xTUdl0E4g tools/xc/py/setup.py
|
||||
40c9c468icGyC5RAF1bRKsCXPDCvsA tools/xen/Makefile
|
||||
40dc4076hGpwa8-sWRN0jtXZeQJuKg tools/xen/lib/__init__.py
|
||||
40c9c468SNuObE_YWARyS0hzTPSzKg tools/xen/lib/xend/Args.py
|
||||
40c9c468Um_qc66OQeLEceIz1pgD5g tools/xen/lib/xend/EventServer.py
|
||||
40c9c468U8EVl0d3G--8YXVg6VJD3g tools/xen/lib/xend/EventTypes.py
|
||||
40c9c468QJTEuk9g4qHxGpmIi70PEQ tools/xen/lib/xend/PrettyPrint.py
|
||||
40d8915cyoVA0hJxiBFNymL7YvDaRg tools/xen/lib/xend/XendBridge.py
|
||||
40c9c4688m3eqnC8fhLu1APm36VOVA tools/xen/lib/xend/XendClient.py
|
||||
40c9c468t6iIKTjwuYoe-UMCikDcOQ tools/xen/lib/xend/XendConsole.py
|
||||
40c9c468WnXs6eOUSff23IIGI4kMfQ tools/xen/lib/xend/XendDB.py
|
||||
40c9c468fSl3H3IypyT0ppkbb0ZT9A tools/xen/lib/xend/XendDomain.py
|
||||
40c9c468bbKq3uC7_fuNUkiMMjArdw tools/xen/lib/xend/XendDomainConfig.py
|
||||
40c9c4685ykq87_n1kVUbMr9flx9fg tools/xen/lib/xend/XendDomainInfo.py
|
||||
40c9c46854nsHmuxHQHncKk5rAs5NA tools/xen/lib/xend/XendMigrate.py
|
||||
40c9c468M96gA1EYDvNa5w5kQNYLFA tools/xen/lib/xend/XendNode.py
|
||||
40c9c4686jruMyZIqiaZRMiMoqMJtg tools/xen/lib/xend/XendRoot.py
|
||||
40c9c468xzANp6o2D_MeCYwNmOIUsQ tools/xen/lib/xend/XendVnet.py
|
||||
40c9c468x191zetrVlMnExfsQWHxIQ tools/xen/lib/xend/__init__.py
|
||||
40c9c468S2YnCEKmk4ey8XQIST7INg tools/xen/lib/xend/encode.py
|
||||
40c9c468DCpMe542varOolW1Xc68ew tools/xen/lib/xend/server/SrvBase.py
|
||||
40c9c468IxQabrKJSWs0aEjl-27mRQ tools/xen/lib/xend/server/SrvConsole.py
|
||||
40c9c4689Io5bxfbYIfRiUvsiLX0EQ tools/xen/lib/xend/server/SrvConsoleDir.py
|
||||
40c9c468woSmBByfeXA4o_jGf2gCgA tools/xen/lib/xend/server/SrvDaemon.py
|
||||
40c9c468kACsmkqjxBWKHRo071L26w tools/xen/lib/xend/server/SrvDeviceDir.py
|
||||
40c9c468EQZJVkCLds-OhesJVVyZbQ tools/xen/lib/xend/server/SrvDir.py
|
||||
40c9c468TyHZUq8sk0FF_vxM6Sozrg tools/xen/lib/xend/server/SrvDomain.py
|
||||
40c9c469WzajDjutou3X7FmL9hMf3g tools/xen/lib/xend/server/SrvDomainDir.py
|
||||
40c9c469-8mYEJJTAR6w_ClrJRAfwQ tools/xen/lib/xend/server/SrvEventDir.py
|
||||
40c9c4694eu5759Dehr4Uhakei0EMg tools/xen/lib/xend/server/SrvNode.py
|
||||
40c9c469TaZ83ypsrktmPSHLEZiP5w tools/xen/lib/xend/server/SrvRoot.py
|
||||
40c9c469W3sgDMbBJYQdz5wbQweL0Q tools/xen/lib/xend/server/SrvServer.py
|
||||
40c9c469aq7oXrE1Ngqf3_lBqL0RoQ tools/xen/lib/xend/server/SrvVnetDir.py
|
||||
40c9c469Y_aimoOFfUZoS-4eV8gEKg tools/xen/lib/xend/server/__init__.py
|
||||
40c9c4692hckPol_EK0EGB16ZyDsyQ tools/xen/lib/xend/server/blkif.py
|
||||
40c9c469N2-b3GqpLHHHPZykJPLVvA tools/xen/lib/xend/server/channel.py
|
||||
40c9c469hJ_IlatRne-9QEa0-wlquw tools/xen/lib/xend/server/console.py
|
||||
40c9c469UcNJh_NuLU0ytorM0Lk5Ow tools/xen/lib/xend/server/controller.py
|
||||
40c9c469vHh-qLiiubdbKEQbJf18Zw tools/xen/lib/xend/server/cstruct.py
|
||||
40d83983OXjt-y3HjSCcuoPp9rzvmw tools/xen/lib/xend/server/domain.py
|
||||
40c9c469yrm31i60pGKslTi2Zgpotg tools/xen/lib/xend/server/messages.py
|
||||
40c9c46925x-Rjb0Cv2f1-l2jZrPYg tools/xen/lib/xend/server/netif.py
|
||||
40c9c469ZqILEQ8x6yWy0_51jopiCg tools/xen/lib/xend/server/params.py
|
||||
40c9c469LNxLVizOUpOjEaTKKCm8Aw tools/xen/lib/xend/sxp.py
|
||||
40d05079aFRp6NQdo5wIh5Ly31c0cg tools/xen/lib/xm/__init__.py
|
||||
40cf2937gKQcATgXKGtNeWb1PDH5nA tools/xen/lib/xm/create.py
|
||||
40cf2937isyS250zyd0Q2GuEDoNXfQ tools/xen/lib/xm/main.py
|
||||
40cf2937PSslwBliN1g7ofDy2H_RhA tools/xen/lib/xm/opts.py
|
||||
40cf2937Z8WCNOnO2FcWdubvEAF9QQ tools/xen/lib/xm/shutdown.py
|
||||
40c9c469kT0H9COWzA4XzPBjWK0WsA tools/xen/netfix
|
||||
40c9c469n2RRwCmjWdjdyyVRWKmgWg tools/xen/setup.py
|
||||
40c9c4697z76HDfkCLdMhmaEwzFoNQ tools/xen/xend
|
||||
40cf2937dqM1jWW87O5OoOYND8leuA tools/xen/xm
|
||||
4055ee41IfFazrwadCH2J72nz-A9YA tools/xenctl/Makefile
|
||||
4055ee4b_4Rvns_KzE12csI14EKK6Q tools/xenctl/lib/__init__.py
|
||||
4055ee4dwy4l0MghZosxoiu6zmhc9Q tools/xenctl/lib/console_client.py
|
||||
@@ -205,75 +257,27 @@
|
||||
4059c6a0pnxhG8hwSOivXybbGOwuXw tools/xenctl/lib/tempfile.py
|
||||
3fbd4bd6GtGwZGxYUJPOheYIR7bPaA tools/xenctl/lib/utils.py
|
||||
4055ee44Bu6oP7U0WxxXypbUt4dNPQ tools/xenctl/setup.py
|
||||
40431ac64Hj4ixUnKmlugZKhXPFE_Q tools/xend/Makefile
|
||||
4055ad95Se-FqttgxollqOAAHB94zA tools/xend/lib/__init__.py
|
||||
4092738fMRGC9fFBcPRCWaJaj9U3ag tools/xend/lib/blkif.py
|
||||
4055ad97wMLUj0BZT0e_T0EwQN0Bvw tools/xend/lib/console.py
|
||||
4048c0ddsF0WrU7HUzTvg1MJoCIfWg tools/xend/lib/domain_controller.h
|
||||
4054a301VEag2GwrBrFBna5U1BGlLA tools/xend/lib/main.py
|
||||
4055ad9ah9IuC3sJT2c_gYIFY5Tw_g tools/xend/lib/manager.py
|
||||
409ba2e729HhE7fEra4B5EqX-F8Xzw tools/xend/lib/netif.py
|
||||
40431ac8wrUEj-XM7B8smFtx_HA7lQ tools/xend/lib/utils.c
|
||||
4054a2fdkdATEnRw-U7AUlgu-6JiUA tools/xend/setup.py
|
||||
4056cd26Qyp09iNoOjrvzg8KYzSqOw tools/xend/xend
|
||||
40c9c468icGyC5RAF1bRKsCXPDCvsA tools/xenmgr/Makefile
|
||||
40c9c468SNuObE_YWARyS0hzTPSzKg tools/xenmgr/lib/Args.py
|
||||
40c9c468Um_qc66OQeLEceIz1pgD5g tools/xenmgr/lib/EventServer.py
|
||||
40c9c468U8EVl0d3G--8YXVg6VJD3g tools/xenmgr/lib/EventTypes.py
|
||||
40c9c468QJTEuk9g4qHxGpmIi70PEQ tools/xenmgr/lib/PrettyPrint.py
|
||||
40d8915cyoVA0hJxiBFNymL7YvDaRg tools/xenmgr/lib/XendBridge.py
|
||||
40c9c4688m3eqnC8fhLu1APm36VOVA tools/xenmgr/lib/XendClient.py
|
||||
40c9c468t6iIKTjwuYoe-UMCikDcOQ tools/xenmgr/lib/XendConsole.py
|
||||
40c9c468WnXs6eOUSff23IIGI4kMfQ tools/xenmgr/lib/XendDB.py
|
||||
40c9c468fSl3H3IypyT0ppkbb0ZT9A tools/xenmgr/lib/XendDomain.py
|
||||
40c9c468bbKq3uC7_fuNUkiMMjArdw tools/xenmgr/lib/XendDomainConfig.py
|
||||
40c9c4685ykq87_n1kVUbMr9flx9fg tools/xenmgr/lib/XendDomainInfo.py
|
||||
40c9c46854nsHmuxHQHncKk5rAs5NA tools/xenmgr/lib/XendMigrate.py
|
||||
40c9c468M96gA1EYDvNa5w5kQNYLFA tools/xenmgr/lib/XendNode.py
|
||||
40c9c4686jruMyZIqiaZRMiMoqMJtg tools/xenmgr/lib/XendRoot.py
|
||||
40c9c468xzANp6o2D_MeCYwNmOIUsQ tools/xenmgr/lib/XendVnet.py
|
||||
40c9c468x191zetrVlMnExfsQWHxIQ tools/xenmgr/lib/__init__.py
|
||||
40c9c468S2YnCEKmk4ey8XQIST7INg tools/xenmgr/lib/encode.py
|
||||
40c9c468DCpMe542varOolW1Xc68ew tools/xenmgr/lib/server/SrvBase.py
|
||||
40c9c468IxQabrKJSWs0aEjl-27mRQ tools/xenmgr/lib/server/SrvConsole.py
|
||||
40c9c4689Io5bxfbYIfRiUvsiLX0EQ tools/xenmgr/lib/server/SrvConsoleDir.py
|
||||
40c9c468woSmBByfeXA4o_jGf2gCgA tools/xenmgr/lib/server/SrvConsoleServer.py
|
||||
40c9c468kACsmkqjxBWKHRo071L26w tools/xenmgr/lib/server/SrvDeviceDir.py
|
||||
40c9c468EQZJVkCLds-OhesJVVyZbQ tools/xenmgr/lib/server/SrvDir.py
|
||||
40c9c468TyHZUq8sk0FF_vxM6Sozrg tools/xenmgr/lib/server/SrvDomain.py
|
||||
40c9c469WzajDjutou3X7FmL9hMf3g tools/xenmgr/lib/server/SrvDomainDir.py
|
||||
40c9c469-8mYEJJTAR6w_ClrJRAfwQ tools/xenmgr/lib/server/SrvEventDir.py
|
||||
40c9c4694eu5759Dehr4Uhakei0EMg tools/xenmgr/lib/server/SrvNode.py
|
||||
40c9c469TaZ83ypsrktmPSHLEZiP5w tools/xenmgr/lib/server/SrvRoot.py
|
||||
40c9c469W3sgDMbBJYQdz5wbQweL0Q tools/xenmgr/lib/server/SrvServer.py
|
||||
40c9c469aq7oXrE1Ngqf3_lBqL0RoQ tools/xenmgr/lib/server/SrvVnetDir.py
|
||||
40c9c469Y_aimoOFfUZoS-4eV8gEKg tools/xenmgr/lib/server/__init__.py
|
||||
40c9c4692hckPol_EK0EGB16ZyDsyQ tools/xenmgr/lib/server/blkif.py
|
||||
40c9c469N2-b3GqpLHHHPZykJPLVvA tools/xenmgr/lib/server/channel.py
|
||||
40c9c469hJ_IlatRne-9QEa0-wlquw tools/xenmgr/lib/server/console.py
|
||||
40c9c469UcNJh_NuLU0ytorM0Lk5Ow tools/xenmgr/lib/server/controller.py
|
||||
40c9c469vHh-qLiiubdbKEQbJf18Zw tools/xenmgr/lib/server/cstruct.py
|
||||
40d83983OXjt-y3HjSCcuoPp9rzvmw tools/xenmgr/lib/server/domain.py
|
||||
40c9c469yrm31i60pGKslTi2Zgpotg tools/xenmgr/lib/server/messages.py
|
||||
40c9c46925x-Rjb0Cv2f1-l2jZrPYg tools/xenmgr/lib/server/netif.py
|
||||
40c9c469ZqILEQ8x6yWy0_51jopiCg tools/xenmgr/lib/server/params.py
|
||||
40c9c469LNxLVizOUpOjEaTKKCm8Aw tools/xenmgr/lib/sxp.py
|
||||
40d05079aFRp6NQdo5wIh5Ly31c0cg tools/xenmgr/lib/xm/__init__.py
|
||||
40cf2937gKQcATgXKGtNeWb1PDH5nA tools/xenmgr/lib/xm/create.py
|
||||
40cf2937isyS250zyd0Q2GuEDoNXfQ tools/xenmgr/lib/xm/main.py
|
||||
40cf2937PSslwBliN1g7ofDy2H_RhA tools/xenmgr/lib/xm/opts.py
|
||||
40cf2937Z8WCNOnO2FcWdubvEAF9QQ tools/xenmgr/lib/xm/shutdown.py
|
||||
40c9c469kT0H9COWzA4XzPBjWK0WsA tools/xenmgr/netfix
|
||||
40c9c469n2RRwCmjWdjdyyVRWKmgWg tools/xenmgr/setup.py
|
||||
40c9c4697z76HDfkCLdMhmaEwzFoNQ tools/xenmgr/xend
|
||||
40c9c469JkN47d1oXi-e0RjAP-C6uQ tools/xenmgr/xenmgrd
|
||||
40cf2937dqM1jWW87O5OoOYND8leuA tools/xenmgr/xm
|
||||
40431ac64Hj4ixUnKmlugZKhXPFE_Q tools/xend-old/Makefile
|
||||
4055ad95Se-FqttgxollqOAAHB94zA tools/xend-old/lib/__init__.py
|
||||
4092738fMRGC9fFBcPRCWaJaj9U3ag tools/xend-old/lib/blkif.py
|
||||
4055ad97wMLUj0BZT0e_T0EwQN0Bvw tools/xend-old/lib/console.py
|
||||
4048c0ddsF0WrU7HUzTvg1MJoCIfWg tools/xend-old/lib/domain_controller.h
|
||||
4054a301VEag2GwrBrFBna5U1BGlLA tools/xend-old/lib/main.py
|
||||
4055ad9ah9IuC3sJT2c_gYIFY5Tw_g tools/xend-old/lib/manager.py
|
||||
409ba2e729HhE7fEra4B5EqX-F8Xzw tools/xend-old/lib/netif.py
|
||||
40431ac8wrUEj-XM7B8smFtx_HA7lQ tools/xend-old/lib/utils.c
|
||||
4054a2fdkdATEnRw-U7AUlgu-6JiUA tools/xend-old/setup.py
|
||||
4056cd26Qyp09iNoOjrvzg8KYzSqOw tools/xend-old/xend
|
||||
403a3edbrr8RE34gkbR40zep98SXbg tools/xentrace/Makefile
|
||||
40a107afN60pFdURgBv9KwEzgRl5mQ tools/xentrace/formats
|
||||
4050c413PhhLNAYk3TEwP37i_iLw9Q tools/xentrace/xentrace.8
|
||||
403a3edbVpV2E_wq1zeEkJ_n4Uu2eg tools/xentrace/xentrace.c
|
||||
403a3edblCUrzSj0mmKhO5HOPrOrSQ tools/xentrace/xentrace_format
|
||||
4050c413NtuyIq5lsYJV4P7KIjujXw tools/xentrace/xentrace_format.1
|
||||
40dc4076St6AmPTmQPrtQ6LGHPxGmw tools/xu/lib/__init__.py
|
||||
40dc4076pVeE1kEEWzcUaNZin65kCA tools/xu/lib/domain_controller.h
|
||||
40dc4076CwBYRTUQDdbdU1L6KcLgSw tools/xu/lib/xu.c
|
||||
40dc4076FyWUYS2nX9YufgglUzKX2A tools/xu/setup.py
|
||||
3f72f1bdJPsV3JCnBqs9ddL9tr6D2g xen/COPYING
|
||||
3ddb79bcbOVHh38VJzc97-JEGD4dJQ xen/Makefile
|
||||
3ddb79bcWnTwYsQRWl_PaneJfa6p0w xen/Rules.mk
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
/* include the hypervisor interface */
|
||||
#include <hypervisor-ifs/hypervisor-if.h>
|
||||
#include "../../../tools/xend/lib/domain_controller.h"
|
||||
#include "../../../tools/xu/lib/domain_controller.h"
|
||||
|
||||
/*
|
||||
* a placeholder for the start of day information passed up from the hypervisor
|
||||
|
||||
@@ -114,7 +114,7 @@ relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
|
||||
|
||||
# Another special symlink: to the shared definitions for the control interface
|
||||
cd ..
|
||||
ln -sf ../../${RS}/../tools/xend/lib/domain_controller.h
|
||||
ln -sf ../../${RS}/../tools/xu/lib/domain_controller.h
|
||||
|
||||
# The remainder are the i386 -> xen-i386 links
|
||||
ln -sf ../asm-i386/a.out.h
|
||||
|
||||
+7
-6
@@ -1,21 +1,22 @@
|
||||
|
||||
all:
|
||||
$(MAKE) -C xc
|
||||
$(MAKE) -C xu
|
||||
$(MAKE) -C misc
|
||||
$(MAKE) -C examples
|
||||
$(MAKE) -C xentrace
|
||||
$(MAKE) -C xenctl
|
||||
$(MAKE) -C xend
|
||||
$(MAKE) -C xenmgr
|
||||
$(MAKE) -C xen
|
||||
|
||||
install: all
|
||||
$(MAKE) -C xc install
|
||||
$(MAKE) -C xu install
|
||||
$(MAKE) -C misc install
|
||||
$(MAKE) -C xenctl install
|
||||
$(MAKE) -C examples install
|
||||
$(MAKE) -C xentrace install
|
||||
$(MAKE) -C xenctl install
|
||||
$(MAKE) -C xend install
|
||||
$(MAKE) -C xenmgr install
|
||||
$(MAKE) -C xen install
|
||||
|
||||
dist: $(TARGET)
|
||||
$(MAKE) prefix=`pwd`/../../install dist=yes install
|
||||
@@ -23,10 +24,10 @@ dist: $(TARGET)
|
||||
|
||||
clean:
|
||||
$(MAKE) -C xc clean
|
||||
$(MAKE) -C xu clean
|
||||
$(MAKE) -C misc clean
|
||||
$(MAKE) -C examples clean
|
||||
$(MAKE) -C xentrace clean
|
||||
$(MAKE) -C xenctl clean
|
||||
$(MAKE) -C xend clean
|
||||
$(MAKE) -C xenmgr clean
|
||||
$(MAKE) -C xen clean
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ CC = gcc
|
||||
CFLAGS = -Wall -O3
|
||||
EXTRA_INC = -I../../xen/include/hypervisor-ifs
|
||||
EXTRA_INC += -I../../linux-xen-sparse/include -I../xc/lib
|
||||
EXTRA_INC += -I../xend/lib
|
||||
EXTRA_INC += -I../xu/lib
|
||||
|
||||
HDRS = $(wildcard *.h)
|
||||
SRCS = $(wildcard *.c)
|
||||
|
||||
@@ -6,7 +6,7 @@ SONAME = libxc.so.$(MAJOR)
|
||||
CC = gcc
|
||||
CFLAGS = -c -Werror -O3 -fno-strict-aliasing
|
||||
CFLAGS += -I../../../xen/include/hypervisor-ifs
|
||||
CFLAGS += -I../../xend/lib
|
||||
CFLAGS += -I../../xu/lib
|
||||
CFLAGS += -I../../../linux-xen-sparse/include
|
||||
|
||||
HDRS = $(wildcard *.h)
|
||||
|
||||
+100
-112
@@ -20,6 +20,8 @@
|
||||
#define PyMODINIT_FUNC DL_EXPORT(void)
|
||||
#endif
|
||||
|
||||
#define XENPKG "xen.ext.xc"
|
||||
|
||||
static PyObject *xc_error, *zero;
|
||||
|
||||
typedef struct {
|
||||
@@ -187,112 +189,73 @@ static PyObject *pyxc_domain_getinfo(PyObject *self,
|
||||
return list;
|
||||
}
|
||||
|
||||
static PyObject *pyxc_linux_save(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
XcObject *xc = (XcObject *)self;
|
||||
|
||||
u32 dom;
|
||||
char *state_file;
|
||||
int progress = 1, live = -1, debug = 0;
|
||||
unsigned int flags = 0;
|
||||
|
||||
static char *kwd_list[] = { "dom", "state_file", "progress",
|
||||
"live", "debug", NULL };
|
||||
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is|iii", kwd_list,
|
||||
&dom, &state_file, &progress,
|
||||
&live, &debug) )
|
||||
return NULL;
|
||||
|
||||
if (progress) flags |= XCFLAGS_VERBOSE;
|
||||
if (live == 1) flags |= XCFLAGS_LIVE;
|
||||
if (debug) flags |= XCFLAGS_DEBUG;
|
||||
|
||||
if ( strncmp(state_file,"tcp:", strlen("tcp:")) == 0 )
|
||||
{
|
||||
static PyObject *tcp_save(XcObject *xc, u32 dom, char *url, unsigned flags){
|
||||
#define max_namelen 64
|
||||
char server[max_namelen];
|
||||
char *port_s;
|
||||
int port=777;
|
||||
int sd = -1;
|
||||
struct hostent *h;
|
||||
struct sockaddr_in s;
|
||||
int sockbufsize;
|
||||
int rc = -1;
|
||||
|
||||
int writerfn(void *fd, const void *buf, size_t count)
|
||||
{
|
||||
int tot = 0, rc;
|
||||
do {
|
||||
rc = write( (int) fd, ((char*)buf)+tot, count-tot );
|
||||
if ( rc < 0 ) { perror("WRITE"); return rc; };
|
||||
tot += rc;
|
||||
}
|
||||
while ( tot < count );
|
||||
return 0;
|
||||
char server[max_namelen];
|
||||
char *port_s;
|
||||
int port=777;
|
||||
int sd = -1;
|
||||
struct hostent *h;
|
||||
struct sockaddr_in s;
|
||||
int sockbufsize;
|
||||
int rc = -1;
|
||||
|
||||
int writerfn(void *fd, const void *buf, size_t count) {
|
||||
int tot = 0, rc;
|
||||
do {
|
||||
rc = write( (int) fd, ((char*)buf)+tot, count-tot );
|
||||
if ( rc < 0 ) { perror("WRITE"); return rc; };
|
||||
tot += rc;
|
||||
}
|
||||
while ( tot < count );
|
||||
return 0;
|
||||
}
|
||||
|
||||
strncpy( server, url+strlen("tcp://"), max_namelen);
|
||||
server[max_namelen-1]='\0';
|
||||
if ( (port_s = strchr(server,':')) != NULL ) {
|
||||
*port_s = '\0';
|
||||
port = atoi(port_s+1);
|
||||
}
|
||||
printf("X server=%s port=%d\n",server,port);
|
||||
h = gethostbyname(server);
|
||||
sd = socket(AF_INET, SOCK_STREAM,0);
|
||||
if (sd < 0) goto serr;
|
||||
s.sin_family = AF_INET;
|
||||
bcopy ( h->h_addr, &(s.sin_addr.s_addr), h->h_length);
|
||||
s.sin_port = htons(port);
|
||||
if ( connect(sd, (struct sockaddr *) &s, sizeof(s)) ) goto serr;
|
||||
sockbufsize=128*1024;
|
||||
if ( setsockopt(sd, SOL_SOCKET, SO_SNDBUF, &sockbufsize, sizeof sockbufsize) < 0 ) goto serr;
|
||||
|
||||
if (live == -1) flags |= XCFLAGS_LIVE; /* default to live for tcp */
|
||||
|
||||
strncpy( server, state_file+strlen("tcp://"), max_namelen);
|
||||
server[max_namelen-1]='\0';
|
||||
if ( (port_s = strchr(server,':')) != NULL )
|
||||
{
|
||||
*port_s = '\0';
|
||||
port = atoi(port_s+1);
|
||||
}
|
||||
|
||||
printf("X server=%s port=%d\n",server,port);
|
||||
|
||||
h = gethostbyname(server);
|
||||
sd = socket (AF_INET,SOCK_STREAM,0);
|
||||
if ( sd < 0 )
|
||||
goto serr;
|
||||
s.sin_family = AF_INET;
|
||||
bcopy ( h->h_addr, &(s.sin_addr.s_addr), h->h_length);
|
||||
s.sin_port = htons(port);
|
||||
if ( connect(sd, (struct sockaddr *) &s, sizeof(s)) )
|
||||
goto serr;
|
||||
|
||||
sockbufsize=128*1024;
|
||||
if ( setsockopt(sd, SOL_SOCKET, SO_SNDBUF,
|
||||
&sockbufsize, sizeof sockbufsize) < 0 )
|
||||
goto serr;
|
||||
|
||||
if ( xc_linux_save(xc->xc_handle, dom, flags,
|
||||
writerfn, (void*)sd) == 0 )
|
||||
{
|
||||
if ( read( sd, &rc, sizeof(int) ) != sizeof(int) )
|
||||
goto serr;
|
||||
if ( xc_linux_save(xc->xc_handle, dom, flags, writerfn, (void*)sd) == 0 ) {
|
||||
if ( read( sd, &rc, sizeof(int) ) != sizeof(int) ) goto serr;
|
||||
|
||||
if ( rc == 0 )
|
||||
{
|
||||
if ( rc == 0 ) {
|
||||
printf("Migration succesful -- destroy local copy\n");
|
||||
xc_domain_destroy(xc->xc_handle, dom);
|
||||
close(sd);
|
||||
Py_INCREF(zero);
|
||||
return zero;
|
||||
}
|
||||
else
|
||||
errno = rc;
|
||||
} else {
|
||||
errno = rc;
|
||||
}
|
||||
}
|
||||
|
||||
serr:
|
||||
printf("Migration failed -- restart local copy\n");
|
||||
xc_domain_unpause(xc->xc_handle, dom);
|
||||
PyErr_SetFromErrno(xc_error);
|
||||
if ( sd >= 0 ) close(sd);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
serr:
|
||||
printf("Migration failed -- restart local copy\n");
|
||||
xc_domain_unpause(xc->xc_handle, dom);
|
||||
PyErr_SetFromErrno(xc_error);
|
||||
if ( sd >= 0 ) close(sd);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
static PyObject *file_save(XcObject *xc, u32 dom, char *state_file, unsigned flags){
|
||||
int fd = -1;
|
||||
gzFile gfd = NULL;
|
||||
|
||||
int writerfn(void *fd, const void *buf, size_t count)
|
||||
{
|
||||
int writerfn(void *fd, const void *buf, size_t count) {
|
||||
int rc;
|
||||
while ( ((rc = gzwrite( (gzFile*)fd, (void*)buf, count)) == -1) &&
|
||||
(errno = EINTR) )
|
||||
@@ -300,30 +263,24 @@ static PyObject *pyxc_linux_save(PyObject *self,
|
||||
return ! (rc == count);
|
||||
}
|
||||
|
||||
if (strncmp(state_file,"file:",strlen("file:")) == 0)
|
||||
if (strncmp(state_file,"file:",strlen("file:")) == 0){
|
||||
state_file += strlen("file:");
|
||||
}
|
||||
|
||||
if ( (fd = open(state_file, O_CREAT|O_EXCL|O_WRONLY, 0644)) == -1 )
|
||||
{
|
||||
if ( (fd = open(state_file, O_CREAT|O_EXCL|O_WRONLY, 0644)) == -1 ) {
|
||||
perror("Could not open file for writing");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compression rate 1: we want speed over compression.
|
||||
* We're mainly going for those zero pages, after all.
|
||||
*/
|
||||
|
||||
if ( (gfd = gzdopen(fd, "wb1")) == NULL )
|
||||
{
|
||||
if ( (gfd = gzdopen(fd, "wb1")) == NULL ) {
|
||||
perror("Could not allocate compression state for state file");
|
||||
close(fd);
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
if ( xc_linux_save(xc->xc_handle, dom, flags, writerfn, gfd) == 0 )
|
||||
{
|
||||
if ( xc_linux_save(xc->xc_handle, dom, flags, writerfn, gfd) == 0 ) {
|
||||
/* kill domain. We don't want to do this for checkpointing, but
|
||||
if we don't do it here I think people will hurt themselves
|
||||
by accident... */
|
||||
@@ -337,14 +294,45 @@ static PyObject *pyxc_linux_save(PyObject *self,
|
||||
|
||||
err:
|
||||
PyErr_SetFromErrno(xc_error);
|
||||
if ( gfd != NULL )
|
||||
gzclose(gfd);
|
||||
if ( fd >= 0 )
|
||||
close(fd);
|
||||
if ( gfd != NULL ) gzclose(gfd);
|
||||
if ( fd >= 0 ) close(fd);
|
||||
unlink(state_file);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static PyObject *pyxc_linux_save(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
XcObject *xc = (XcObject *)self;
|
||||
|
||||
u32 dom;
|
||||
char *state_file;
|
||||
int progress = 1, live = -1, debug = 0;
|
||||
unsigned int flags = 0;
|
||||
PyObject *val = NULL;
|
||||
|
||||
static char *kwd_list[] = { "dom", "state_file", "progress",
|
||||
"live", "debug", NULL };
|
||||
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is|iii", kwd_list,
|
||||
&dom, &state_file, &progress,
|
||||
&live, &debug) )
|
||||
goto exit;
|
||||
|
||||
if (progress) flags |= XCFLAGS_VERBOSE;
|
||||
if (live == 1) flags |= XCFLAGS_LIVE;
|
||||
if (debug) flags |= XCFLAGS_DEBUG;
|
||||
|
||||
if ( strncmp(state_file,"tcp:", strlen("tcp:")) == 0 ) {
|
||||
/* default to live for tcp */
|
||||
if (live == -1) flags |= XCFLAGS_LIVE;
|
||||
val = tcp_save(xc, dom, state_file, flags);
|
||||
} else {
|
||||
val = file_save(xc, dom, state_file, flags);
|
||||
}
|
||||
exit:
|
||||
return val;
|
||||
}
|
||||
|
||||
static PyObject *pyxc_linux_restore(PyObject *self,
|
||||
@@ -1335,18 +1323,18 @@ static PyTypeObject PyXcType = {
|
||||
};
|
||||
|
||||
static PyMethodDef PyXc_methods[] = {
|
||||
{ "new", PyXc_new, METH_VARARGS, "Create a new Xc object." },
|
||||
{ "new", PyXc_new, METH_VARARGS, "Create a new " XENPKG " object." },
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC initXc(void)
|
||||
PyMODINIT_FUNC initxc(void)
|
||||
{
|
||||
PyObject *m, *d;
|
||||
|
||||
m = Py_InitModule("Xc", PyXc_methods);
|
||||
m = Py_InitModule(XENPKG, PyXc_methods);
|
||||
|
||||
d = PyModule_GetDict(m);
|
||||
xc_error = PyErr_NewException("Xc.error", NULL, NULL);
|
||||
xc_error = PyErr_NewException(XENPKG ".error", NULL, NULL);
|
||||
PyDict_SetItemString(d, "error", xc_error);
|
||||
|
||||
zero = PyInt_FromLong(0);
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
|
||||
from distutils.core import setup, Extension
|
||||
|
||||
module = Extension("Xc",
|
||||
module = Extension("xc",
|
||||
extra_compile_args = ["-fno-strict-aliasing"],
|
||||
include_dirs = ["../lib"],
|
||||
library_dirs = ["../lib"],
|
||||
libraries = ["xc"],
|
||||
sources = ["Xc.c"])
|
||||
|
||||
setup(name = "Xc", version = "1.0", ext_modules = [module])
|
||||
setup(name = "xc",
|
||||
version = "1.0",
|
||||
ext_package = "xen.ext",
|
||||
ext_modules = [module])
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -5,7 +5,7 @@ import os.path
|
||||
import re
|
||||
import sys
|
||||
|
||||
from xenmgr import XendRoot
|
||||
from xen.xend import XendRoot
|
||||
xroot = XendRoot.instance()
|
||||
|
||||
os.defpath = os.defpath + ':/sbin:/usr/sbin:/usr/local/sbin'
|
||||
@@ -208,16 +208,15 @@ class Xend:
|
||||
{'op' : 'save',
|
||||
'file' : filename})
|
||||
|
||||
def xend_domain_restore(self, id, filename, conf):
|
||||
def xend_domain_restore(self, id, filename):
|
||||
return xend_call(self.domainurl(id),
|
||||
{'op' : 'restore',
|
||||
'file' : filename,
|
||||
'config' : fileof(conf) })
|
||||
'file' : filename })
|
||||
|
||||
def xend_domain_migrate(self, id, dst):
|
||||
return xend_call(self.domainurl(id),
|
||||
{'op' : 'migrate',
|
||||
'dst' : dst})
|
||||
'destination': dst})
|
||||
|
||||
def xend_domain_pincpu(self, id, cpu):
|
||||
return xend_call(self.domainurl(id),
|
||||
@@ -1,8 +1,8 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
import socket
|
||||
import Xc
|
||||
xc = Xc.new()
|
||||
import xen.ext.xc
|
||||
xc = xen.ext.xc.new()
|
||||
|
||||
import sxp
|
||||
import XendRoot
|
||||
@@ -12,8 +12,8 @@ import XendDB
|
||||
import EventServer
|
||||
eserver = EventServer.instance()
|
||||
|
||||
from xenmgr.server import SrvConsoleServer
|
||||
xcd = SrvConsoleServer.instance()
|
||||
from xen.xend.server import SrvDaemon
|
||||
daemon = SrvDaemon.instance()
|
||||
|
||||
class XendConsoleInfo:
|
||||
"""Console information record.
|
||||
@@ -90,7 +90,7 @@ class XendConsole:
|
||||
self._delete_console(k)
|
||||
|
||||
def refresh(self):
|
||||
consoles = xcd.consoles()
|
||||
consoles = daemon.consoles()
|
||||
cons = {}
|
||||
for consinfo in consoles:
|
||||
id = str(sxp.child_value(consinfo, 'id'))
|
||||
@@ -111,7 +111,7 @@ class XendConsole:
|
||||
#print 'onDomainDied', "dom=", dom, "dom1=", c.dom1, "dom2=", c.dom2
|
||||
if (c.dom1 == dom) or (c.dom2 == dom):
|
||||
'XendConsole>onDomainDied', 'delete console dom=', dom
|
||||
ctrl = xcd.get_domain_console(dom)
|
||||
ctrl = daemon.get_domain_console(dom)
|
||||
if ctrl:
|
||||
ctrl.close()
|
||||
self._delete_console(c.id)
|
||||
@@ -155,7 +155,7 @@ class XendConsole:
|
||||
return self.console.values()
|
||||
|
||||
def console_create(self, dom):
|
||||
consinfo = xcd.console_create(dom)
|
||||
consinfo = daemon.console_create(dom)
|
||||
info = self._new_console(consinfo)
|
||||
return info
|
||||
|
||||
@@ -168,7 +168,7 @@ class XendConsole:
|
||||
|
||||
def console_disconnect(self, id):
|
||||
id = int(id)
|
||||
xcd.console_disconnect(id)
|
||||
daemon.console_disconnect(id)
|
||||
|
||||
def instance():
|
||||
global inst
|
||||
File renamed without changes.
@@ -8,7 +8,7 @@ import sys
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
import Xc; xc = Xc.new()
|
||||
import xen.ext.xc; xc = xen.ext.xc.new()
|
||||
import xenctl.ip
|
||||
|
||||
import sxp
|
||||
@@ -19,8 +19,8 @@ import XendDomainInfo
|
||||
import XendConsole
|
||||
import EventServer
|
||||
|
||||
from xenmgr.server import SrvConsoleServer
|
||||
xend = SrvConsoleServer.instance()
|
||||
from xen.xend.server import SrvDaemon
|
||||
xend = SrvDaemon.instance()
|
||||
|
||||
eserver = EventServer.instance()
|
||||
|
||||
File renamed without changes.
@@ -16,7 +16,7 @@ import os
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
import Xc; xc = Xc.new()
|
||||
import xen.ext.xc; xc = xen.ext.xc.new()
|
||||
import xenctl.ip
|
||||
|
||||
import sxp
|
||||
@@ -26,8 +26,8 @@ xendConsole = XendConsole.instance()
|
||||
|
||||
import XendBridge
|
||||
|
||||
import server.SrvConsoleServer
|
||||
xend = server.SrvConsoleServer.instance()
|
||||
import server.SrvDaemon
|
||||
xend = server.SrvDaemon.instance()
|
||||
|
||||
SIF_BLK_BE_DOMAIN = (1<<4)
|
||||
SIF_NET_BE_DOMAIN = (1<<5)
|
||||
File renamed without changes.
@@ -8,12 +8,12 @@
|
||||
"""
|
||||
|
||||
import os
|
||||
import Xc
|
||||
import xen.ext.xc
|
||||
|
||||
class XendNode:
|
||||
|
||||
def __init__(self):
|
||||
self.xc = Xc.new()
|
||||
self.xc = xen.ext.xc.new()
|
||||
|
||||
def shutdown(self):
|
||||
return 0
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1 @@
|
||||
|
||||
File renamed without changes.
@@ -13,8 +13,8 @@ from twisted.web import error
|
||||
from twisted.web import resource
|
||||
from twisted.web import server
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import PrettyPrint
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
|
||||
def uri_pathlist(p):
|
||||
"""Split a path into a list.
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import XendConsole
|
||||
from xen.xend import sxp
|
||||
from xen.xend import XendConsole
|
||||
from SrvDir import SrvDir
|
||||
|
||||
class SrvConsole(SrvDir):
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
|
||||
from SrvDir import SrvDir
|
||||
from SrvConsole import SrvConsole
|
||||
from xenmgr import XendConsole
|
||||
from xenmgr import sxp
|
||||
from xen.xend import XendConsole
|
||||
from xen.xend import sxp
|
||||
|
||||
class SrvConsoleDir(SrvDir):
|
||||
"""Console directory.
|
||||
+6
-8
@@ -21,16 +21,14 @@ from twisted.internet import protocol
|
||||
from twisted.internet import abstract
|
||||
from twisted.internet import defer
|
||||
|
||||
import Xc; xc = Xc.new()
|
||||
from xen.ext import xu
|
||||
|
||||
import xend.utils
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import PrettyPrint
|
||||
from xenmgr import EventServer
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
from xen.xend import EventServer
|
||||
eserver = EventServer.instance()
|
||||
|
||||
from xenmgr.server import SrvServer
|
||||
from xen.xend.server import SrvServer
|
||||
|
||||
import channel
|
||||
import blkif
|
||||
@@ -479,7 +477,7 @@ class Daemon:
|
||||
def install_child_reaper(self):
|
||||
#signal.signal(signal.SIGCHLD, self.onSIGCHLD)
|
||||
# Ensure that zombie children are automatically reaped.
|
||||
xend.utils.autoreap()
|
||||
xu.autoreap()
|
||||
|
||||
def onSIGCHLD(self, signum, frame):
|
||||
code = 1
|
||||
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
from twisted.web import error
|
||||
from xenmgr import sxp
|
||||
from xen.xend import sxp
|
||||
from SrvBase import SrvBase
|
||||
|
||||
class SrvConstructor:
|
||||
@@ -1,10 +1,10 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import XendDomain
|
||||
from xenmgr import XendConsole
|
||||
from xenmgr import PrettyPrint
|
||||
from xenmgr.Args import FormFn
|
||||
from xen.xend import sxp
|
||||
from xen.xend import XendDomain
|
||||
from xen.xend import XendConsole
|
||||
from xen.xend import PrettyPrint
|
||||
from xen.xend.Args import FormFn
|
||||
|
||||
from SrvDir import SrvDir
|
||||
|
||||
@@ -5,8 +5,8 @@ from StringIO import StringIO
|
||||
from twisted.protocols import http
|
||||
from twisted.web import error
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import XendDomain
|
||||
from xen.xend import sxp
|
||||
from xen.xend import XendDomain
|
||||
|
||||
from SrvDir import SrvDir
|
||||
from SrvDomain import SrvDomain
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import EventServer
|
||||
from xen.xend import sxp
|
||||
from xen.xend import EventServer
|
||||
from SrvDir import SrvDir
|
||||
|
||||
class SrvEventDir(SrvDir):
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import os
|
||||
from SrvDir import SrvDir
|
||||
from xenmgr import sxp
|
||||
from xenmgr import XendNode
|
||||
from xen.xend import sxp
|
||||
from xen.xend import XendNode
|
||||
|
||||
class SrvNode(SrvDir):
|
||||
"""Information about the node.
|
||||
@@ -1,6 +1,6 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
from xenmgr import XendRoot
|
||||
from xen.xend import XendRoot
|
||||
xroot = XendRoot.instance()
|
||||
from SrvDir import SrvDir
|
||||
|
||||
@@ -29,10 +29,10 @@ from twisted.web import server
|
||||
from twisted.web import resource
|
||||
from twisted.internet import reactor
|
||||
|
||||
from xenmgr import XendRoot
|
||||
from xen.xend import XendRoot
|
||||
xroot = XendRoot.instance()
|
||||
|
||||
from xenmgr import XendBridge
|
||||
from xen.xend import XendBridge
|
||||
|
||||
from SrvRoot import SrvRoot
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
from twisted.internet import defer
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import PrettyPrint
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
|
||||
import channel
|
||||
import controller
|
||||
@@ -1,5 +1,5 @@
|
||||
import Xc; xc = Xc.new()
|
||||
import xend.utils
|
||||
import xen.ext.xc; xc = xen.ext.xc.new()
|
||||
from xen.ext import xu
|
||||
from messages import msgTypeName
|
||||
|
||||
VIRQ_MISDIRECT = 0 # Catch-all interrupt for unbound VIRQs.
|
||||
@@ -21,7 +21,7 @@ class ChannelFactory:
|
||||
|
||||
def __init__(self):
|
||||
"""Constructor - do not use. Use the channelFactory function."""
|
||||
self.notifier = xend.utils.notifier()
|
||||
self.notifier = xu.notifier()
|
||||
|
||||
def addChannel(self, channel):
|
||||
"""Add a channel.
|
||||
@@ -78,7 +78,7 @@ class ChannelFactory:
|
||||
def createPort(self, dom):
|
||||
"""Create a port for a channel to the given domain.
|
||||
"""
|
||||
return xend.utils.port(dom)
|
||||
return xu.port(dom)
|
||||
|
||||
def channelFactory():
|
||||
"""Singleton constructor for the channel factory.
|
||||
@@ -3,9 +3,9 @@ from twisted.internet import reactor
|
||||
from twisted.internet import protocol
|
||||
from twisted.protocols import telnet
|
||||
|
||||
import xend.utils
|
||||
from xen.ext import xu
|
||||
|
||||
from xenmgr import EventServer
|
||||
from xen.xend import EventServer
|
||||
eserver = EventServer.instance()
|
||||
|
||||
import controller
|
||||
@@ -109,8 +109,8 @@ class ConsoleController(controller.Controller):
|
||||
self.status = "new"
|
||||
self.addr = None
|
||||
self.conn = None
|
||||
self.rbuf = xend.utils.buffer()
|
||||
self.wbuf = xend.utils.buffer()
|
||||
self.rbuf = xu.buffer()
|
||||
self.wbuf = xu.buffer()
|
||||
self.console_port = console_port
|
||||
|
||||
self.registerChannel()
|
||||
@@ -192,7 +192,7 @@ class ConsoleController(controller.Controller):
|
||||
# Send as much pending console data as there is room for.
|
||||
work = 0
|
||||
while not self.wbuf.empty() and self.channel.writeReady():
|
||||
msg = xend.utils.message(CMSG_CONSOLE, 0, 0)
|
||||
msg = xu.message(CMSG_CONSOLE, 0, 0)
|
||||
msg.append_payload(self.wbuf.read(msg.MAX_PAYLOAD))
|
||||
work += self.channel.writeRequest(msg, notify=0)
|
||||
return work
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
|
||||
import struct
|
||||
|
||||
import xend.utils
|
||||
from xen.ext import xu
|
||||
|
||||
DEBUG = 0
|
||||
|
||||
@@ -190,7 +190,7 @@ def packMsg(ty, params):
|
||||
for (k, v) in args.items():
|
||||
print 'packMsg>', k, v, type(v)
|
||||
msgid = 0
|
||||
msg = xend.utils.message(major, minor, msgid, args)
|
||||
msg = xu.message(major, minor, msgid, args)
|
||||
return msg
|
||||
|
||||
def unpackMsg(ty, msg):
|
||||
@@ -2,9 +2,9 @@ import random
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import PrettyPrint
|
||||
from xenmgr import XendBridge
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
from xen.xend import XendBridge
|
||||
|
||||
import channel
|
||||
import controller
|
||||
@@ -97,7 +97,7 @@ class NetifControllerFactory(controller.ControllerFactory):
|
||||
## netif = interface.list[netif_key]
|
||||
## netif.create()
|
||||
## print " Notifying %d" % netif.dom
|
||||
## msg = xend.utils.message(
|
||||
## msg = xu.message(
|
||||
## CMSG_NETIF_FE,
|
||||
## CMSG_NETIF_FE_INTERFACE_STATUS_CHANGED, 0,
|
||||
## { 'handle' : 0, 'status' : 1 })
|
||||
@@ -3,7 +3,7 @@ PID_FILE = '/var/run/xend.pid'
|
||||
LOG_FILE = '/var/log/xend.log'
|
||||
USER = 'root'
|
||||
CONTROL_DIR = '/var/run/xend'
|
||||
MGMT_SOCK = 'xenmgrsock' # relative to CONTROL_DIR
|
||||
MGMT_SOCK = 'xendsock' # relative to CONTROL_DIR
|
||||
EVENT_PORT = 8001
|
||||
|
||||
CONSOLE_PORT_BASE = 9600
|
||||
File renamed without changes.
File renamed without changes.
@@ -4,11 +4,11 @@
|
||||
import string
|
||||
import sys
|
||||
|
||||
from xenmgr import sxp
|
||||
from xenmgr import PrettyPrint
|
||||
from xenmgr.XendClient import server
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
from xen.xend.XendClient import server
|
||||
|
||||
from xenmgr.xm.opts import *
|
||||
from xen.xend.xm.opts import *
|
||||
|
||||
gopts = Opts(use="""[options]
|
||||
|
||||
@@ -6,10 +6,10 @@ import os.path
|
||||
import sys
|
||||
from getopt import getopt
|
||||
|
||||
from xenmgr import PrettyPrint
|
||||
from xenmgr import sxp
|
||||
from xenmgr.XendClient import server
|
||||
from xenmgr.xm import create, shutdown
|
||||
from xen.xend import PrettyPrint
|
||||
from xen.xend import sxp
|
||||
from xen.xend.XendClient import server
|
||||
from xen.xend.xm import create, shutdown
|
||||
|
||||
class Prog:
|
||||
"""Base class for sub-programs.
|
||||
File renamed without changes.
@@ -5,8 +5,8 @@ import string
|
||||
import sys
|
||||
import time
|
||||
|
||||
from xenmgr.XendClient import server
|
||||
from xenmgr.xm.opts import *
|
||||
from xen.xend.XendClient import server
|
||||
from xen.xend.xm.opts import *
|
||||
|
||||
gopts = Opts(use="""[options] [DOM]
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#============================================================================
|
||||
|
||||
from getopt import getopt
|
||||
from xenmgr.XendBridge import *
|
||||
from xen.xend.XendBridge import *
|
||||
|
||||
short_options = 'hvqni:b:c'
|
||||
long_options = ['help', 'verbose', 'quiet',
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
from distutils.core import setup, Extension
|
||||
|
||||
setup(name = 'xen',
|
||||
version = '1.0',
|
||||
description = 'Xen',
|
||||
author = 'Mike Wray',
|
||||
author_email = 'mike.wray@hp.com',
|
||||
packages = ['xen',
|
||||
'xen.ext',
|
||||
'xen.xend',
|
||||
'xen.xend.server',
|
||||
'xen.xm',
|
||||
],
|
||||
package_dir = { 'xen': 'lib' },
|
||||
)
|
||||
@@ -18,10 +18,10 @@
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
from xenmgr.server import SrvConsoleServer
|
||||
from xen.xend.server import SrvDaemon
|
||||
|
||||
def main():
|
||||
daemon = SrvConsoleServer.instance()
|
||||
daemon = SrvDaemon.instance()
|
||||
if not sys.argv[1:]:
|
||||
print 'usage: %s {start|stop|restart}' % sys.argv[0]
|
||||
elif os.fork():
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python
|
||||
# -*- mode: python; -*-
|
||||
import sys
|
||||
from xenmgr.xm import main
|
||||
from xen.xm import main
|
||||
|
||||
main.main(sys.argv)
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,14 +0,0 @@
|
||||
|
||||
from distutils.core import setup, Extension
|
||||
|
||||
PACKAGE = 'xenmgr'
|
||||
VERSION = '1.0'
|
||||
|
||||
setup(name = PACKAGE,
|
||||
version = VERSION,
|
||||
description = 'Xen Management API',
|
||||
author = 'Mike Wray',
|
||||
author_email = 'mike.wray@hp.com',
|
||||
packages = [ PACKAGE, PACKAGE + '.server', PACKAGE + '.xm' ],
|
||||
package_dir = { PACKAGE: 'lib' },
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
"""Xen management daemon. Lives in /usr/sbin.
|
||||
Run after running xend to provide http access to the management API.
|
||||
|
||||
NO LONGER NEEDED.
|
||||
"""
|
||||
from xenmgr.server import SrvServer
|
||||
SrvServer.main()
|
||||
@@ -3,7 +3,7 @@ CC = gcc
|
||||
CFLAGS = -Wall -O3 -Werror
|
||||
CFLAGS += -I../../xen/include/hypervisor-ifs
|
||||
CFLAGS += -I../../linux-xen-sparse/include
|
||||
CFLAGS += -I../xend/lib
|
||||
CFLAGS += -I../xu/lib
|
||||
|
||||
HDRS = $(wildcard *.h)
|
||||
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
|
||||
|
||||
Whitespace-only changes.
@@ -0,0 +1,532 @@
|
||||
/******************************************************************************
|
||||
* domain_controller.h
|
||||
*
|
||||
* Interface to server controller (e.g., 'xend'). This header file defines the
|
||||
* interface that is shared with guest OSes.
|
||||
*
|
||||
* Copyright (c) 2004, K A Fraser
|
||||
*/
|
||||
|
||||
#ifndef __DOMAIN_CONTROLLER_H__
|
||||
#define __DOMAIN_CONTROLLER_H__
|
||||
|
||||
|
||||
#ifndef BASIC_START_INFO
|
||||
#error "Xen header file hypervisor-if.h must already be included here."
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* EXTENDED BOOTSTRAP STRUCTURE FOR NEW DOMAINS.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
BASIC_START_INFO;
|
||||
u16 domain_controller_evtchn; /* 320 */
|
||||
} PACKED extended_start_info_t; /* 322 bytes */
|
||||
#define SIF_BLK_BE_DOMAIN (1<<4) /* Is this a block backend domain? */
|
||||
#define SIF_NET_BE_DOMAIN (1<<5) /* Is this a net backend domain? */
|
||||
|
||||
|
||||
/*
|
||||
* Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
|
||||
* interpreted by control software to determine the appropriate action. These
|
||||
* are only really advisories: the controller can actually do as it likes.
|
||||
*/
|
||||
#define SHUTDOWN_poweroff 0 /* Domain exited normally. Clean up and kill. */
|
||||
#define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */
|
||||
#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
|
||||
|
||||
|
||||
/*
|
||||
* CONTROLLER MESSAGING INTERFACE.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
u8 type; /* 0: echoed in response */
|
||||
u8 subtype; /* 1: echoed in response */
|
||||
u8 id; /* 2: echoed in response */
|
||||
u8 length; /* 3: number of bytes in 'msg' */
|
||||
u8 msg[60]; /* 4: type-specific message data */
|
||||
} PACKED control_msg_t; /* 64 bytes */
|
||||
|
||||
#define CONTROL_RING_SIZE 8
|
||||
typedef u32 CONTROL_RING_IDX;
|
||||
#define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
|
||||
|
||||
typedef struct {
|
||||
control_msg_t tx_ring[CONTROL_RING_SIZE]; /* 0: guest -> controller */
|
||||
control_msg_t rx_ring[CONTROL_RING_SIZE]; /* 512: controller -> guest */
|
||||
CONTROL_RING_IDX tx_req_prod, tx_resp_prod; /* 1024, 1028 */
|
||||
CONTROL_RING_IDX rx_req_prod, rx_resp_prod; /* 1032, 1036 */
|
||||
} PACKED control_if_t; /* 1040 bytes */
|
||||
|
||||
/*
|
||||
* Top-level command types.
|
||||
*/
|
||||
#define CMSG_CONSOLE 0 /* Console */
|
||||
#define CMSG_BLKIF_BE 1 /* Block-device backend */
|
||||
#define CMSG_BLKIF_FE 2 /* Block-device frontend */
|
||||
#define CMSG_NETIF_BE 3 /* Network-device backend */
|
||||
#define CMSG_NETIF_FE 4 /* Network-device frontend */
|
||||
#define CMSG_SHUTDOWN 6 /* Shutdown messages */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* CONSOLE DEFINITIONS
|
||||
*/
|
||||
|
||||
/*
|
||||
* Subtypes for console messages.
|
||||
*/
|
||||
#define CMSG_CONSOLE_DATA 0
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* BLOCK-INTERFACE FRONTEND DEFINITIONS
|
||||
*/
|
||||
|
||||
/* Messages from domain controller to guest. */
|
||||
#define CMSG_BLKIF_FE_INTERFACE_STATUS_CHANGED 0
|
||||
|
||||
/* Messages from guest to domain controller. */
|
||||
#define CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED 32
|
||||
#define CMSG_BLKIF_FE_INTERFACE_CONNECT 33
|
||||
#define CMSG_BLKIF_FE_INTERFACE_DISCONNECT 34
|
||||
|
||||
/* These are used by both front-end and back-end drivers. */
|
||||
#define blkif_vdev_t u16
|
||||
#define blkif_pdev_t u16
|
||||
#define blkif_sector_t u64
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_FE_INTERFACE_STATUS_CHANGED:
|
||||
* Notify a guest about a status change on one of its block interfaces.
|
||||
* If the interface is DESTROYED or DOWN then the interface is disconnected:
|
||||
* 1. The shared-memory frame is available for reuse.
|
||||
* 2. Any unacknowledged messgaes pending on the interface were dropped.
|
||||
*/
|
||||
#define BLKIF_INTERFACE_STATUS_DESTROYED 0 /* Interface doesn't exist. */
|
||||
#define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
|
||||
#define BLKIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
|
||||
typedef struct {
|
||||
u32 handle; /* 0 */
|
||||
u32 status; /* 4 */
|
||||
u16 evtchn; /* 8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
|
||||
} PACKED blkif_fe_interface_status_changed_t; /* 10 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED:
|
||||
* Notify the domain controller that the front-end driver is DOWN or UP.
|
||||
* When the driver goes DOWN then the controller will send no more
|
||||
* status-change notifications. When the driver comes UP then the controller
|
||||
* will send a notification for each interface that currently exists.
|
||||
* If the driver goes DOWN while interfaces are still UP, the domain
|
||||
* will automatically take the interfaces DOWN.
|
||||
*/
|
||||
#define BLKIF_DRIVER_STATUS_DOWN 0
|
||||
#define BLKIF_DRIVER_STATUS_UP 1
|
||||
typedef struct {
|
||||
/* IN */
|
||||
u32 status; /* 0: BLKIF_DRIVER_STATUS_??? */
|
||||
/* OUT */
|
||||
/*
|
||||
* Tells driver how many interfaces it should expect to immediately
|
||||
* receive notifications about.
|
||||
*/
|
||||
u32 nr_interfaces; /* 4 */
|
||||
} PACKED blkif_fe_driver_status_changed_t; /* 8 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_FE_INTERFACE_CONNECT:
|
||||
* If successful, the domain controller will acknowledge with a
|
||||
* STATUS_CONNECTED message.
|
||||
*/
|
||||
typedef struct {
|
||||
u32 handle; /* 0 */
|
||||
u32 __pad;
|
||||
memory_t shmem_frame; /* 8 */
|
||||
MEMORY_PADDING;
|
||||
} PACKED blkif_fe_interface_connect_t; /* 16 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
|
||||
* If successful, the domain controller will acknowledge with a
|
||||
* STATUS_DISCONNECTED message.
|
||||
*/
|
||||
typedef struct {
|
||||
u32 handle; /* 0 */
|
||||
} PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* BLOCK-INTERFACE BACKEND DEFINITIONS
|
||||
*/
|
||||
|
||||
/* Messages from domain controller. */
|
||||
#define CMSG_BLKIF_BE_CREATE 0 /* Create a new block-device interface. */
|
||||
#define CMSG_BLKIF_BE_DESTROY 1 /* Destroy a block-device interface. */
|
||||
#define CMSG_BLKIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
|
||||
#define CMSG_BLKIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
|
||||
#define CMSG_BLKIF_BE_VBD_CREATE 4 /* Create a new VBD for an interface. */
|
||||
#define CMSG_BLKIF_BE_VBD_DESTROY 5 /* Delete a VBD from an interface. */
|
||||
#define CMSG_BLKIF_BE_VBD_GROW 6 /* Append an extent to a given VBD. */
|
||||
#define CMSG_BLKIF_BE_VBD_SHRINK 7 /* Remove last extent from a given VBD. */
|
||||
|
||||
/* Messages to domain controller. */
|
||||
#define CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED 32
|
||||
|
||||
/*
|
||||
* Message request/response definitions for block-device messages.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
blkif_sector_t sector_start; /* 0 */
|
||||
blkif_sector_t sector_length; /* 8 */
|
||||
blkif_pdev_t device; /* 16 */
|
||||
u16 __pad; /* 18 */
|
||||
} PACKED blkif_extent_t; /* 20 bytes */
|
||||
|
||||
/* Non-specific 'okay' return. */
|
||||
#define BLKIF_BE_STATUS_OKAY 0
|
||||
/* Non-specific 'error' return. */
|
||||
#define BLKIF_BE_STATUS_ERROR 1
|
||||
/* The following are specific error returns. */
|
||||
#define BLKIF_BE_STATUS_INTERFACE_EXISTS 2
|
||||
#define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
|
||||
#define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
|
||||
#define BLKIF_BE_STATUS_VBD_EXISTS 5
|
||||
#define BLKIF_BE_STATUS_VBD_NOT_FOUND 6
|
||||
#define BLKIF_BE_STATUS_OUT_OF_MEMORY 7
|
||||
#define BLKIF_BE_STATUS_EXTENT_NOT_FOUND 8
|
||||
#define BLKIF_BE_STATUS_MAPPING_ERROR 9
|
||||
|
||||
/* This macro can be used to create an array of descriptive error strings. */
|
||||
#define BLKIF_BE_STATUS_ERRORS { \
|
||||
"Okay", \
|
||||
"Non-specific error", \
|
||||
"Interface already exists", \
|
||||
"Interface not found", \
|
||||
"Interface is still connected", \
|
||||
"VBD already exists", \
|
||||
"VBD not found", \
|
||||
"Out of memory", \
|
||||
"Extent not found for VBD", \
|
||||
"Could not map domain memory" }
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_BE_CREATE:
|
||||
* When the driver sends a successful response then the interface is fully
|
||||
* created. The controller will send a DOWN notification to the front-end
|
||||
* driver.
|
||||
*/
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Domain attached to new interface. */
|
||||
u32 blkif_handle; /* 4: Domain-specific interface handle. */
|
||||
/* OUT */
|
||||
u32 status; /* 8 */
|
||||
} PACKED blkif_be_create_t; /* 12 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_BE_DESTROY:
|
||||
* When the driver sends a successful response then the interface is fully
|
||||
* torn down. The controller will send a DESTROYED notification to the
|
||||
* front-end driver.
|
||||
*/
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Identify interface to be destroyed. */
|
||||
u32 blkif_handle; /* 4: ...ditto... */
|
||||
/* OUT */
|
||||
u32 status; /* 8 */
|
||||
} PACKED blkif_be_destroy_t; /* 12 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_BE_CONNECT:
|
||||
* When the driver sends a successful response then the interface is fully
|
||||
* connected. The controller will send a CONNECTED notification to the
|
||||
* front-end driver.
|
||||
*/
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Domain attached to new interface. */
|
||||
u32 blkif_handle; /* 4: Domain-specific interface handle. */
|
||||
memory_t shmem_frame; /* 8: Page cont. shared comms window. */
|
||||
MEMORY_PADDING;
|
||||
u32 evtchn; /* 16: Event channel for notifications. */
|
||||
/* OUT */
|
||||
u32 status; /* 20 */
|
||||
} PACKED blkif_be_connect_t; /* 24 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_BE_DISCONNECT:
|
||||
* When the driver sends a successful response then the interface is fully
|
||||
* disconnected. The controller will send a DOWN notification to the front-end
|
||||
* driver.
|
||||
*/
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Domain attached to new interface. */
|
||||
u32 blkif_handle; /* 4: Domain-specific interface handle. */
|
||||
/* OUT */
|
||||
u32 status; /* 8 */
|
||||
} PACKED blkif_be_disconnect_t; /* 12 bytes */
|
||||
|
||||
/* CMSG_BLKIF_BE_VBD_CREATE */
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Identify blkdev interface. */
|
||||
u32 blkif_handle; /* 4: ...ditto... */
|
||||
blkif_vdev_t vdevice; /* 8: Interface-specific id for this VBD. */
|
||||
u16 readonly; /* 10: Non-zero -> VBD isn't writeable. */
|
||||
/* OUT */
|
||||
u32 status; /* 12 */
|
||||
} PACKED blkif_be_vbd_create_t; /* 16 bytes */
|
||||
|
||||
/* CMSG_BLKIF_BE_VBD_DESTROY */
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Identify blkdev interface. */
|
||||
u32 blkif_handle; /* 4: ...ditto... */
|
||||
blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */
|
||||
u16 __pad; /* 10 */
|
||||
/* OUT */
|
||||
u32 status; /* 12 */
|
||||
} PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
|
||||
|
||||
/* CMSG_BLKIF_BE_VBD_GROW */
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Identify blkdev interface. */
|
||||
u32 blkif_handle; /* 4: ...ditto... */
|
||||
blkif_extent_t extent; /* 8: Physical extent to append to VBD. */
|
||||
blkif_vdev_t vdevice; /* 28: Interface-specific id of the VBD. */
|
||||
u16 __pad; /* 30 */
|
||||
/* OUT */
|
||||
u32 status; /* 32 */
|
||||
} PACKED blkif_be_vbd_grow_t; /* 36 bytes */
|
||||
|
||||
/* CMSG_BLKIF_BE_VBD_SHRINK */
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Identify blkdev interface. */
|
||||
u32 blkif_handle; /* 4: ...ditto... */
|
||||
blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */
|
||||
u16 __pad; /* 10 */
|
||||
/* OUT */
|
||||
u32 status; /* 12 */
|
||||
} PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED:
|
||||
* Notify the domain controller that the back-end driver is DOWN or UP.
|
||||
* If the driver goes DOWN while interfaces are still UP, the controller
|
||||
* will automatically send DOWN notifications.
|
||||
*/
|
||||
typedef struct {
|
||||
u32 status; /* 0: BLKIF_DRIVER_STATUS_??? */
|
||||
} PACKED blkif_be_driver_status_changed_t; /* 4 bytes */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NETWORK-INTERFACE FRONTEND DEFINITIONS
|
||||
*/
|
||||
|
||||
/* Messages from domain controller to guest. */
|
||||
#define CMSG_NETIF_FE_INTERFACE_STATUS_CHANGED 0
|
||||
|
||||
/* Messages from guest to domain controller. */
|
||||
#define CMSG_NETIF_FE_DRIVER_STATUS_CHANGED 32
|
||||
#define CMSG_NETIF_FE_INTERFACE_CONNECT 33
|
||||
#define CMSG_NETIF_FE_INTERFACE_DISCONNECT 34
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_FE_INTERFACE_STATUS_CHANGED:
|
||||
* Notify a guest about a status change on one of its network interfaces.
|
||||
* If the interface is DESTROYED or DOWN then the interface is disconnected:
|
||||
* 1. The shared-memory frame is available for reuse.
|
||||
* 2. Any unacknowledged messgaes pending on the interface were dropped.
|
||||
*/
|
||||
#define NETIF_INTERFACE_STATUS_DESTROYED 0 /* Interface doesn't exist. */
|
||||
#define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
|
||||
#define NETIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
|
||||
typedef struct {
|
||||
u32 handle; /* 0 */
|
||||
u32 status; /* 4 */
|
||||
u16 evtchn; /* 8: status == NETIF_INTERFACE_STATUS_CONNECTED */
|
||||
u8 mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
|
||||
} PACKED netif_fe_interface_status_changed_t; /* 16 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_FE_DRIVER_STATUS_CHANGED:
|
||||
* Notify the domain controller that the front-end driver is DOWN or UP.
|
||||
* When the driver goes DOWN then the controller will send no more
|
||||
* status-change notifications. When the driver comes UP then the controller
|
||||
* will send a notification for each interface that currently exists.
|
||||
* If the driver goes DOWN while interfaces are still UP, the domain
|
||||
* will automatically take the interfaces DOWN.
|
||||
*/
|
||||
#define NETIF_DRIVER_STATUS_DOWN 0
|
||||
#define NETIF_DRIVER_STATUS_UP 1
|
||||
typedef struct {
|
||||
/* IN */
|
||||
u32 status; /* 0: NETIF_DRIVER_STATUS_??? */
|
||||
/* OUT */
|
||||
/*
|
||||
* Tells driver how many interfaces it should expect to immediately
|
||||
* receive notifications about.
|
||||
*/
|
||||
u32 nr_interfaces; /* 4 */
|
||||
} PACKED netif_fe_driver_status_changed_t; /* 8 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_FE_INTERFACE_CONNECT:
|
||||
* If successful, the domain controller will acknowledge with a
|
||||
* STATUS_CONNECTED message.
|
||||
*/
|
||||
typedef struct {
|
||||
u32 handle; /* 0 */
|
||||
u32 __pad; /* 4 */
|
||||
memory_t tx_shmem_frame; /* 8 */
|
||||
MEMORY_PADDING;
|
||||
memory_t rx_shmem_frame; /* 16 */
|
||||
MEMORY_PADDING;
|
||||
} PACKED netif_fe_interface_connect_t; /* 24 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_FE_INTERFACE_DISCONNECT:
|
||||
* If successful, the domain controller will acknowledge with a
|
||||
* STATUS_DISCONNECTED message.
|
||||
*/
|
||||
typedef struct {
|
||||
u32 handle; /* 0 */
|
||||
} PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NETWORK-INTERFACE BACKEND DEFINITIONS
|
||||
*/
|
||||
|
||||
/* Messages from domain controller. */
|
||||
#define CMSG_NETIF_BE_CREATE 0 /* Create a new net-device interface. */
|
||||
#define CMSG_NETIF_BE_DESTROY 1 /* Destroy a net-device interface. */
|
||||
#define CMSG_NETIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
|
||||
#define CMSG_NETIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
|
||||
|
||||
/* Messages to domain controller. */
|
||||
#define CMSG_NETIF_BE_DRIVER_STATUS_CHANGED 32
|
||||
|
||||
/*
|
||||
* Message request/response definitions for net-device messages.
|
||||
*/
|
||||
|
||||
/* Non-specific 'okay' return. */
|
||||
#define NETIF_BE_STATUS_OKAY 0
|
||||
/* Non-specific 'error' return. */
|
||||
#define NETIF_BE_STATUS_ERROR 1
|
||||
/* The following are specific error returns. */
|
||||
#define NETIF_BE_STATUS_INTERFACE_EXISTS 2
|
||||
#define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
|
||||
#define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
|
||||
#define NETIF_BE_STATUS_OUT_OF_MEMORY 5
|
||||
#define NETIF_BE_STATUS_MAPPING_ERROR 6
|
||||
|
||||
/* This macro can be used to create an array of descriptive error strings. */
|
||||
#define NETIF_BE_STATUS_ERRORS { \
|
||||
"Okay", \
|
||||
"Non-specific error", \
|
||||
"Interface already exists", \
|
||||
"Interface not found", \
|
||||
"Interface is still connected", \
|
||||
"Out of memory", \
|
||||
"Could not map domain memory" }
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_BE_CREATE:
|
||||
* When the driver sends a successful response then the interface is fully
|
||||
* created. The controller will send a DOWN notification to the front-end
|
||||
* driver.
|
||||
*/
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Domain attached to new interface. */
|
||||
u32 netif_handle; /* 4: Domain-specific interface handle. */
|
||||
u8 mac[6]; /* 8 */
|
||||
u16 __pad; /* 14 */
|
||||
/* OUT */
|
||||
u32 status; /* 16 */
|
||||
} PACKED netif_be_create_t; /* 20 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_BE_DESTROY:
|
||||
* When the driver sends a successful response then the interface is fully
|
||||
* torn down. The controller will send a DESTROYED notification to the
|
||||
* front-end driver.
|
||||
*/
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Identify interface to be destroyed. */
|
||||
u32 netif_handle; /* 4: ...ditto... */
|
||||
/* OUT */
|
||||
u32 status; /* 8 */
|
||||
} PACKED netif_be_destroy_t; /* 12 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_BE_CONNECT:
|
||||
* When the driver sends a successful response then the interface is fully
|
||||
* connected. The controller will send a CONNECTED notification to the
|
||||
* front-end driver.
|
||||
*/
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Domain attached to new interface. */
|
||||
u32 netif_handle; /* 4: Domain-specific interface handle. */
|
||||
memory_t tx_shmem_frame; /* 8: Page cont. tx shared comms window. */
|
||||
MEMORY_PADDING;
|
||||
memory_t rx_shmem_frame; /* 16: Page cont. rx shared comms window. */
|
||||
MEMORY_PADDING;
|
||||
u16 evtchn; /* 24: Event channel for notifications. */
|
||||
u16 __pad; /* 26 */
|
||||
/* OUT */
|
||||
u32 status; /* 28 */
|
||||
} PACKED netif_be_connect_t; /* 32 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_BE_DISCONNECT:
|
||||
* When the driver sends a successful response then the interface is fully
|
||||
* disconnected. The controller will send a DOWN notification to the front-end
|
||||
* driver.
|
||||
*/
|
||||
typedef struct {
|
||||
/* IN */
|
||||
domid_t domid; /* 0: Domain attached to new interface. */
|
||||
u32 netif_handle; /* 4: Domain-specific interface handle. */
|
||||
/* OUT */
|
||||
u32 status; /* 8 */
|
||||
} PACKED netif_be_disconnect_t; /* 12 bytes */
|
||||
|
||||
/*
|
||||
* CMSG_NETIF_BE_DRIVER_STATUS_CHANGED:
|
||||
* Notify the domain controller that the back-end driver is DOWN or UP.
|
||||
* If the driver goes DOWN while interfaces are still UP, the domain
|
||||
* will automatically send DOWN notifications.
|
||||
*/
|
||||
typedef struct {
|
||||
u32 status; /* 0: NETIF_DRIVER_STATUS_??? */
|
||||
} PACKED netif_be_driver_status_changed_t; /* 4 bytes */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* SHUTDOWN DEFINITIONS
|
||||
*/
|
||||
|
||||
/*
|
||||
* Subtypes for shutdown messages.
|
||||
*/
|
||||
#define CMSG_SHUTDOWN_POWEROFF 0 /* Clean shutdown (SHUTDOWN_poweroff). */
|
||||
#define CMSG_SHUTDOWN_REBOOT 1 /* Clean shutdown (SHUTDOWN_reboot). */
|
||||
#define CMSG_SHUTDOWN_SUSPEND 2 /* Create suspend info, then */
|
||||
/* SHUTDOWN_suspend. */
|
||||
|
||||
#endif /* __DOMAIN_CONTROLLER_H__ */
|
||||
+1386
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,19 @@
|
||||
|
||||
from distutils.core import setup, Extension
|
||||
|
||||
xu = Extension("xu",
|
||||
extra_compile_args = ["-fno-strict-aliasing"],
|
||||
include_dirs = ["../xc/lib",
|
||||
"../../xen/include/hypervisor-ifs",
|
||||
"../../linux-xen-sparse/include"],
|
||||
library_dirs = ["../xc/lib"],
|
||||
libraries = ["xc"],
|
||||
sources = ["lib/xu.c"])
|
||||
|
||||
setup(name = "xu",
|
||||
version = "1.0",
|
||||
#packages = ["xend"],
|
||||
#package_dir = { "xend" : "lib" },
|
||||
ext_package = "xen.ext",
|
||||
ext_modules = [ xu ]
|
||||
)
|
||||