[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/29] qemu-nbd: always compile in --aio=MODE option
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 27/29] qemu-nbd: always compile in --aio=MODE option |
Date: |
Fri, 16 Oct 2015 17:06:12 +0200 |
From: Stefan Hajnoczi <address@hidden>
The --aio=MODE option enables Linux AIO or Windows overlapped I/O.
The #ifdef CONFIG_LINUX_AIO was a layering violation that also prevented
Windows overlapped I/O from being used.
Now that raw-posix.c prints an error when Linux AIO has not been
compiled in, we can unconditionally compile the option into qemu-nbd.
After this patch qemu-nbd --aio=native works on Windows.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-nbd.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 6428c15..422a607 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -98,9 +98,7 @@ static void usage(const char *name)
" '[ID_OR_NAME]'\n"
" -n, --nocache disable host cache\n"
" --cache=MODE set cache mode (none, writeback, ...)\n"
-#ifdef CONFIG_LINUX_AIO
" --aio=MODE set AIO mode (native or threads)\n"
-#endif
" --discard=MODE set discard mode (ignore, unmap)\n"
" --detect-zeroes=MODE set detect-zeroes mode (off, on, unmap)\n"
"\n"
@@ -412,9 +410,7 @@ int main(int argc, char **argv)
{ "load-snapshot", 1, NULL, 'l' },
{ "nocache", 0, NULL, 'n' },
{ "cache", 1, NULL, QEMU_NBD_OPT_CACHE },
-#ifdef CONFIG_LINUX_AIO
{ "aio", 1, NULL, QEMU_NBD_OPT_AIO },
-#endif
{ "discard", 1, NULL, QEMU_NBD_OPT_DISCARD },
{ "detect-zeroes", 1, NULL, QEMU_NBD_OPT_DETECT_ZEROES },
{ "shared", 1, NULL, 'e' },
@@ -432,9 +428,7 @@ int main(int argc, char **argv)
int fd;
bool seen_cache = false;
bool seen_discard = false;
-#ifdef CONFIG_LINUX_AIO
bool seen_aio = false;
-#endif
pthread_t client_thread;
const char *fmt = NULL;
Error *local_err = NULL;
@@ -467,7 +461,6 @@ int main(int argc, char **argv)
errx(EXIT_FAILURE, "Invalid cache mode `%s'", optarg);
}
break;
-#ifdef CONFIG_LINUX_AIO
case QEMU_NBD_OPT_AIO:
if (seen_aio) {
errx(EXIT_FAILURE, "--aio can only be specified once");
@@ -481,7 +474,6 @@ int main(int argc, char **argv)
errx(EXIT_FAILURE, "invalid aio mode `%s'", optarg);
}
break;
-#endif
case QEMU_NBD_OPT_DISCARD:
if (seen_discard) {
errx(EXIT_FAILURE, "--discard can only be specified once");
--
1.8.3.1
- [Qemu-devel] [PULL 12/29] block: Manage backing file references in bdrv_set_backing_hd(), (continued)
- [Qemu-devel] [PULL 12/29] block: Manage backing file references in bdrv_set_backing_hd(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 21/29] block: Allow bdrv_unref_child(bs, NULL), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 20/29] block: Remove bdrv_swap(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 22/29] blkverify: Fix BDS leak in .bdrv_open error path, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 19/29] block: Add and use bdrv_replace_in_backing_chain(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 23/29] util - add automated ID generation utility, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 25/29] raw-posix: warn about BDRV_O_NATIVE_AIO if libaio is unavailable, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 26/29] blockdev: always compile in -drive aio= parsing, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 09/29] block: Convert bs->file to BdrvChild, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 24/29] block: auto-generated node-names, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 27/29] qemu-nbd: always compile in --aio=MODE option,
Kevin Wolf <=
- [Qemu-devel] [PULL 28/29] qcow2: Remove forward declaration of QCowAIOCB, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 29/29] blkdebug: Don't confuse image as backing file, Kevin Wolf, 2015/10/16
- Re: [Qemu-devel] [PULL 00/29] Block layer patches, Peter Maydell, 2015/10/18