[Title] modify 'HW Virtualization State' in Detail Info Dialog in Windows
authorSon Hyunjun <hj79.son@samsung.com>
Thu, 12 Apr 2012 14:48:46 +0000 (23:48 +0900)
committerSon Hyunjun <hj79.son@samsung.com>
Thu, 12 Apr 2012 14:48:46 +0000 (23:48 +0900)
[Type] Feature
[Module] Skin
[Priority] Minor
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]

Change-Id: I9230f7bd6713af62065093e885ddcaab0687bcce

tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/DetailInfoDialog.java
tizen/src/skin/maruskin_operation.c
tizen/src/skin/maruskin_operation.h
vl.c

index 5a430dc..653cb11 100644 (file)
@@ -202,7 +202,9 @@ public class DetailInfoDialog extends SkinDialog {
                String sharedPath = "";
                boolean isHwVirtual = false;
                String hwVirtualCompare = "";
-
+               String haxError = "hax_error=";
+               boolean isHaxError = false;
+               
                if ( SkinUtil.isLinuxPlatform() ) {
                        hwVirtualCompare = "-enable-kvm";
                } else if ( SkinUtil.isWindowsPlatform() ) {
@@ -291,6 +293,11 @@ public class DetailInfoDialog extends SkinDialog {
 
                                        } else if ( hwVirtualCompare.equals( arg ) ) {
                                                isHwVirtual = true;
+                                       } else if ( arg.startsWith( haxError ) ) {
+                                               String[] sp = arg.split( "=" );
+                                               if( 1 < sp.length ) {
+                                                       isHaxError = Boolean.parseBoolean( sp[1] );
+                                               }
                                        }
 
                                }
@@ -330,9 +337,13 @@ public class DetailInfoDialog extends SkinDialog {
                }
 
                if( isHwVirtual ) {
-                       result.put( "HW Virtualization", "Supported" );
+                       if( isHaxError ) {
+                               result.put( "HW Virtualization State", "Disable(insufficient memory for driver)" );
+                       }else {
+                               result.put( "HW Virtualization State", "Enable" );
+                       }
                }else {
-                       result.put( "HW Virtualization", "Not Supported" );
+                       result.put( "HW Virtualization State", "Disable" );
                }
                
                if ( StringUtil.isEmpty( imagePath ) ) {
index 7321673..f6ebe61 100644 (file)
 #include "qemu-common.h"
 #include "sysemu.h"
 
+#ifdef _WIN32
+#include "target-i386/hax-i386.h"
+#endif
+
 MULTI_DEBUG_CHANNEL(qemu, skin_operation);
 
 
@@ -274,6 +278,23 @@ DetailInfo* get_detail_info( int qemu_argc, char** qemu_argv ) {
         total_len += delimiter_len;
     }
 
+#ifdef _WIN32
+    const int HAX_LEN = 32;
+    char hax_error[HAX_LEN];
+    memset( hax_error, 0, HAX_LEN );
+
+    int hax_err_len = sprintf( hax_error + hax_err_len, "%s", "hax_error=" );
+
+    int error = 0;
+    if ( !ret_hax_init ) {
+        if ( -ENOSPC == ret_hax_init ) {
+            error = 1;
+        }
+    }
+    hax_err_len += sprintf( hax_error + hax_err_len, "%s", error ? "true" : "false" );
+    total_len += hax_err_len;
+#endif
+
     char* info_data = g_malloc0( total_len );
     if ( !info_data ) {
         g_free( detail_info );
@@ -295,6 +316,14 @@ DetailInfo* get_detail_info( int qemu_argc, char** qemu_argv ) {
 
     }
 
+#ifdef _WIN32
+    sprintf( info_data + total_len, "%s", hax_error );
+    total_len += hax_err_len;
+#endif
+
+    INFO( "################## detail info data ####################\n" );
+    INFO( "%s\n", info_data );
+
     detail_info->data = info_data;
     detail_info->data_length = total_len;
 
index 6f2cae4..04c4ad1 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef MARUSKIN_OPERATION_H_
 #define MARUSKIN_OPERATION_H_
 
+extern int ret_hax_init;
+
 struct QemuSurfaceInfo {
     unsigned char* pixel_data;
     int pixel_data_length;
diff --git a/vl.c b/vl.c
index 17dcd5b..505d418 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -198,6 +198,8 @@ extern int tizen_base_port;
 int skin_disabled = 0;
 #endif
 
+int ret_hax_init = 0;
+
 static const char *data_dir;
 const char *bios_name = NULL;
 enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
@@ -2050,6 +2052,7 @@ static int tcg_init(void)
     if (!hax_disabled)
     {
        ret = hax_init();
+       ret_hax_init = ret;
        if (ret && (ret != -ENOSPC))
                dprint("No accelerator found.\n");
        else {