[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 09 of 20] libxl: remove redundant info from dm info
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1327336698 0 # Node ID ceec8103098f611789c4fe6405b7f681d8b21f0e # Parent e6287c6308bd2ef1fb6440ee2be4f0d5492566f9 libxl: remove redundant info from dm info. Remove "target_ram", "acpi", "vcpus" and "vcpu_avail" from device model info and use domain_build_info instead. These must all be consistently specified to both the domain and the device model, there is no need (and a great deal of danger) in exposing a way for a user of libxl to set them differently. Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> diff -r e6287c6308bd -r ceec8103098f tools/libxl/libxl_create.c --- a/tools/libxl/libxl_create.c Mon Jan 23 16:38:17 2012 +0000 +++ b/tools/libxl/libxl_create.c Mon Jan 23 16:38:18 2012 +0000 @@ -119,11 +119,7 @@ int libxl_init_dm_info(libxl_ctx *ctx, dm_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; dm_info->device_model_stubdomain = false; dm_info->device_model = NULL; - dm_info->target_ram = libxl__sizekb_to_mb(b_info->target_memkb); dm_info->videoram = libxl__sizekb_to_mb(b_info->video_memkb); - dm_info->acpi = b_info->u.hvm.acpi; - dm_info->vcpus = b_info->max_vcpus; - dm_info->vcpu_avail = b_info->cur_vcpus; dm_info->stdvga = 0; dm_info->vnc.enable = 1; diff -r e6287c6308bd -r ceec8103098f tools/libxl/libxl_dm.c --- a/tools/libxl/libxl_dm.c Mon Jan 23 16:38:17 2012 +0000 +++ b/tools/libxl/libxl_dm.c Mon Jan 23 16:38:18 2012 +0000 @@ -78,6 +78,7 @@ static char ** libxl__build_device_model const libxl_domain_config *guest_config, const libxl_device_model_info *info) { + const libxl_domain_build_info *b_info = &guest_config->b_info; const libxl_device_nic *vifs = guest_config->vifs; const int num_vifs = guest_config->num_vifs; int i; @@ -159,14 +160,18 @@ static char ** libxl__build_device_model if (info->soundhw) { flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL); } - if (info->acpi) { + if (b_info->u.hvm.acpi) { flexarray_append(dm_args, "-acpi"); } - if (info->vcpus > 1) { - flexarray_vappend(dm_args, "-vcpus", libxl__sprintf(gc, "%d", info->vcpus), NULL); + if (b_info->max_vcpus > 1) { + flexarray_vappend(dm_args, "-vcpus", + libxl__sprintf(gc, "%d", b_info->max_vcpus), + NULL); } - if (info->vcpu_avail) { - flexarray_vappend(dm_args, "-vcpu_avail", libxl__sprintf(gc, "0x%x", info->vcpu_avail), NULL); + if (b_info->cur_vcpus) { + flexarray_vappend(dm_args, "-vcpu_avail", + libxl__sprintf(gc, "0x%x", b_info->cur_vcpus), + NULL); } for (i = 0; i < num_vifs; i++) { if (vifs[i].nictype == LIBXL_NIC_TYPE_IOEMU) { @@ -234,6 +239,7 @@ static char ** libxl__build_device_model const libxl_device_model_info *info) { libxl_ctx *ctx = libxl__gc_owner(gc); + const libxl_domain_build_info *b_info = &guest_config->b_info; const libxl_device_disk *disks = guest_config->disks; const libxl_device_nic *vifs = guest_config->vifs; const int num_disks = guest_config->num_disks; @@ -366,15 +372,18 @@ static char ** libxl__build_device_model if (info->soundhw) { flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL); } - if (!info->acpi) { + if (!b_info->u.hvm.acpi) { flexarray_append(dm_args, "-no-acpi"); } - if (info->vcpus > 1) { + if (b_info->max_vcpus > 1) { flexarray_append(dm_args, "-smp"); - if (info->vcpu_avail) - flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d", info->vcpus, info->vcpu_avail)); + if (b_info->cur_vcpus) + flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d", + b_info->max_vcpus, + b_info->cur_vcpus)); else - flexarray_append(dm_args, libxl__sprintf(gc, "%d", info->vcpus)); + flexarray_append(dm_args, libxl__sprintf(gc, "%d", + b_info->max_vcpus)); } for (i = 0; i < num_vifs; i++) { if (vifs[i].nictype == LIBXL_NIC_TYPE_IOEMU) { @@ -432,7 +441,9 @@ static char ** libxl__build_device_model /* RAM Size */ flexarray_append(dm_args, "-m"); - flexarray_append(dm_args, libxl__sprintf(gc, "%d", info->target_ram)); + flexarray_append(dm_args, + libxl__sprintf(gc, "%d", + libxl__sizekb_to_mb(b_info->target_memkb))); if (info->type == LIBXL_DOMAIN_TYPE_HVM) { for (i = 0; i < num_disks; i++) { diff -r e6287c6308bd -r ceec8103098f tools/libxl/libxl_types.idl --- a/tools/libxl/libxl_types.idl Mon Jan 23 16:38:17 2012 +0000 +++ b/tools/libxl/libxl_types.idl Mon Jan 23 16:38:18 2012 +0000 @@ -248,7 +248,6 @@ libxl_device_model_info = Struct("device ("device_model", string), ("saved_state", string), ("type", libxl_domain_type), - ("target_ram", uint32), # size of the videoram in MB ("videoram", integer), ("stdvga", bool), @@ -265,9 +264,6 @@ libxl_device_model_info = Struct("device # usbdevice: "tablet" for absolute mouse, "mouse" for PS/2 protocol relative mouse ("usbdevice", string), ("soundhw", string), - ("acpi", bool), - ("vcpus", integer), # max number of vcpus - ("vcpu_avail", integer), # vcpus actually available ("xen_platform_pci", bool), # extra parameters pass directly to qemu, NULL terminated ("extra", libxl_string_list), diff -r e6287c6308bd -r ceec8103098f tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Mon Jan 23 16:38:17 2012 +0000 +++ b/tools/libxl/xl_cmdimpl.c Mon Jan 23 16:38:18 2012 +0000 @@ -379,7 +379,6 @@ static void printf_info(int domid, printf("\t\t\t(boot %s)\n", dm_info->boot); printf("\t\t\t(usb %d)\n", dm_info->usb); printf("\t\t\t(usbdevice %s)\n", dm_info->usbdevice); - printf("\t\t\t(acpi %d)\n", dm_info->acpi); printf("\t\t\t(spice %d)\n", dm_info->spice.enable); printf("\t\t\t(spiceport %d)\n", dm_info->spice.port); printf("\t\t\t(spicetls_port %d)\n", dm_info->spice.tls_port); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |