[Title]fix sdb for avoiding port miss match and add CONFIG_MARU
authormunkyu.im <munkyu.im@samsung.com>
Mon, 19 Mar 2012 03:04:26 +0000 (12:04 +0900)
committermunkyu.im <munkyu.im@samsung.com>
Mon, 19 Mar 2012 03:04:26 +0000 (12:04 +0900)
[Type]
[Module]
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

block/raw-win32.c
net/tap-win32.c
os-win32.c
qemu-char.c
tizen/src/sdb.c

index 0bbc41b..2026d64 100644 (file)
@@ -96,10 +96,12 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags)
         overlapped |= FILE_FLAG_NO_BUFFERING;
     if (!(flags & BDRV_O_CACHE_WB))
         overlapped |= FILE_FLAG_WRITE_THROUGH;
+#ifdef CONFIG_MARU
     s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename),
                           access_flags,
                           FILE_SHARE_READ, NULL,
                           OPEN_EXISTING, overlapped, NULL);
+#endif
     if (s->hfile == INVALID_HANDLE_VALUE) {
         int err = GetLastError();
 
@@ -387,10 +389,12 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
         overlapped |= FILE_FLAG_NO_BUFFERING;
     if (!(flags & BDRV_O_CACHE_WB))
         overlapped |= FILE_FLAG_WRITE_THROUGH;
+#ifdef CONFIG_MARU
     s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename),
                           access_flags,
                           FILE_SHARE_READ, NULL,
                           create_flags, overlapped, NULL);
+#endif
     if (s->hfile == INVALID_HANDLE_VALUE) {
         int err = GetLastError();
 
index b859b4c..6b50e5c 100644 (file)
@@ -591,7 +591,7 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle,
               USERMODEDEVICEDIR,
               device_guid,
               TAPSUFFIX);
-
+#ifdef CONFIG_MARU
     handle = CreateFile (
         g_win32_locale_filename_from_utf8(device_path),
         GENERIC_READ | GENERIC_WRITE,
@@ -600,7 +600,7 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle,
         OPEN_EXISTING,
         FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,
         0 );
-
+#endif
     if (handle == INVALID_HANDLE_VALUE) {
         return -1;
     }
index 444cf70..d73cfc1 100644 (file)
@@ -128,10 +128,10 @@ int qemu_create_pidfile(const char *filename)
     OVERLAPPED overlap;
     BOOL ret;
     memset(&overlap, 0, sizeof(overlap));
-
+#ifdef CONFIG_MARU
     file = CreateFile(g_win32_locale_filename_from_utf8(filename), GENERIC_WRITE, FILE_SHARE_READ, NULL,
                       OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-
+#endif
     if (file == INVALID_HANDLE_VALUE) {
         return -1;
     }
index a2f78c7..9e173e2 100644 (file)
@@ -1522,10 +1522,11 @@ static int win_chr_init(CharDriverState *chr, const char *filename)
         fprintf(stderr, "Failed CreateEvent\n");
         goto fail;
     }
-
+#ifdef CONFIG_MARU
     s->hcom = CreateFile(g_win32_locale_filename_from_utf8(filename),
                       GENERIC_READ|GENERIC_WRITE, 0, NULL,
                       OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
+#endif
     if (s->hcom == INVALID_HANDLE_VALUE) {
         fprintf(stderr, "Failed CreateFile (%lu)\n", GetLastError());
         s->hcom = NULL;
@@ -1817,9 +1818,6 @@ static int qemu_chr_open_win_file_out(QemuOpts *opts, CharDriverState **_chr)
 #ifndef CONFIG_MARU
     fd_out = CreateFile(g_win32_locale_filename_from_utf8(file_out), GENERIC_WRITE, FILE_SHARE_READ, NULL,
                         OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-#else
-    fd_out = CreateFile(g_win32_locale_filename_from_utf8(file_out), GENERIC_WRITE, FILE_SHARE_READ, NULL,
-                        CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
 #endif
     if (fd_out == INVALID_HANDLE_VALUE) {
         return -EIO;
index 9c6abe7..434c8bd 100644 (file)
@@ -226,8 +226,8 @@ static int check_port_bind_listen(u_int port)
        addr.sin_port = htons(port);
 
        if (((s = qemu_socket(AF_INET,SOCK_STREAM,0)) < 0) ||
-                       (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) ||
                        (setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)) < 0) ||
+                       (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) ||
                        (listen(s,1) < 0)) {
 
                /* fail */
@@ -308,7 +308,7 @@ void sdb_setup(void)
        }
 
        if( tizen_base_port != port ){
-               ERR( "sdb port is miss match. Aborting\n" );
+               ERR( "sdb port is miss match. Aborting port :%d, tizen_base_port: %d\n", port, tizen_base_port);
                exit(1);
        }