file-win32.c (c416eecea5f3aea863ab8fda5a36a24157b8f704) file-win32.c (061ca8a368165fae300748c17971824a089f521f)
1/*
2 * Block driver for RAW files (win32)
3 *
4 * Copyright (c) 2006 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 453 unchanged lines hidden (view full) ---

462 }
463
464 CloseHandle(s->hfile);
465 if (bs->open_flags & BDRV_O_TEMPORARY) {
466 unlink(bs->filename);
467 }
468}
469
1/*
2 * Block driver for RAW files (win32)
3 *
4 * Copyright (c) 2006 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 453 unchanged lines hidden (view full) ---

462 }
463
464 CloseHandle(s->hfile);
465 if (bs->open_flags & BDRV_O_TEMPORARY) {
466 unlink(bs->filename);
467 }
468}
469
470static int raw_truncate(BlockDriverState *bs, int64_t offset,
471 PreallocMode prealloc, Error **errp)
470static int coroutine_fn raw_co_truncate(BlockDriverState *bs, int64_t offset,
471 PreallocMode prealloc, Error **errp)
472{
473 BDRVRawState *s = bs->opaque;
474 LONG low, high;
475 DWORD dwPtrLow;
476
477 if (prealloc != PREALLOC_MODE_OFF) {
478 error_setg(errp, "Unsupported preallocation mode '%s'",
479 PreallocMode_str(prealloc));

--- 155 unchanged lines hidden (view full) ---

635 .bdrv_close = raw_close,
636 .bdrv_co_create_opts = raw_co_create_opts,
637 .bdrv_has_zero_init = bdrv_has_zero_init_1,
638
639 .bdrv_aio_preadv = raw_aio_preadv,
640 .bdrv_aio_pwritev = raw_aio_pwritev,
641 .bdrv_aio_flush = raw_aio_flush,
642
472{
473 BDRVRawState *s = bs->opaque;
474 LONG low, high;
475 DWORD dwPtrLow;
476
477 if (prealloc != PREALLOC_MODE_OFF) {
478 error_setg(errp, "Unsupported preallocation mode '%s'",
479 PreallocMode_str(prealloc));

--- 155 unchanged lines hidden (view full) ---

635 .bdrv_close = raw_close,
636 .bdrv_co_create_opts = raw_co_create_opts,
637 .bdrv_has_zero_init = bdrv_has_zero_init_1,
638
639 .bdrv_aio_preadv = raw_aio_preadv,
640 .bdrv_aio_pwritev = raw_aio_pwritev,
641 .bdrv_aio_flush = raw_aio_flush,
642
643 .bdrv_truncate = raw_truncate,
643 .bdrv_co_truncate = raw_co_truncate,
644 .bdrv_getlength = raw_getlength,
645 .bdrv_get_allocated_file_size
646 = raw_get_allocated_file_size,
647
648 .create_opts = &raw_create_opts,
649};
650
651/***********************************************/

--- 177 unchanged lines hidden ---
644 .bdrv_getlength = raw_getlength,
645 .bdrv_get_allocated_file_size
646 = raw_get_allocated_file_size,
647
648 .create_opts = &raw_create_opts,
649};
650
651/***********************************************/

--- 177 unchanged lines hidden ---