block: removed legacy workaround codes
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 1 Jul 2015 08:25:43 +0000 (17:25 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 6 Jul 2015 01:46:40 +0000 (10:46 +0900)
It is no more necessary.

Change-Id: I9288c93c0985cc99a127e521bdc0a607b2f21419
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
block/raw-win32.c

index 0a4ff63..c1ce7c9 100644 (file)
@@ -31,9 +31,6 @@
 #include "qemu/iov.h"
 #include <windows.h>
 #include <winioctl.h>
-#ifdef CONFIG_MARU
-#include <errno.h>
-#endif
 
 #define FTYPE_FILE 0
 #define FTYPE_CD     1
@@ -251,7 +248,6 @@ static void raw_probe_alignment(BlockDriverState *bs)
     }
 }
 
-#ifndef CONFIG_MARU
 static void raw_parse_flags(int flags, int *access_flags, DWORD *overlapped)
 {
     assert(access_flags != NULL);
@@ -271,7 +267,6 @@ static void raw_parse_flags(int flags, int *access_flags, DWORD *overlapped)
         *overlapped |= FILE_FLAG_NO_BUFFERING;
     }
 }
-#endif
 
 static void raw_parse_filename(const char *filename, QDict *options,
                                Error **errp)
@@ -305,12 +300,8 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
     Error *local_err = NULL;
     const char *filename;
     int ret;
-#ifndef CONFIG_MARU
     DWORD overlapped;
     int access_flags;
-#else
-    int open_flags;
-#endif
 
     s->type = FTYPE_FILE;
 
@@ -324,7 +315,6 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
 
     filename = qemu_opt_get(opts, "filename");
 
-#ifndef CONFIG_MARU
     raw_parse_flags(flags, &access_flags, &overlapped);
 
     if (filename[0] && filename[1] == ':') {
@@ -351,22 +341,6 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
         }
         goto fail;
     }
-#else
-    // TODO: re-test and re-coding needed
-    open_flags = O_BINARY & ~O_ACCMODE;
-    if (flags & BDRV_O_RDWR) {
-        open_flags |= O_RDWR;
-    } else {
-        open_flags |= O_RDONLY;
-    }
-
-    ret = qemu_open(filename, open_flags, 0644);
-    if (ret < 0) {
-        error_report("raw_open failed(%d) \n", ret);
-        return -errno;
-    }
-    s->hfile = (HANDLE)_get_osfhandle(ret);
-#endif
 
     if (flags & BDRV_O_NATIVE_AIO) {
         s->aio = win32_aio_init();
@@ -660,12 +634,8 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
     BDRVRawState *s = bs->opaque;
-#ifndef CONFIG_MARU
     int access_flags, create_flags;
     DWORD overlapped;
-#else
-    int open_flags;
-#endif
     int ret = 0;
     char device_name[64];
 
@@ -701,7 +671,6 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
     }
     s->type = find_device_type(bs, filename);
 
-#ifndef CONFIG_MARU
     raw_parse_flags(flags, &access_flags, &overlapped);
 
     create_flags = OPEN_EXISTING;
@@ -720,38 +689,6 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
         error_setg_errno(errp, -ret, "Could not open device");
         goto done;
     }
-#else
-       /*
-    s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename),
-                          access_flags,
-                          FILE_SHARE_READ, NULL,
-                          create_flags, overlapped, NULL);
-       */
-    open_flags = (O_BINARY & ~O_ACCMODE);
-    if (flags & BDRV_O_RDWR) {
-        open_flags |= O_RDWR;
-    } else {
-        open_flags |= O_RDONLY;
-    }
-
-    /* Use O_DSYNC for write-through caching, no flags for write-back caching,
-     * and O_DIRECT for no caching. */
-    /*
-       if ((flags & BDRV_O_NOCACHE)) {
-       open_flags |= O_DIRECT;
-       }
-       if (!(flags & BDRV_O_CACHE_WB)) {
-       open_flags |= O_DSYNC;
-       }
-     */
-
-    ret = qemu_open(filename, open_flags, 0644);
-    if (ret < 0) {
-        error_report("raw_open failed(%d) \n", ret);
-        return -errno;
-    }
-    s->hfile = (HANDLE)_get_osfhandle(ret);
-#endif
     return 0;
 
 done: