summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorSeokYeon Hwang <syeon.hwang@samsung.com>2014-07-04 19:08:42 +0900
committerSeokYeon Hwang <syeon.hwang@samsung.com>2014-07-06 14:43:39 +0900
commitbc03868a55d081601f8bad2315ce8fe791b8dfc8 (patch)
treea254614bebe32342b1ac36b1491d5b46d32c87af /hw
parent898169d36f00444f5462d1b262aa5cc5779add24 (diff)
downloadqemu-bc03868a55d081601f8bad2315ce8fe791b8dfc8.tar.gz
qemu-bc03868a55d081601f8bad2315ce8fe791b8dfc8.tar.bz2
qemu-bc03868a55d081601f8bad2315ce8fe791b8dfc8.zip
emulator: some error reporting routine is refactored
maru_register_exit_msg() can accept variable arguments. Remove maru_convert_path(), Add get_canonical_path(). Change-Id: I7975510cfb34a0bbb633df5a74ffce21922c0c92 Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com> Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/9pfs/virtio-9p-device.c15
-rw-r--r--hw/i386/pc.c11
-rw-r--r--hw/i386/pc_sysfw.c2
3 files changed, 11 insertions, 17 deletions
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 24ef874944..519b6e3c83 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -21,8 +21,7 @@
#include "virtio-9p-coth.h"
#ifdef CONFIG_MARU
-#include "../tizen/src/maru_err_table.h"
-// extern char* maru_convert_path(char* msg, const char *path);
+#include "tizen/src/util/maru_err_table.h"
#endif
static uint32_t virtio_9p_get_features(VirtIODevice *vdev, uint32_t features)
@@ -108,13 +107,11 @@ static void virtio_9p_device_realize(DeviceState *dev, Error **errp)
error_setg(errp, "Virtio-9p Failed to initialize fs-driver with id:%s"
" and export path:%s", s->fsconf.fsdev_id, s->ctx.fs_root);
#ifdef CONFIG_MARU
- const char _msg[] = "Failed to find the file sharing path. Check if the path is correct or not.\n\n";
- char* err_msg = NULL;
- err_msg = maru_convert_path((char*)_msg, s->ctx.fs_root);
- maru_register_exit_msg(MARU_EXIT_UNKNOWN, err_msg);
- if (err_msg) {
- g_free(err_msg);
- }
+ char *path = get_canonical_path(s->ctx.fs_root);
+ maru_register_exit_msg(MARU_EXIT_UNKNOWN, "Failed to find the file sharing path."
+ " Check if the path is correct or not.\n\n%s", path);
+
+ g_free(path);
#endif
goto out;
}
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f48baeea8e..612bde2f2c 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -60,7 +60,7 @@
#include "acpi-build.h"
#ifdef CONFIG_MARU
-#include "../../tizen/src/maru_err_table.h"
+#include "tizen/src/util/maru_err_table.h"
#endif
/* debug PC/ISA interrupts */
//#define DEBUG_IRQ
@@ -734,13 +734,10 @@ static void load_linux(FWCfgState *fw_cfg,
kernel_filename, strerror(errno));
#ifdef CONFIG_MARU
- char *error_msg = NULL;
+ char *path = get_canonical_path(kernel_filename);
+ maru_register_exit_msg(MARU_EXIT_KERNEL_FILE_EXCEPTION, path);
- error_msg = maru_convert_path(error_msg, kernel_filename);
- maru_register_exit_msg(MARU_EXIT_KERNEL_FILE_EXCEPTION, error_msg);
- if (error_msg) {
- g_free(error_msg);
- }
+ g_free(path);
#endif
exit(1);
}
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index 7819b21601..61e54ddc10 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -35,7 +35,7 @@
#include "sysemu/kvm.h"
#ifdef CONFIG_MARU
-#include "../../tizen/src/maru_err_table.h"
+#include "tizen/src/util/maru_err_table.h"
#endif
#define BIOS_FILENAME "bios.bin"