Changed the error message when trying to map a null size file.
When doing `xl create` command, we get an Invalid Kernel error
when the file size is greater than zero. For zero length files, we are
falling in the mmap error, and we get an `Invalid parameter` error,
which is not explicit. With this change, we get a `zero length file`
error.
Signed-off-by: Paul Semel <semelpaul@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
"tried to map file which is too large");
goto err;
}
+ else if ( !*size )
+ {
+ xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+ "'%s': zero length file", filename);
+ goto err;
+ }
block = malloc(sizeof(*block));
if ( block == NULL ) {