summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJustin M. Forbes <jmforbes@linuxtx.org>2009-10-01 09:42:56 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 14:02:08 -0500
commit850810d01b45e6ce99ac6696773e967890db2937 (patch)
treea89667c52277cd09bd7fef10ea33a68715a15809 /hw
parent6c098407ef2c56cf6b42d6e3b545b26eaaff2edf (diff)
downloadqemu-850810d01b45e6ce99ac6696773e967890db2937.tar.gz
Improve error reporting on file access
By making the error reporting include strerror(errno), it gives the user a bit more indication as to why qemu failed. This is particularly important for people running qemu as a non root user. Signed-off-by: Justin M. Forbes <jforbes@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 55e1e6394b..06826297e9 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -844,8 +844,8 @@ static void load_linux(void *fw_cfg,
if (!f || !(kernel_size = get_file_size(f)) ||
fread(header, 1, MIN(ARRAY_SIZE(header), kernel_size), f) !=
MIN(ARRAY_SIZE(header), kernel_size)) {
- fprintf(stderr, "qemu: could not load kernel '%s'\n",
- kernel_filename);
+ fprintf(stderr, "qemu: could not load kernel '%s': %s\n",
+ kernel_filename, strerror(errno));
exit(1);
}
@@ -950,8 +950,8 @@ static void load_linux(void *fw_cfg,
fi = fopen(initrd_filename, "rb");
if (!fi) {
- fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
- initrd_filename);
+ fprintf(stderr, "qemu: could not load initial ram disk '%s': %s\n",
+ initrd_filename, strerror(errno));
exit(1);
}
@@ -959,8 +959,8 @@ static void load_linux(void *fw_cfg,
initrd_addr = (initrd_max-initrd_size) & ~4095;
if (!fread_targphys_ok(initrd_addr, initrd_size, fi)) {
- fprintf(stderr, "qemu: read error on initial ram disk '%s'\n",
- initrd_filename);
+ fprintf(stderr, "qemu: read error on initial ram disk '%s': %s\n",
+ initrd_filename, strerror(errno));
exit(1);
}
fclose(fi);