aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_dm.c
diff options
context:
space:
mode:
authorDario Faggioli <raistlin@linux.it>2012-06-06 15:57:08 +0100
committerDario Faggioli <raistlin@linux.it>2012-06-06 15:57:08 +0100
commit4c0b68289377ceec17538e37abd58c3045f61281 (patch)
treed546f98a92eb6dd6c219d34326ccdb8dd9229db2 /tools/libxl/libxl_dm.c
parentafdeff6e5448e07159a6be78fe67908744fd9775 (diff)
downloadxen-4c0b68289377ceec17538e37abd58c3045f61281.tar.gz
xen-4c0b68289377ceec17538e37abd58c3045f61281.tar.bz2
xen-4c0b68289377ceec17538e37abd58c3045f61281.zip
libxl: introduce LIBXL_DOMAIN_TYPE_INVALID
To avoid recent gcc complaining about: libxl.c: In function 'libxl_primary_console_exec': libxl.c:1233:9: error: case value '4294967295' not in enumerated type 'libxl_domain_type' [-Werror=switch] Also: - have all the call sites of libxl__domain_type() return with error in case the function returns LIBXL_DOMAIN_TYPE_INVALID; - adjust all other code segments where -Wswitch makes would claim that LIBXL_DOMAIN_TYPE_INVALID is not handled by adding a "default: abort();" clause. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- use LIBXL_DOMAIN_TYPE_INVALID instead of -1 for libxl_domain_build_info.type's keyvar_init_val. -- what used to be libxl_primary_console_exec is now in libxl__primary_console_find so resolve the rejected hunk accordingly ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_dm.c')
-rw-r--r--tools/libxl/libxl_dm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d987347d0b..340fcfa846 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -257,6 +257,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
flexarray_append(dm_args, b_info->extra_hvm[i]);
break;
+ default:
+ abort();
}
flexarray_append(dm_args, NULL);
return (char **) flexarray_contents(dm_args);
@@ -505,6 +507,8 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
flexarray_append(dm_args, b_info->extra_hvm[i]);
break;
+ default:
+ abort();
}
ram_size = libxl__sizekb_to_mb(b_info->max_memkb - b_info->video_memkb);