aboutsummaryrefslogtreecommitdiff
path: root/block/raw-posix.c
diff options
context:
space:
mode:
authorAndreas Färber <andreas.faerber@web.de>2013-01-18 16:43:35 +0100
committerBlue Swirl <blauwirbel@gmail.com>2013-01-19 14:35:02 +0000
commitc36dd8a09fd8811ebcda453d80dc5f52402d691c (patch)
tree2f46bd289e4ada4b70abf73e85de6f1dff360063 /block/raw-posix.c
parentc1db29199e3caf5cd56daad08b8926ffa97da136 (diff)
block/raw-posix: Make hdev_aio_discard() available outside Linux
Fixes the build on OpenBSD among others. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'block/raw-posix.c')
-rw-r--r--block/raw-posix.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 679fcc5113..657af95637 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1371,19 +1371,6 @@ static BlockDriverAIOCB *hdev_aio_ioctl(BlockDriverState *bs,
return thread_pool_submit_aio(aio_worker, acb, cb, opaque);
}
-static coroutine_fn BlockDriverAIOCB *hdev_aio_discard(BlockDriverState *bs,
- int64_t sector_num, int nb_sectors,
- BlockDriverCompletionFunc *cb, void *opaque)
-{
- BDRVRawState *s = bs->opaque;
-
- if (fd_open(bs) < 0) {
- return NULL;
- }
- return paio_submit(bs, s->fd, sector_num, NULL, nb_sectors,
- cb, opaque, QEMU_AIO_DISCARD|QEMU_AIO_BLKDEV);
-}
-
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
static int fd_open(BlockDriverState *bs)
{
@@ -1403,6 +1390,19 @@ static int fd_open(BlockDriverState *bs)
#endif /* !linux && !FreeBSD */
+static coroutine_fn BlockDriverAIOCB *hdev_aio_discard(BlockDriverState *bs,
+ int64_t sector_num, int nb_sectors,
+ BlockDriverCompletionFunc *cb, void *opaque)
+{
+ BDRVRawState *s = bs->opaque;
+
+ if (fd_open(bs) < 0) {
+ return NULL;
+ }
+ return paio_submit(bs, s->fd, sector_num, NULL, nb_sectors,
+ cb, opaque, QEMU_AIO_DISCARD|QEMU_AIO_BLKDEV);
+}
+
static int hdev_create(const char *filename, QEMUOptionParameter *options)
{
int fd;