bitkeeper revision 1.1662.1.11 (42a4a26bkrYJJbT21Mpjyew3rnh7Cw)

xen.h, image.py, XendDomainInfo.py, xc.c, xc_linux_build.c, xc.h:
  Create store page for domains and plumb through to python.
XendDomainInfo.py:
  Cleanup comments.
Signed-off-by: Mike Wray <mike.wray@hp.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
This commit is contained in:
cl349@firebug.cl.cam.ac.uk committed 2005-06-06 19:22:19 +00:00
1 parent fa283d1991
commit 1d2beac171
6 files changed
+90 -60

No files matched your search

+14 -11
View File
@@ -260,25 +260,28 @@ static PyObject *pyxc_linux_build(PyObject *self,
{
XcObject *xc = (XcObject *)self;
u32 dom;
u32 dom;
char *image, *ramdisk = NULL, *cmdline = "";
int control_evtchn, flags = 0, vcpus = 1;
int flags = 0, vcpus = 1;
int control_evtchn, store_evtchn;
unsigned long store_mfn = 0;
static char *kwd_list[] = { "dom", "control_evtchn",
"image", "ramdisk", "cmdline", "flags", "vcpus",
NULL };
static char *kwd_list[] = { "dom", "control_evtchn", "store_evtchn",
"image", "ramdisk", "cmdline", "flags",
"vcpus", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|ssii", kwd_list,
&dom, &control_evtchn,
&image, &ramdisk, &cmdline, &flags, &vcpus) )
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|ssii", kwd_list,
&dom, &control_evtchn, &store_evtchn,
&image, &ramdisk, &cmdline, &flags,
&vcpus) )
return NULL;
if ( xc_linux_build(xc->xc_handle, dom, image,
ramdisk, cmdline, control_evtchn, flags, vcpus) != 0 )
ramdisk, cmdline, control_evtchn, flags, vcpus,
store_evtchn, &store_mfn) != 0 )
return PyErr_SetFromErrno(xc_error);
Py_INCREF(zero);
return zero;
return Py_BuildValue("{s:i}", "store_mfn", store_mfn);
}
static PyObject *pyxc_plan9_build(PyObject *self,
+5 -1
View File
@@ -148,7 +148,7 @@ class XendDomainInfo:
def _create(cls, uuid=None):
"""Create a vm object with a uuid.
@param uuid uuid to use (generated if None)
@param uuid uuid to use
@return vm
"""
if uuid is None:
@@ -178,6 +178,7 @@ class XendDomainInfo:
@param savedinfo: saved info from the domain DB
@param info: domain info from xc
@param uuid: uuid to use
@type info: xc domain dict
"""
vm = cls._create(uuid=uuid)
@@ -216,6 +217,7 @@ class XendDomainInfo:
"""Create a domain and a VM object to do a restore.
@param config: domain configuration
@param uuid: uuid to use
"""
vm = cls._create(uuid=uuid)
dom = xc.domain_create()
@@ -239,6 +241,8 @@ class XendDomainInfo:
self.image = None
self.channel = None
self.store_channel = None
self.store_mfs = None
self.controllers = {}
self.info = None
+16 -15
View File
@@ -202,21 +202,22 @@ class LinuxImageHandler(ImageHandler):
ostype = "linux"
def buildDomain(self):
#if self.vm.store_channel:
# store_evtchn = self.vm.store_channel.port2
#else:
# store_evtchn = 0
d = xc.linux_build(dom = self.vm.getDomain(),
image = self.kernel,
control_evtchn = self.vm.channel.getRemotePort(),
#store_evtchn = store_evtchn,
cmdline = self.cmdline,
ramdisk = self.ramdisk,
flags = self.flags,
vcpus = self.vm.vcpus)
#if isinstance(d, dict):
# self.vm.store_mfn = d.get('store_mfn')
return 0
if self.vm.store_channel:
store_evtchn = self.vm.store_channel.port2
else:
store_evtchn = 0
ret = xc.linux_build(dom = self.vm.getDomain(),
image = self.kernel,
control_evtchn = self.vm.channel.getRemotePort(),
store_evtchn = store_evtchn,
cmdline = self.cmdline,
ramdisk = self.ramdisk,
flags = self.flags,
vcpus = self.vm.vcpus)
if isinstance(ret, dict):
self.vm.store_mfn = ret.get('store_mfn')
return 0
return ret
class Plan9ImageHandler(ImageHandler):
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.