mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
block: introduce preallocate filter
It's intended to be inserted between format and protocol nodes to preallocate additional space (expanding protocol file) on writes crossing EOF. It improves performance for file-systems with slow allocation. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20201021145859.11201-9-vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> [mreitz: Two comment fixes, and bumped the version from 5.2 to 6.0] Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
committed by
Max Reitz
parent
9530a25b8b
commit
33fa2222eb
@@ -12,6 +12,7 @@ block_ss.add(files(
|
||||
'block-copy.c',
|
||||
'commit.c',
|
||||
'copy-on-read.c',
|
||||
'preallocate.c',
|
||||
'create.c',
|
||||
'crypto.c',
|
||||
'dirty-bitmap.c',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -952,3 +952,29 @@ on host and see if there are locks held by the QEMU process on the image file.
|
||||
More than one byte could be locked by the QEMU instance, each byte of which
|
||||
reflects a particular permission that is acquired or protected by the running
|
||||
block driver.
|
||||
|
||||
Filter drivers
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
QEMU supports several filter drivers, which don't store any data, but perform
|
||||
some additional tasks, hooking io requests.
|
||||
|
||||
.. program:: filter-drivers
|
||||
.. option:: preallocate
|
||||
|
||||
The preallocate filter driver is intended to be inserted between format
|
||||
and protocol nodes and preallocates some additional space
|
||||
(expanding the protocol file) when writing past the file’s end. This can be
|
||||
useful for file-systems with slow allocation.
|
||||
|
||||
Supported options:
|
||||
|
||||
.. program:: preallocate
|
||||
.. option:: prealloc-align
|
||||
|
||||
On preallocation, align the file length to this value (in bytes), default 1M.
|
||||
|
||||
.. program:: preallocate
|
||||
.. option:: prealloc-size
|
||||
|
||||
How much to preallocate (in bytes), default 128M.
|
||||
|
||||
+19
-1
@@ -2829,7 +2829,7 @@
|
||||
'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps',
|
||||
'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscsi',
|
||||
'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
|
||||
'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
|
||||
'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
|
||||
{ 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
|
||||
'sheepdog',
|
||||
'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
|
||||
@@ -3098,6 +3098,23 @@
|
||||
'data': { 'aes': 'QCryptoBlockOptionsQCow',
|
||||
'luks': 'QCryptoBlockOptionsLUKS'} }
|
||||
|
||||
##
|
||||
# @BlockdevOptionsPreallocate:
|
||||
#
|
||||
# Filter driver intended to be inserted between format and protocol node
|
||||
# and do preallocation in protocol node on write.
|
||||
#
|
||||
# @prealloc-align: on preallocation, align file length to this number,
|
||||
# default 1048576 (1M)
|
||||
#
|
||||
# @prealloc-size: how much to preallocate, default 134217728 (128M)
|
||||
#
|
||||
# Since: 6.0
|
||||
##
|
||||
{ 'struct': 'BlockdevOptionsPreallocate',
|
||||
'base': 'BlockdevOptionsGenericFormat',
|
||||
'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
|
||||
|
||||
##
|
||||
# @BlockdevOptionsQcow2:
|
||||
#
|
||||
@@ -4006,6 +4023,7 @@
|
||||
'null-co': 'BlockdevOptionsNull',
|
||||
'nvme': 'BlockdevOptionsNVMe',
|
||||
'parallels': 'BlockdevOptionsGenericFormat',
|
||||
'preallocate':'BlockdevOptionsPreallocate',
|
||||
'qcow2': 'BlockdevOptionsQcow2',
|
||||
'qcow': 'BlockdevOptionsQcow',
|
||||
'qed': 'BlockdevOptionsGenericCOWFormat',
|
||||
|
||||
Reference in New Issue
Block a user