summaryrefslogtreecommitdiff
path: root/include/block/raw-aio.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-06-21 18:23:16 +0200
committerKevin Wolf <kwolf@redhat.com>2018-06-29 14:20:56 +0200
commit93f4e2ff4b31205d8bab0856631a52ed442b8b1c (patch)
treef90cae89c305d90c47e734ea947da3d0ddb7a795 /include/block/raw-aio.h
parent1bc5f09f2e1b2be8f6f737b8d5352b438fc41492 (diff)
downloadqemu-93f4e2ff4b31205d8bab0856631a52ed442b8b1c.zip
file-posix: Make .bdrv_co_truncate asynchronous
This moves the code to resize an image file to the thread pool to avoid blocking. Creating large images with preallocation with blockdev-create is now actually a background job instead of blocking the monitor (and most other things) until the preallocation has completed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/block/raw-aio.h')
-rw-r--r--include/block/raw-aio.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/block/raw-aio.h b/include/block/raw-aio.h
index 8d698ccd31..6799614e56 100644
--- a/include/block/raw-aio.h
+++ b/include/block/raw-aio.h
@@ -26,6 +26,7 @@
#define QEMU_AIO_DISCARD 0x0010
#define QEMU_AIO_WRITE_ZEROES 0x0020
#define QEMU_AIO_COPY_RANGE 0x0040
+#define QEMU_AIO_TRUNCATE 0x0080
#define QEMU_AIO_TYPE_MASK \
(QEMU_AIO_READ | \
QEMU_AIO_WRITE | \
@@ -33,7 +34,8 @@
QEMU_AIO_FLUSH | \
QEMU_AIO_DISCARD | \
QEMU_AIO_WRITE_ZEROES | \
- QEMU_AIO_COPY_RANGE)
+ QEMU_AIO_COPY_RANGE | \
+ QEMU_AIO_TRUNCATE)
/* AIO flags */
#define QEMU_AIO_MISALIGNED 0x1000