emul_state: enable the "image_file_path".
authorSooyoung Ha <yoosah.ha@samsung.com>
Tue, 23 Jun 2015 07:43:47 +0000 (16:43 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Thu, 20 Aug 2015 07:24:39 +0000 (16:24 +0900)
The origin code which is come from tizen_2.4 uses the BlockBackend, but it's
not available no tizen_2.3. So modify the get_drive_image_file function to
use legacy bdrv_find function.

This commit is related with 26bc68416f6a1bd7e09cae2ae49bcb57d3d0b178
and is also related with 3767865d9ee2272473a5f98cd96ce69b441f3b9e.

Change-Id: Ia9674240836b52b61e56c93761643470ecaaf036
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
tizen/src/emul_state.c

index ffd1f053644ee01c2c42356fa4d377857250ad11..d44c8834320ac54adbc0858da2ada90002858f3a 100644 (file)
@@ -40,6 +40,7 @@
 #endif
 
 #include "block/block_int.h"
+//#include "sysemu/block-backend.h"
 
 #include "emulator_options.h"
 #include "skin/maruskin_server.h"
@@ -359,23 +360,20 @@ const char* get_drive_image_file(void)
     if (drive_image_file) {
         return drive_image_file;
     }
-
-#if 0
     // we should parse from "drive" parameter.
     // so qemu_main() had to be called before.
-    BlockBackend *bb = blk_by_name("drive");
-    if (bb) {
-        BlockDriverState *bs = blk_bs(bb);
-        set_variable("drive_image_file", bs->filename, true);
+    else {
+        BlockDriverState *bs = bdrv_find("drive");
+        if (bs != NULL) {
+            set_variable("drive_image_file", bs->filename, true);
 
-        return bs->filename;
+            return bs->filename;
+        }
     }
 
     // called before device initialized
     // or very weired situation
-#endif
     LOG_SEVERE("Can not identify main drive image file !!!\n");
-
     return "";
 }