int xc_suspend_evtchn_init_sane(xc_interface *xch, xc_evtchn *xce,
int domid, int port, int *lockfd);
-int xc_get_bit_size(xc_interface *xch,
- const char *image_name, const char *cmdline,
- const char *features, int *type);
-
int xc_mark_page_online(xc_interface *xch, unsigned long start,
unsigned long end, uint32_t *status);
/* ------------------------------------------------------------------------ */
-int xc_get_bit_size(xc_interface *xch,
- const char *image_name, const char *cmdline,
- const char *features, int *bit_size)
-{
- struct xc_dom_image *dom;
- int rc;
- *bit_size = 0;
- dom = xc_dom_allocate(xch, cmdline, features);
- if (dom == NULL)
- return -1;
- if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
- goto out;
- if ( (rc = xc_dom_parse_image(dom)) != 0 )
- goto out;
- if( dom->guest_type != NULL){
- if(strstr(dom->guest_type, "x86_64") != NULL)
- *bit_size = X86_64_B_SIZE; //64bit Guest
- if(strstr(dom->guest_type, "x86_32") != NULL)
- *bit_size = X86_32_B_SIZE; //32bit Guest
- }
- out:
- xc_dom_release(dom);
- return rc;
-}
-
int xc_linux_build(xc_interface *xch, uint32_t domid,
unsigned int mem_mb,
const char *image_name,
#include <Python.h>
#include <xenctrl.h>
-#include <xenguest.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
return info_dict;
}
-static PyObject *pyxc_getBitSize(XcObject *self,
- PyObject *args,
- PyObject *kwds)
-{
- PyObject *info_type;
- char *image = NULL, *cmdline = "", *features = NULL;
- int type = 0;
- static char *kwd_list[] = { "image", "cmdline", "features", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "sss", kwd_list,
- &image, &cmdline, &features) )
- return NULL;
-
- xc_get_bit_size(self->xc_handle, image, cmdline, features, &type);
- if (type < 0)
- return pyxc_error_to_exception(self->xc_handle);
- info_type = Py_BuildValue("{s:i}",
- "type", type);
- return info_type;
-}
-
static PyObject *pyxc_hvm_param_get(XcObject *self,
PyObject *args,
PyObject *kwds)
" cpumap [int]: Bitmap of CPUs this VCPU can run on\n"
" cpu [int]: CPU that this VCPU is currently bound to\n" },
- {"getBitSize",
- (PyCFunction)pyxc_getBitSize,
- METH_VARARGS | METH_KEYWORDS, "\n"
- "Get the bitsize of a guest OS.\n"
- " image [str]: Name of kernel image file. May be gzipped.\n"
- " cmdline [str, n/a]: Kernel parameters, if any.\n\n"},
-
{ "gnttab_hvm_seed",
(PyCFunction)pyxc_gnttab_hvm_seed,
METH_KEYWORDS, "\n"