aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_xshelp.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-08-13 20:34:09 +0100
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-08-13 20:34:09 +0100
commitedef2b102fec881aba7bd644e475f6e689dddd81 (patch)
treef7e709cd8eebf7ae88f4f934ace03a7d0cea5291 /tools/libxl/libxl_xshelp.c
parent036b528f559911f1d820168ad90b2dd8cbd7f787 (diff)
downloadxen-edef2b102fec881aba7bd644e475f6e689dddd81.tar.gz
xen-edef2b102fec881aba7bd644e475f6e689dddd81.tar.bz2
xen-edef2b102fec881aba7bd644e475f6e689dddd81.zip
tools/libxl: libxl_device_generic_add: handle NULL fents or bents
This is going to be used by libxl_console_add in the next patch to avoid creating the device/console path on xenstore for console 0. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_xshelp.c')
-rw-r--r--tools/libxl/libxl_xshelp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c
index 3098f343c2..90acd5d045 100644
--- a/tools/libxl/libxl_xshelp.c
+++ b/tools/libxl/libxl_xshelp.c
@@ -49,6 +49,9 @@ char **libxl_xs_kvs_of_flexarray(libxl_gc *gc, flexarray_t *array, int length)
char **kvs;
int i;
+ if (!length)
+ return NULL;
+
kvs = libxl_calloc(gc, length + 2, sizeof(char *));
if (kvs) {
for (i = 0; i < length; i += 2) {