From: Ian Campbell Date: Wed, 20 Apr 2011 16:13:07 +0000 (+0100) Subject: tools: libxl: generalize libxl_qemu_machine_type into libxl_domain_type X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=167d1ba113251d06b9fc968d552986f879fe67e0;p=xen.git 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 Acked-by: Ian Jackson Committed-by: Ian Jackson --- diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 343d9874a2..d24567fd8c 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -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_device_model_version { /* Historical qemu-xen device model (qemu-dm) */ diff --git a/tools/libxl/libxl.idl b/tools/libxl/libxl.idl index 0e47f297da..98d0924eed 100644 --- a/tools/libxl/libxl.idl +++ b/tools/libxl/libxl.idl @@ -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_device_model_version = Number("device_model_version", namespace="libxl_") libxl_console_consback = Number("console_consback", namespace="libxl_") libxl_console_constype = Number("console_constype", namespace="libxl_") @@ -145,7 +145,7 @@ libxl_device_model_info = Struct("device_model_info",[ ("device_model_stubdomain", bool), ("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 --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 079ff0b943..345c9afae0 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -140,7 +140,7 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, 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) { @@ -205,10 +205,10 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, 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; } @@ -245,7 +245,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, 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"); } @@ -283,7 +283,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, 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); } @@ -296,7 +296,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, 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) { @@ -362,10 +362,10 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, 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; } @@ -374,7 +374,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, 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 = @@ -929,7 +929,7 @@ static int libxl__build_xenpv_qemu_args(libxl__gc *gc, info->dom_name = libxl_domid_to_name(ctx, domid); info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; info->device_model = NULL; - info->type = LIBXL_QEMU_MACHINE_TYPE_PV; + info->type = LIBXL_DOMAIN_TYPE_PV; return 0; } diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 0eac53e35a..89423cdf5b 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1148,8 +1148,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 --git a/tools/python/xen/lowlevel/xl/xl.c b/tools/python/xen/lowlevel/xl/xl.c index 692104816b..78fd9a781f 100644 --- a/tools/python/xen/lowlevel/xl/xl.c +++ b/tools/python/xen/lowlevel/xl/xl.c @@ -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);