Merge branch 'upstream-1.7' into tizen_qemu_1.7
[sdk/emulator/qemu.git] / blockdev.c
index 44755e1..9a4a8fb 100644 (file)
@@ -288,6 +288,11 @@ static int parse_block_error_action(const char *buf, bool is_read, Error **errp)
     }
 }
 
+#ifdef CONFIG_MARU
+extern int start_simple_client(char* msg);
+extern char* maru_convert_path(char* msg, const char *path);
+#endif
+
 static bool check_throttle_config(ThrottleConfig *cfg, Error **errp)
 {
     if (throttle_conflicting(cfg)) {
@@ -515,6 +520,16 @@ static DriveInfo *blockdev_init(QDict *bs_opts,
     ret = bdrv_open(dinfo->bdrv, file, bs_opts, bdrv_flags, drv, &error);
 
     if (ret < 0) {
+#ifdef CONFIG_MARU
+        const char _msg[] = "Failed to load disk file from the following path. Check if the file is corrupted or missing.\n\n";
+           char* err_msg = NULL;
+        err_msg = maru_convert_path((char*)_msg, file);
+        start_simple_client(err_msg);
+        if (err_msg) {
+            g_free(err_msg);
+        }
+#endif
+
         error_setg(errp, "could not open disk image %s: %s",
                    file ?: dinfo->id, error_get_pretty(error));
         error_free(error);