summaryrefslogtreecommitdiff
path: root/block-raw.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-07 17:27:07 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-07 17:27:07 +0000
commit3b9f94e1a8757ac223a51c662e4278aab738f0cd (patch)
treeff0f0a0413be1247b17313316206288e45b6921b /block-raw.c
parentf5e25d7007544415dbfd3fdf0778604c9b7c68b7 (diff)
downloadqemu-3b9f94e1a8757ac223a51c662e4278aab738f0cd.tar.gz
win32 block device fixes (initial patch by kazu)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2305 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-raw.c')
-rw-r--r--block-raw.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/block-raw.c b/block-raw.c
index 9fe953c303..1401e82150 100644
--- a/block-raw.c
+++ b/block-raw.c
@@ -906,13 +906,13 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags)
create_flags = OPEN_EXISTING;
}
#ifdef QEMU_TOOL
- overlapped = 0;
+ overlapped = FILE_ATTRIBUTE_NORMAL;
#else
overlapped = FILE_FLAG_OVERLAPPED;
#endif
s->hfile = CreateFile(filename, access_flags,
FILE_SHARE_READ, NULL,
- create_flags, overlapped, 0);
+ create_flags, overlapped, NULL);
if (s->hfile == INVALID_HANDLE_VALUE)
return -1;
return 0;
@@ -962,6 +962,7 @@ static int raw_pwrite(BlockDriverState *bs, int64_t offset,
return ret_count;
}
+#if 0
#ifndef QEMU_TOOL
static void raw_aio_cb(void *opaque)
{
@@ -1064,10 +1065,12 @@ static void raw_aio_cancel(BlockDriverAIOCB *blockacb)
qemu_aio_release(acb);
#endif
}
+#endif /* #if 0 */
static void raw_flush(BlockDriverState *bs)
{
- /* XXX: add it */
+ BDRVRawState *s = bs->opaque;
+ FlushFileBuffers(s->hfile);
}
static void raw_close(BlockDriverState *bs)
@@ -1143,6 +1146,10 @@ void qemu_aio_flush(void)
{
}
+void qemu_aio_flush(void)
+{
+}
+
void qemu_aio_wait_start(void)
{
}
@@ -1254,13 +1261,13 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
create_flags = OPEN_EXISTING;
#ifdef QEMU_TOOL
- overlapped = 0;
+ overlapped = FILE_ATTRIBUTE_NORMAL;
#else
overlapped = FILE_FLAG_OVERLAPPED;
#endif
s->hfile = CreateFile(filename, access_flags,
FILE_SHARE_READ, NULL,
- create_flags, overlapped, 0);
+ create_flags, overlapped, NULL);
if (s->hfile == INVALID_HANDLE_VALUE)
return -1;
return 0;