# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1302698151 -3600
# Node ID 624f293ec064968fed538177a910bf7479f6a879
# Parent f5fb8d97a4b921e1afa9410fb3c75d12bd9e8d28
tools: libxl: generalize libxl_qemu_machine_type into libxl_domain_type
The FV/PV distinction is not particular to the device model, although
that remains the only user for now.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r f5fb8d97a4b9 -r 624f293ec064 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Wed Apr 13 13:35:51 2011 +0100
+++ b/tools/libxl/libxl.h Wed Apr 13 13:35:51 2011 +0100
@@ -162,9 +162,9 @@ typedef struct {
void libxl_cpuarray_destroy(libxl_cpuarray *array);
typedef enum {
- LIBXL_QEMU_MACHINE_TYPE_FV = 1,
- LIBXL_QEMU_MACHINE_TYPE_PV,
-} libxl_qemu_machine_type;
+ LIBXL_DOMAIN_TYPE_FV = 1,
+ LIBXL_DOMAIN_TYPE_PV,
+} libxl_domain_type;
typedef enum {
LIBXL_CONSTYPE_SERIAL = 1,
diff -r f5fb8d97a4b9 -r 624f293ec064 tools/libxl/libxl.idl
--- a/tools/libxl/libxl.idl Wed Apr 13 13:35:51 2011 +0100
+++ b/tools/libxl/libxl.idl Wed Apr 13 13:35:51 2011 +0100
@@ -8,7 +8,7 @@ libxl_uuid = Builtin("uuid")
libxl_mac = Builtin("mac")
libxl_cpumap = Builtin("cpumap", destructor_fn="libxl_cpumap_destroy",
passby=PASS_BY_REFERENCE)
libxl_cpuarray = Builtin("cpuarray", destructor_fn="libxl_cpuarray_destroy",
passby=PASS_BY_REFERENCE)
-libxl_qemu_machine_type = Number("qemu_machine_type", namespace="libxl_")
+libxl_domain_type = Number("domain_type", namespace="libxl_")
libxl_console_consback = Number("console_consback", namespace="libxl_")
libxl_console_constype = Number("console_constype", namespace="libxl_")
libxl_disk_format = Number("disk_format", namespace="libxl_")
@@ -143,7 +143,7 @@ libxl_device_model_info = Struct("device
("device_model_version", integer),
("device_model", string, False, "if you set this you must set
device_model_version too"),
("saved_state", string),
- ("type", libxl_qemu_machine_type),
+ ("type", libxl_domain_type),
("target_ram", uint32),
("videoram", integer, False, "size of the videoram in
MB"),
("stdvga", bool, False, "stdvga enabled or
disabled"),
diff -r f5fb8d97a4b9 -r 624f293ec064 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c Wed Apr 13 13:35:51 2011 +0100
+++ b/tools/libxl/libxl_dm.c Wed Apr 13 13:35:51 2011 +0100
@@ -137,7 +137,7 @@ static char ** libxl__build_device_model
if (info->serial) {
flexarray_vappend(dm_args, "-serial", info->serial, NULL);
}
- if (info->type == LIBXL_QEMU_MACHINE_TYPE_FV) {
+ if (info->type == LIBXL_DOMAIN_TYPE_FV) {
int ioemu_vifs = 0;
if (info->videoram) {
@@ -202,10 +202,10 @@ static char ** libxl__build_device_model
flexarray_append(dm_args, info->extra[i]);
flexarray_append(dm_args, "-M");
switch (info->type) {
- case LIBXL_QEMU_MACHINE_TYPE_PV:
+ case LIBXL_DOMAIN_TYPE_PV:
flexarray_append(dm_args, "xenpv");
break;
- case LIBXL_QEMU_MACHINE_TYPE_FV:
+ case LIBXL_DOMAIN_TYPE_FV:
flexarray_append(dm_args, "xenfv");
break;
}
@@ -242,7 +242,7 @@ static char ** libxl__build_device_model
flexarray_vappend(dm_args, dm,
"-xen-domid", libxl__sprintf(gc, "%d", info->domid),
NULL);
- if (info->type == LIBXL_QEMU_MACHINE_TYPE_PV) {
+ if (info->type == LIBXL_DOMAIN_TYPE_PV) {
flexarray_append(dm_args, "-xen-attach");
}
@@ -280,7 +280,7 @@ static char ** libxl__build_device_model
flexarray_append(dm_args, "-sdl");
}
- if (info->type == LIBXL_QEMU_MACHINE_TYPE_PV && !info->nographic) {
+ if (info->type == LIBXL_DOMAIN_TYPE_PV && !info->nographic) {
flexarray_vappend(dm_args, "-vga", "xenfb", NULL);
}
@@ -293,7 +293,7 @@ static char ** libxl__build_device_model
if (info->serial) {
flexarray_vappend(dm_args, "-serial", info->serial, NULL);
}
- if (info->type == LIBXL_QEMU_MACHINE_TYPE_FV) {
+ if (info->type == LIBXL_DOMAIN_TYPE_FV) {
int ioemu_vifs = 0;
if (info->stdvga) {
@@ -359,10 +359,10 @@ static char ** libxl__build_device_model
flexarray_append(dm_args, info->extra[i]);
flexarray_append(dm_args, "-M");
switch (info->type) {
- case LIBXL_QEMU_MACHINE_TYPE_PV:
+ case LIBXL_DOMAIN_TYPE_PV:
flexarray_append(dm_args, "xenpv");
break;
- case LIBXL_QEMU_MACHINE_TYPE_FV:
+ case LIBXL_DOMAIN_TYPE_FV:
flexarray_append(dm_args, "xenfv");
break;
}
@@ -371,7 +371,7 @@ static char ** libxl__build_device_model
flexarray_append(dm_args, "-m");
flexarray_append(dm_args, libxl__sprintf(gc, "%d", info->target_ram));
- if (info->type == LIBXL_QEMU_MACHINE_TYPE_FV) {
+ if (info->type == LIBXL_DOMAIN_TYPE_FV) {
for (i; i < num_disks; i++) {
int disk, part;
int dev_number =
@@ -921,7 +921,7 @@ static int libxl__build_xenpv_qemu_args(
info->dom_name = libxl_domid_to_name(ctx, domid);
info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_DEFAULT;
info->device_model = NULL;
- info->type = LIBXL_QEMU_MACHINE_TYPE_PV;
+ info->type = LIBXL_DOMAIN_TYPE_PV;
return 0;
}
diff -r f5fb8d97a4b9 -r 624f293ec064 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Wed Apr 13 13:35:51 2011 +0100
+++ b/tools/libxl/xl_cmdimpl.c Wed Apr 13 13:35:51 2011 +0100
@@ -1131,8 +1131,8 @@ skip_vfb:
}
dm_info->type = c_info->hvm ?
- LIBXL_QEMU_MACHINE_TYPE_FV :
- LIBXL_QEMU_MACHINE_TYPE_PV;
+ LIBXL_DOMAIN_TYPE_FV :
+ LIBXL_DOMAIN_TYPE_PV;
xlu_cfg_destroy(config);
}
diff -r f5fb8d97a4b9 -r 624f293ec064 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c Wed Apr 13 13:35:51 2011 +0100
+++ b/tools/python/xen/lowlevel/xl/xl.c Wed Apr 13 13:35:51 2011 +0100
@@ -769,8 +769,8 @@ PyMODINIT_FUNC initxl(void)
_INT_CONST(m, SHUTDOWN_crash);
_INT_CONST(m, SHUTDOWN_watchdog);
- _INT_CONST_LIBXL(m, QEMU_MACHINE_TYPE_FV);
- _INT_CONST_LIBXL(m, QEMU_MACHINE_TYPE_PV);
+ _INT_CONST_LIBXL(m, DOMAIN_TYPE_FV);
+ _INT_CONST_LIBXL(m, DOMAIN_TYPE_PV);
_INT_CONST_LIBXL(m, CONSTYPE_SERIAL);
_INT_CONST_LIBXL(m, CONSTYPE_PV);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|