aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-01-26 11:47:52 +0000
committerIan Campbell <ian.campbell@citrix.com>2011-01-26 11:47:52 +0000
commitc80ed144feb3bcf697e13204207e6863f0e2b9b0 (patch)
tree4c3b61c1d0c8772b4793c22a943ef8ea3a4a1316 /tools/libxl/libxl.c
parentf96101286a629a2cb4d4ebd24a1e57bdfc74a184 (diff)
downloadxen-c80ed144feb3bcf697e13204207e6863f0e2b9b0.tar.gz
xen-c80ed144feb3bcf697e13204207e6863f0e2b9b0.tar.bz2
xen-c80ed144feb3bcf697e13204207e6863f0e2b9b0.zip
libxl: only check size of regular files when validating a virtual disk
st_size is only valid for regular files and not block devices. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl.c')
-rw-r--r--tools/libxl/libxl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6fee2b1a60..ccbc84218b 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -850,7 +850,7 @@ static int validate_virtual_disk(libxl_ctx *ctx, char *file_name, libxl_disk_phy
file_name);
return ERROR_INVAL;
}
- } else if ( stat_buf.st_size == 0 ) {
+ } else if ( S_ISREG(stat_buf.st_mode) && stat_buf.st_size == 0 ) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual disk %s size is 0!\n", file_name);
return ERROR_INVAL;
}