iothread: fix breakage on windows
PATCH 1/1 iothread: fix breakage on windows
OOB can enable iothread for parsing even on Windows. We need some tunes to enable that on Windows otherwise it'll break Windows users. This patch fixes the breakage on Windows with qemu-system-ppc.exe.
Reported-by Howard Spoelstra <[email protected]>
Tested-by Howard Spoelstra <[email protected]>
Suggested-by Paolo Bonzini <[email protected]>
Signed-off-by Peter Xu <[email protected]>
--- iothread.c | 4 ++++ util/aio-win32.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-)
iothread.c +4 -0
@@ -31,11 +31,15 @@ typedef ObjectClass IOThreadClass;#define IOTHREAD_CLASS (klass) \ OBJECT_CLASS_CHECK(IOThreadClass, klass, TYPE_IOTHREAD) +#ifdef CONFIG_LINUX /* Benchmark results from 2016 on NVMe SSD drives show max polling times around * 16-32 microseconds yield IOPS improvements for both iodepth=1 and iodepth=32 * workloads. */ #define IOTHREAD_POLL_MAX_NS_DEFAULT 32768ULL +#else +#define IOTHREAD_POLL_MAX_NS_DEFAULT 0ULL +#endif static __threadIOThread *my_iothread;
util/aio-win32.c +3 -1
@@ -410,5 +410,7 @@ void aio_context_setup(AioContext *ctx)void aio_context_set_poll_params (AioContext *ctx,int64_t max_ns,int64_t grow,int64_t shrink,Error **errp) { -error_setg (errp,"AioContext polling is not implemented on Windows" ); +if (max_ns) { +error_setg (errp,"AioContext polling is not implemented on Windows" ); + } }
Signature · 1 line
2.14.3
Paolo Bonzini
AppliedQuoted 39 lines · Peter Xu
OOB can enable iothread for parsing even on Windows. We need some tunes to enable that on Windows otherwise it'll break Windows users. This patch fixes the breakage on Windows with qemu-system-ppc.exe.
Reported-by Howard Spoelstra <[email protected]>Tested-by Howard Spoelstra <[email protected]>Suggested-by Paolo Bonzini <[email protected]>Signed-off-by Peter Xu <[email protected]>--- iothread.c | 4 ++++ util/aio-win32.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-)iothread.c +4
-0@@ -31,11 +31,15 @@ typedef ObjectClass IOThreadClass;#define IOTHREAD_CLASS (klass) \ OBJECT_CLASS_CHECK(IOThreadClass, klass, TYPE_IOTHREAD) +#ifdef CONFIG_LINUX /* Benchmark results from 2016 on NVMe SSD drives show max polling times around * 16-32 microseconds yield IOPS improvements for both iodepth=1 and iodepth=32 * workloads. */ #define IOTHREAD_POLL_MAX_NS_DEFAULT 32768ULL +#else +#define IOTHREAD_POLL_MAX_NS_DEFAULT 0ULL +#endif static __threadIOThread *my_iothread;util/aio-win32.c +0
-0
util/aio-win32.c void aio_context_setup(AioContext *ctx) · line 416
Quoted 8 lines
util/aio-win32.c +3
-1@@ -410,5 +410,7 @@ void aio_context_setup(AioContext *ctx)void aio_context_set_poll_params (AioContext *ctx,int64_t max_ns,int64_t grow,int64_t shrink,Error **errp) { -error_setg (errp,"AioContext polling is not implemented on Windows" ); +if (max_ns) { +error_setg (errp,"AioContext polling is not implemented on Windows" ); + } }
Queued, thanks.
Paolo