From: SeokYeon Hwang Date: Wed, 1 Jul 2015 08:25:43 +0000 (+0900) Subject: block: removed legacy workaround codes X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~321 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4cc3c350b3182dfdb56a4d6e9380e616885ea97c;p=sdk%2Femulator%2Fqemu.git block: removed legacy workaround codes It is no more necessary. Change-Id: I9288c93c0985cc99a127e521bdc0a607b2f21419 Signed-off-by: SeokYeon Hwang --- diff --git a/block/raw-win32.c b/block/raw-win32.c index 0a4ff6305a..c1ce7c97a0 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -31,9 +31,6 @@ #include "qemu/iov.h" #include #include -#ifdef CONFIG_MARU -#include -#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: