* [Qemu-devel] [PATCH for-1.4] block/raw-posix: Make hdev_aio_discard() available outside Linux
@ 2013-01-18 15:43 Andreas Färber
2013-01-19 16:31 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Färber @ 2013-01-18 15:43 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Paolo Bonzini, Andreas Färber, Stefan Hajnoczi
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>
---
block/raw-posix.c | 26 +++++++++++++-------------
1 Datei geändert, 13 Zeilen hinzugefügt(+), 13 Zeilen entfernt(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 679fcc5..657af95 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;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.4] block/raw-posix: Make hdev_aio_discard() available outside Linux
2013-01-18 15:43 [Qemu-devel] [PATCH for-1.4] block/raw-posix: Make hdev_aio_discard() available outside Linux Andreas Färber
@ 2013-01-19 16:31 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2013-01-19 16:31 UTC (permalink / raw)
To: Andreas Färber
Cc: Kevin Wolf, Paolo Bonzini, qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 2035 bytes --]
Thanks, applied.
I must have deleted this by accident.
On Fri, Jan 18, 2013 at 3:43 PM, Andreas Färber <andreas.faerber@web.de>wrote:
> 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>
> ---
> block/raw-posix.c | 26 +++++++++++++-------------
> 1 Datei geändert, 13 Zeilen hinzugefügt(+), 13 Zeilen entfernt(-)
>
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index 679fcc5..657af95 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;
> --
> 1.7.10.4
>
>
>
[-- Attachment #2: Type: text/html, Size: 2777 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-19 16:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-18 15:43 [Qemu-devel] [PATCH for-1.4] block/raw-posix: Make hdev_aio_discard() available outside Linux Andreas Färber
2013-01-19 16:31 ` Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).