/******************************************************************************/
int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
- libxl_device_console *console,
+ libxl__device_console *console,
libxl__domain_build_state *state)
{
flexarray_t *front;
flexarray_append(front, "limit");
flexarray_append(front, libxl__sprintf(gc, "%d", LIBXL_XENCONSOLE_LIMIT));
flexarray_append(front, "type");
- if (console->consback == LIBXL_CONSOLE_BACKEND_XENCONSOLED)
+ if (console->consback == LIBXL__CONSOLE_BACKEND_XENCONSOLED)
flexarray_append(front, "xenconsoled");
else
flexarray_append(front, "ioemu");
return 0;
}
-static int init_console_info(libxl_device_console *console, int dev_num)
+static int init_console_info(libxl__device_console *console, int dev_num)
{
- memset(console, 0x00, sizeof(libxl_device_console));
+ memset(console, 0x00, sizeof(libxl__device_console));
console->devid = dev_num;
- console->consback = LIBXL_CONSOLE_BACKEND_XENCONSOLED;
+ console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
console->output = strdup("pty");
- if ( NULL == console->output )
+ if (!console->output)
return ERROR_NOMEM;
return 0;
}
-
int libxl__domain_build(libxl__gc *gc,
libxl_domain_build_info *info,
uint32_t domid,
switch (d_config->c_info.type) {
case LIBXL_DOMAIN_TYPE_HVM:
{
- libxl_device_console console;
+ libxl__device_console console;
libxl_device_vkb vkb;
ret = init_console_info(&console, 0);
if ( ret )
goto error_out;
libxl__device_console_add(gc, domid, &console, &state);
- libxl_device_console_dispose(&console);
+ libxl__device_console_dispose(&console);
libxl_device_vkb_init(&vkb);
libxl_device_vkb_add(ctx, domid, &vkb);
case LIBXL_DOMAIN_TYPE_PV:
{
int need_qemu = 0;
- libxl_device_console console;
+ libxl__device_console console;
for (i = 0; i < d_config->num_vfbs; i++) {
libxl_device_vfb_add(ctx, domid, &d_config->vfbs[i]);
d_config->num_disks, &d_config->disks[0]);
if (need_qemu)
- console.consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+ console.consback = LIBXL__CONSOLE_BACKEND_IOEMU;
libxl__device_console_add(gc, domid, &console, &state);
- libxl_device_console_dispose(&console);
+ libxl__device_console_dispose(&console);
if (need_qemu) {
libxl__create_xenpv_qemu(gc, domid, d_config, &state, &dm_starting);
{
libxl_ctx *ctx = libxl__gc_owner(gc);
int i, num_console = STUBDOM_SPECIAL_CONSOLES, ret;
- libxl_device_console *console;
+ libxl__device_console *console;
libxl_domain_config dm_config;
libxl_device_vfb vfb;
libxl_device_vkb vkb;
if (guest_config->b_info.u.hvm.serial)
num_console++;
- console = libxl__calloc(gc, num_console, sizeof(libxl_device_console));
+ console = libxl__calloc(gc, num_console, sizeof(libxl__device_console));
if (!console) {
ret = ERROR_NOMEM;
goto out_free;
for (i = 0; i < num_console; i++) {
console[i].devid = i;
- console[i].consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+ console[i].consback = LIBXL__CONSOLE_BACKEND_IOEMU;
/* STUBDOM_CONSOLE_LOGGING (console 0) is for minios logging
* STUBDOM_CONSOLE_SAVE (console 1) is for writing the save file
* STUBDOM_CONSOLE_RESTORE (console 2) is for reading the save file
}
int libxl__need_xenpv_qemu(libxl__gc *gc,
- int nr_consoles, libxl_device_console *consoles,
+ int nr_consoles, libxl__device_console *consoles,
int nr_vfbs, libxl_device_vfb *vfbs,
int nr_disks, libxl_device_disk *disks)
{
}
for (i = 0; i < nr_consoles; i++) {
- if (consoles[i].consback == LIBXL_CONSOLE_BACKEND_IOEMU) {
+ if (consoles[i].consback == LIBXL__CONSOLE_BACKEND_IOEMU) {
ret = 1;
goto out;
}
int *pdisk, int *ppartition);
_hidden int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
- libxl_device_console *console,
+ libxl__device_console *console,
libxl__domain_build_state *state);
_hidden int libxl__device_generic_add(libxl__gc *gc, libxl__device *device,
libxl__domain_build_state *state,
libxl__spawner_starting **starting_r);
_hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
- int nr_consoles, libxl_device_console *consoles,
+ int nr_consoles, libxl__device_console *consoles,
int nr_vfbs, libxl_device_vfb *vfbs,
int nr_disks, libxl_device_disk *disks);
/* Caller must either: pass starting_r==0, or on successful
(2, "PV"),
])
-libxl_console_backend = Enumeration("console_backend", [
- (1, "XENCONSOLED"),
- (2, "IOEMU"),
- ])
-
libxl_disk_format = Enumeration("disk_format", [
(0, "UNKNOWN"),
(1, "QCOW"),
("devid", integer),
])
-libxl_device_console = Struct("device_console", [
- ("backend_domid", libxl_domid),
- ("devid", integer),
- ("consback", libxl_console_backend),
- ("output", string),
- ])
-
libxl_device_disk = Struct("device_disk", [
("backend_domid", libxl_domid),
("pdev_path", string),
namespace("libxl__")
+libxl_domid = Builtin("domid", namespace="libxl_", json_fn = "yajl_gen_integer")
+
libxl__qmp_message_type = Enumeration("qmp_message_type", [
(1, "QMP"),
(2, "return"),
(6, "VKBD"),
(7, "CONSOLE"),
])
+
+libxl__console_backend = Enumeration("console_backend", [
+ (1, "XENCONSOLED"),
+ (2, "IOEMU"),
+ ])
+
+libxl__device_console = Struct("device_console", [
+ ("backend_domid", libxl_domid),
+ ("devid", integer),
+ ("consback", libxl__console_backend),
+ ("output", string),
+ ])