[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 23 of 32 RFC] libxl: use libxl_*_init internally too
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1326388309 0 # Node ID 0d3abdb6c01894e4e07400317a0b49433dbaf1a5 # Parent fa999f4bcd85526a9ad1a6649f4069497801c5cd libxl: use libxl_*_init internally too Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> diff -r fa999f4bcd85 -r 0d3abdb6c018 tools/libxl/libxl_dm.c --- a/tools/libxl/libxl_dm.c Thu Jan 12 16:56:37 2012 +0000 +++ b/tools/libxl/libxl_dm.c Thu Jan 12 17:11:49 2012 +0000 @@ -614,12 +614,16 @@ static int libxl__vfb_and_vkb_from_hvm_g libxl_device_vkb *vkb) { const libxl_domain_build_info *b_info = &guest_config->b_info; + int ret; if (b_info->type != LIBXL_DOMAIN_TYPE_HVM) return ERROR_INVAL; - memset(vfb, 0x00, sizeof(libxl_device_vfb)); - memset(vkb, 0x00, sizeof(libxl_device_vkb)); + ret = libxl_device_vfb_init(CTX, vfb); + if (ret) return ret; + + ret = libxl_device_vkb_init(CTX, vkb); + if (ret) return ret; vfb->backend_domid = 0; vfb->devid = 0; @@ -707,14 +711,18 @@ static int libxl__create_stubdom(libxl__ goto out; } - memset(&dm_config.c_info, 0x00, sizeof(libxl_domain_create_info)); + ret = libxl_init_create_info(CTX, &dm_config.c_info); + if (ret) goto out; + dm_config.c_info.type = LIBXL_DOMAIN_TYPE_PV; dm_config.c_info.name = libxl__sprintf(gc, "%s-dm", libxl__domid_to_name(gc, guest_domid)); libxl_uuid_generate(&dm_config.c_info.uuid); - memset(&dm_config.b_info, 0x00, sizeof(libxl_domain_build_info)); + ret = libxl_init_build_info(CTX, &dm_config.b_info, &dm_config.c_info); + if (ret) goto out; + dm_config.b_info.type = dm_config.c_info.type; dm_config.b_info.max_vcpus = 1; dm_config.b_info.max_memkb = 32 * 1024; _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |