preallocate filter
PATCH v2 2/9 block/io.c: drop assertion on double waiting for request serialisation
In reply to Vladimir Sementsov-OgievskiyThe comments states, that on misaligned request we should have already been waiting. But for bdrv_padding_rmw_read, we called bdrv_mark_request_serialising with align = request_alignment, and now we serialise with align = cluster_size. So we may have to wait again with larger alignment.
Note, that the only user of BDRV_REQ_SERIALISING is backup which issues cluster-aligned requests, so seems the assertion should not fire for now. But it's wrong anyway.
---
Cc: [email protected]
block/io.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
block/io.c +1 -10
@@ -1881,7 +1881,6 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, uint64_t bytes, BdrvTrackedRequest *req, int flags) {BlockDriverState *bs = child->bs; -bool waited;int64_t end_sector =DIV_ROUND_UP (offset + bytes,BDRV_SECTOR_SIZE );if (bs->read_only) {
@@ -1893,15 +1892,7 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, uint64_t bytes,assert (!(flags & ~BDRV_REQ_MASK ));if (flags &BDRV_REQ_SERIALISING ) { - waited =bdrv_mark_request_serialising (req,bdrv_get_cluster_size (bs)); -/* -* For a misaligned request we should have already waited earlier, -* because we come after bdrv_padding_rmw_read which must be called -* with the request already marked as serialising. -*/ -assert (!waited || - (req->offset == req->overlap_offset && - req->bytes == req->overlap_bytes)); +bdrv_mark_request_serialising (req,bdrv_get_cluster_size (bs)); }else {bdrv_wait_serialising_requests (req); }
Signature · 1 line
2.21.3
PATCH v2 4/9 block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg
In reply to Vladimir Sementsov-Ogievskiybs is linked in req, so no needs to pass it separately. Most of tracked-requests API doesn't have bs argument. Actually, after this patch only tracked_request_begin has it, but it's for purpose.
While being here, also add a comment about what "_locked" is.
--- block/io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
block/io.c +5 -5
@@ -761,16 +761,16 @@ bdrv_find_conflicting_request(BdrvTrackedRequest *self)return NULL ; } +/* Called with self->bs->reqs_lock held */ static bool coroutine_fn -bdrv_wait_serialising_requests_locked (BlockDriverState *bs, -BdrvTrackedRequest *self) +bdrv_wait_serialising_requests_locked (BdrvTrackedRequest *self) {BdrvTrackedRequest *req;bool waited = false;while ((req =bdrv_find_conflicting_request (self))) { self->waiting_for = req; -qemu_co_queue_wait (&req->wait_queue, &bs->reqs_lock); +qemu_co_queue_wait (&req->wait_queue, &self->bs->reqs_lock); self->waiting_for =NULL ; waited = true; }
@@ -794,7 +794,7 @@ bool bdrv_mark_request_serialising(BdrvTrackedRequest *req, uint64_t align) req->overlap_offset =MIN (req->overlap_offset, overlap_offset); req->overlap_bytes =MAX (req->overlap_bytes, overlap_bytes); - waited =bdrv_wait_serialising_requests_locked (bs, req); + waited =bdrv_wait_serialising_requests_locked (req);qemu_co_mutex_unlock (&bs->reqs_lock);return waited; }
@@ -876,7 +876,7 @@ static bool coroutine_fn bdrv_wait_serialising_requests(BdrvTrackedRequest *self }qemu_co_mutex_lock (&bs->reqs_lock); - waited =bdrv_wait_serialising_requests_locked (bs, self); + waited =bdrv_wait_serialising_requests_locked (self);qemu_co_mutex_unlock (&bs->reqs_lock);return waited;
Signature · 1 line
2.21.3
PATCH v2 6/9 block: introduce BDRV_REQ_NO_WAIT flag
In reply to Vladimir Sementsov-OgievskiyAdd flag to make serialising request no wait: if there are conflicting requests, just return error immediately. It's will be used in upcoming preallocate filter.
--- include/block/block.h | 9 ++++++++- block/io.c | 13 ++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-)
include/block/block.h +8 -1
@@ -67,8 +67,15 @@ typedef enum {* written to qiov parameter which may be NULL. */ BDRV_REQ_PREFETCH =0x200 , + +/* +* If we need to wait for other requests, just fail immediately. Used +* only together with BDRV_REQ_SERIALISING. +*/ +BDRV_REQ_NO_WAIT =0x400 , +/* Mask of valid flags */ -BDRV_REQ_MASK =0x3ff , +BDRV_REQ_MASK =0x7ff , } BdrvRequestFlags; typedef struct BlockSizes {
block/io.c +12 -1
@@ -1911,9 +1911,20 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, uint64_t bytes,assert (!(bs->open_flags &BDRV_O_INACTIVE ));assert ((bs->open_flags &BDRV_O_NO_IO ) ==0 );assert (!(flags & ~BDRV_REQ_MASK )); +assert (!((flags &BDRV_REQ_NO_WAIT ) && !(flags &BDRV_REQ_SERIALISING )));if (flags &BDRV_REQ_SERIALISING ) { -bdrv_make_request_serialising (req,bdrv_get_cluster_size (bs)); +qemu_co_mutex_lock (&bs->reqs_lock); + +tracked_request_set_serialising (req,bdrv_get_cluster_size (bs)); + +if ((flags &BDRV_REQ_NO_WAIT ) &&bdrv_find_conflicting_request (req)) { +return -EBUSY ; + } + +bdrv_wait_serialising_requests_locked (req); + +qemu_co_mutex_unlock (&bs->reqs_lock); }else {bdrv_wait_serialising_requests (req); }
Signature · 1 line
2.21.3
PATCH v2 3/9 block/io: split out bdrv_find_conflicting_request
In reply to Vladimir Sementsov-OgievskiyTo be reused in separate.
--- block/io.c | 71 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 30 deletions(-)
block/io.c +41 -30
@@ -727,43 +727,54 @@ static bool tracked_request_overlaps(BdrvTrackedRequest *req,return true; } +/* Called with self->bs->reqs_lock held */ +static BdrvTrackedRequest * +bdrv_find_conflicting_request (BdrvTrackedRequest *self) +{ +BdrvTrackedRequest *req; + + QLIST_FOREACH(req, &self->bs->tracked_requests, list) { +if (req == self || (!req->serialising && !self->serialising)) { +continue ; + } +if (tracked_request_overlaps (req, self->overlap_offset, + self->overlap_bytes)) + { +/* +* Hitting this means there was a reentrant request, for +* example, a block driver issuing nested requests. This must +* never happen since it means deadlock. +*/ +assert (qemu_coroutine_self () != req->co); + +/* +* If the request is already (indirectly) waiting for us, or +* will wait for us as soon as it wakes up, then just go on +* (instead of producing a deadlock in the former case). +*/ +if (!req->waiting_for) { +return req; + } + } + } + +return NULL ; +} + static bool coroutine_fnbdrv_wait_serialising_requests_locked (BlockDriverState *bs,BdrvTrackedRequest *self) {BdrvTrackedRequest *req; -bool retry;bool waited = false; -do { - retry = false; - QLIST_FOREACH(req, &bs->tracked_requests, list) { -if (req == self || (!req->serialising && !self->serialising)) { -continue ; - } -if (tracked_request_overlaps (req, self->overlap_offset, - self->overlap_bytes)) - { -/* Hitting this means there was a reentrant request, for -* example, a block driver issuing nested requests. This must -* never happen since it means deadlock. -*/ -assert (qemu_coroutine_self () != req->co); - -/* If the request is already (indirectly) waiting for us, or -* will wait for us as soon as it wakes up, then just go on -* (instead of producing a deadlock in the former case). */ -if (!req->waiting_for) { - self->waiting_for = req; -qemu_co_queue_wait (&req->wait_queue, &bs->reqs_lock); - self->waiting_for =NULL ; - retry = true; - waited = true; -break ; - } - } - } - }while (retry); +while ((req =bdrv_find_conflicting_request (self))) { + self->waiting_for = req; +qemu_co_queue_wait (&req->wait_queue, &bs->reqs_lock); + self->waiting_for =NULL ; + waited = true; + } +return waited; }
Signature · 1 line
2.21.3
v2 cover preallocate filter
Hi all!
Here is a filter, which does preallocation on write.
In Virtuozzo we have to deal with some custom distributed storage solution, where allocation is relatively expensive operation. We have to workaround it in Qemu, so here is a new filter.
For the details refer to original cover-letter
"[PATCH 0/5] preallocate filter"
https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg06443.html
v2:
1-6 are new and substitutes bdrv_co_range_try_lock mechanism used in v1 07: add note to docs/system/qemu-block-drivers.rst.inc
add open options
rebase on new BDRV_REQ_NO_WAIT flag
drop bs->file check in _co_flush()
08: new
09: use new iotests.verify_o_direct()
Vladimir Sementsov-Ogievskiy (9):
block: simplify comment to BDRV_REQ_SERIALISING block/io.c: drop assertion on double waiting for request serialisation block/io: split out bdrv_find_conflicting_request block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg
block: bdrv_mark_request_serialising: split non-waiting function
block: introduce BDRV_REQ_NO_WAIT flag
block: introduce preallocate filter
iotests.py: add verify_o_direct helper
iotests: add 298 to test new preallocate filter driver
docs/system/qemu-block-drivers.rst.inc | 26 +++ qapi/block-core.json | 20 +- include/block/block.h | 20 +- include/block/block_int.h | 3 +- block/file-posix.c | 2 +- block/io.c | 131 +++++++----- block/preallocate.c | 264 +++++++++++++++++++++++++ block/Makefile.objs | 1 + tests/qemu-iotests/298 | 46 +++++ tests/qemu-iotests/298.out | 5 + tests/qemu-iotests/group | 1 + tests/qemu-iotests/iotests.py | 6 + 12 files changed, 457 insertions(+), 68 deletions(-) create mode 100644 block/preallocate.c create mode 100644 tests/qemu-iotests/298 create mode 100644 tests/qemu-iotests/298.out
Signature · 1 line
2.21.3
PATCH v2 5/9 block: bdrv_mark_request_serialising: split non-waiting function
We'll need a separate function, which will only "mark" request serialising with specified align but not wait for conflicting requests. So, it will be like old bdrv_mark_request_serialising(), before merging bdrv_wait_serialising_requests_locked() into it.
To reduce the possible mess, let's do the following:
Public function that does both marking and waiting will be called bdrv_make_request_serialising, and private function which will only "mark" will be called tracked_request_set_serialising().
--- include/block/block_int.h | 3 ++- block/file-posix.c | 2 +- block/io.c | 34 ++++++++++++++++++++++------------ 3 files changed, 25 insertions(+), 14 deletions(-)
include/block/block_int.h +2 -1
@@ -1039,7 +1039,8 @@ extern unsigned int bdrv_drain_all_count;void bdrv_apply_subtree_drain (BdrvChild *child,BlockDriverState *new_parent);void bdrv_unapply_subtree_drain (BdrvChild *child,BlockDriverState *old_parent); -bool coroutine_fn bdrv_mark_request_serialising(BdrvTrackedRequest *req, uint64_t align); +bool coroutine_fn bdrv_make_request_serialising(BdrvTrackedRequest *req, +uint64_t align); BdrvTrackedRequest *coroutine_fn bdrv_co_get_self_request(BlockDriverState *bs);int get_tmp_filename (char *filename,int size);
block/file-posix.c +1 -1
@@ -2957,7 +2957,7 @@ raw_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int bytes, req->bytes = end - req->offset; req->overlap_bytes = req->bytes; - bdrv_mark_request_serialising(req, bs->bl.request_alignment); + bdrv_make_request_serialising(req, bs->bl.request_alignment); }#endif
block/io.c +22 -12
@@ -778,15 +778,14 @@ bdrv_wait_serialising_requests_locked(BdrvTrackedRequest *self)return waited; } -bool bdrv_mark_request_serialising (BdrvTrackedRequest *req,uint64_t align) +/* Called with req->bs->reqs_lock held */ +static void tracked_request_set_serialising (BdrvTrackedRequest *req, +uint64_t align) { -BlockDriverState *bs = req->bs;int64_t overlap_offset = req->offset & ~(align -1 );uint64_t overlap_bytes =ROUND_UP (req->offset + req->bytes, align) - overlap_offset; -bool waited; -qemu_co_mutex_lock (&bs->reqs_lock);if (!req->serialising) {atomic_inc (&req->bs->serialising_in_flight); req->serialising = true;
@@ -794,9 +793,6 @@ bool bdrv_mark_request_serialising(BdrvTrackedRequest *req, uint64_t align) req->overlap_offset =MIN (req->overlap_offset, overlap_offset); req->overlap_bytes =MAX (req->overlap_bytes, overlap_bytes); - waited =bdrv_wait_serialising_requests_locked (req); -qemu_co_mutex_unlock (&bs->reqs_lock); -return waited; }/**
@@ -882,6 +878,20 @@ static bool coroutine_fn bdrv_wait_serialising_requests(BdrvTrackedRequest *selfreturn waited; } +bool bdrv_make_request_serialising (BdrvTrackedRequest *req,uint64_t align) +{ +bool waited; + +qemu_co_mutex_lock (&req->bs->reqs_lock); + +tracked_request_set_serialising (req, align); + waited =bdrv_wait_serialising_requests_locked (req); + +qemu_co_mutex_unlock (&req->bs->reqs_lock); + +return waited; +} +static int bdrv_check_byte_request (BlockDriverState *bs,int64_t offset,size_t size) {
@@ -1492,7 +1502,7 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,* with each other for the same cluster. For example, in copy-on-read * it ensures that the CoR read and write operations are atomic and * guest writes cannot interleave between them. */ -bdrv_mark_request_serialising (req,bdrv_get_cluster_size (bs)); +bdrv_make_request_serialising (req,bdrv_get_cluster_size (bs)); }else {bdrv_wait_serialising_requests (req); }
@@ -1903,7 +1913,7 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, uint64_t bytes,assert (!(flags & ~BDRV_REQ_MASK ));if (flags &BDRV_REQ_SERIALISING ) { -bdrv_mark_request_serialising (req,bdrv_get_cluster_size (bs)); +bdrv_make_request_serialising (req,bdrv_get_cluster_size (bs)); }else {bdrv_wait_serialising_requests (req); }
@@ -2069,7 +2079,7 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child, padding =bdrv_init_padding (bs, offset, bytes, &pad);if (padding) { -bdrv_mark_request_serialising (req, align); +bdrv_make_request_serialising (req, align);bdrv_padding_rmw_read (child, req, &pad, true);
@@ -2183,7 +2193,7 @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child, }if (bdrv_pad_request (bs, &qiov, &qiov_offset, &offset, &bytes, &pad)) { -bdrv_mark_request_serialising (&req, align); +bdrv_make_request_serialising (&req, align);bdrv_padding_rmw_read (child, &req, &pad, false); }
@@ -3347,7 +3357,7 @@ int coroutine_fn bdrv_co_truncate(BdrvChild *child, int64_t offset, bool exact,* new area, we need to make sure that no write requests are made to it * concurrently or they might be overwritten by preallocation. */ if (new_bytes) { -bdrv_mark_request_serialising (&req,1 ); +bdrv_make_request_serialising (&req,1 ); }if (bs->read_only) {error_setg (errp,"Image is read-only" );
Signature · 1 line
2.21.3
PATCH v2 9/9 iotests: add 298 to test new preallocate filter driver
In reply to Vladimir Sementsov-Ogievskiy--- tests/qemu-iotests/298 | 46 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/298.out | 5 +++++ tests/qemu-iotests/group | 1 + 3 files changed, 52 insertions(+) create mode 100644 tests/qemu-iotests/298 create mode 100644 tests/qemu-iotests/298.out
tests/qemu-iotests/298 new file +46 -0
@@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +# +# Test for preallocate filter +# +# Copyright (c) 2020 Virtuozzo International GmbH. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +import os +import iotests +from iotests import log + +iotests.script_initialize(supported_fmts=['qcow2']) +iotests.verify_o_direct() + +size = 10 * 1024 * 1024 +disk = iotests.file_path('disk') + +iotests.qemu_img_create('-f', iotests.imgfmt, disk, str(size)) + +opts = f'driver={iotests.imgfmt},' \ + f'file.driver=preallocate,file.file.filename={disk}' +p = iotests.QemuIoInteractive('--image-opts', '-t', 'none', opts) + +log(p.cmd('write 0 1M'), filters=[iotests.filter_qemu_io]) +p.cmd('flush') + +if os.path.getsize(disk) > 100 * 1024 * 1024: + log('file in progress is big, preallocation works') + +p.close() + +if os.path.getsize(disk) < 10 * 1024 * 1024: + log('file is small after close')
tests/qemu-iotests/298.out new file +5 -0
@@ -0,0 +1,5 @@ +wrote 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +file in progress is big, preallocation works +file is small after close
tests/qemu-iotests/group +1 -0
@@ -306,6 +306,7 @@ 295 rw 296 rw 297 meta +298 auto quick 299 auto quick 301 backing quick 302 quick
Signature · 1 line
2.21.3
PATCH v2 7/9 block: introduce preallocate filter
In reply to Vladimir Sementsov-OgievskiyIt'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.
--- docs/system/qemu-block-drivers.rst.inc | 26 +++ qapi/block-core.json | 20 +- block/preallocate.c | 264 +++++++++++++++++++++++++ block/Makefile.objs | 1 + 4 files changed, 310 insertions(+), 1 deletion(-) create mode 100644 block/preallocate.c
docs/system/qemu-block-drivers.rst.inc +26 -0
@@ -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 doesn't store any data, but do some +additional tasks, hooking io requests. + +.. program:: filter-drivers +.. option:: preallocate + + Preallocate filter driver is intended to be inserted between format + and protocol nodes and does preallocation of some additional space + (expanding the protocol file) on write. It may be used for + file-systems with slow allocation. + + Supported options: + + .. program:: preallocate + .. option:: prealloc-align + + On preallocation, align file length to this number, default 1M. + + .. program:: preallocate + .. option:: prealloc-align + + How much to preallocate, default 128M.
qapi/block-core.json +19 -1
@@ -2805,7 +2805,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' ] }
@@ -3074,6 +3074,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: 5.2 +## +{ 'struct': 'BlockdevOptionsPreallocate', + 'base': 'BlockdevOptionsGenericFormat', + 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } } + ## # @BlockdevOptionsQcow2: #
@@ -3979,6 +3996,7 @@ 'null-co': 'BlockdevOptionsNull', 'nvme': 'BlockdevOptionsNVMe', 'parallels': 'BlockdevOptionsGenericFormat', + 'preallocate':'BlockdevOptionsPreallocate', 'qcow2': 'BlockdevOptionsQcow2', 'qcow': 'BlockdevOptionsQcow', 'qed': 'BlockdevOptionsGenericCOWFormat',
block/preallocate.c new file +264 -0
264 lines not on this page · raw message
block/Makefile.objs +1 -0
@@ -44,6 +44,7 @@ block-obj-y += crypto.o block-obj-y += aio_task.o block-obj-y += backup-top.o block-obj-y += filter-compress.o +block-obj-y += preallocate.o common-obj-y += monitor/ block-obj-y += monitor/
Signature · 1 line
2.21.3
PATCH v2 1/9 block: simplify comment to BDRV_REQ_SERIALISING
In reply to Vladimir Sementsov-Ogievskiy1. BDRV_REQ_NO_SERIALISING doesn't exist already, don't mention it.
2. We are going to add one more user of BDRV_REQ_SERIALISING, so comment about backup becomes a bit confusing here. The use case in backup is documented in block/backup.c, so let's just drop duplication here.
3. The fact that BDRV_REQ_SERIALISING is only for write requests is omitted. Add a note.
--- include/block/block.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
include/block/block.h +1 -10
@@ -53,16 +53,7 @@ typedef enum {* content. */ BDRV_REQ_WRITE_UNCHANGED =0x40 , -/* -* BDRV_REQ_SERIALISING forces request serialisation for writes. -* It is used to ensure that writes to the backing file of a backup process -* target cannot race with a read of the backup target that defers to the -* backing file. -* -* Note, that BDRV_REQ_SERIALISING is _not_ opposite in meaning to -* BDRV_REQ_NO_SERIALISING. A more descriptive name for the latter might be -* _DO_NOT_WAIT_FOR_SERIALISING, except that is too long. -*/ +/* Forces request serialisation. Use only with write requests. */ BDRV_REQ_SERIALISING = 0x80,/* Execute the request only if the operation can be offloaded or otherwise
Signature · 1 line
2.21.3
PATCH v2 8/9 iotests.py: add verify_o_direct helper
In reply to Vladimir Sementsov-OgievskiyAdd python notrun-helper similar to _check_o_direct for bash tests. To be used in the following commit.
--- tests/qemu-iotests/iotests.py | 6 ++++++ 1 file changed, 6 insertions(+)
tests/qemu-iotests/iotests.py +6 -0
@@ -1083,6 +1083,12 @@ def _verify_aio_mode(supported_aio_modes: Sequence[str] = ()) -> None: if supported_aio_modes and (aiomode not in supported_aio_modes): notrun('not suitable for this aio mode: %s' % aiomode) +def verify_o_direct() -> None: + with FilePath('test_o_direct') as f: + qemu_img_create('-f', 'raw', f, '1M') + if 'O_DIRECT' in qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit', f): + notrun(f'file system at {test_dir} does not support O_DIRECT') + def supports_quorum(): return 'quorum' in qemu_img_pipe('--help')
Signature · 1 line
2.21.3
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===
CC nbd/trace.o
CC scsi/trace.o
Warning, treated as error:
../src/docs/system/qemu-block-drivers.rst.inc:980:Duplicate explicit target name: "cmdoption-preallocate-arg-prealloc-align".
CC audio/trace.o
CC chardev/trace.o
---
CC hw/ide/trace.o CC hw/input/trace.o CC hw/intc/trace.o
make: *** [Makefile:1111: .docs_system_qemu.1_docs_system_qemu-block-drivers.7_docs_system_qemu-cpu-models.7.sentinel.] Error 2
make: *** Deleting file '.docs_system_qemu.1_docs_system_qemu-block-drivers.7_docs_system_qemu-cpu-models.7.sentinel.'
make: *** Waiting for unfinished jobs....
Warning, treated as error:
../src/docs/system/qemu-block-drivers.rst.inc:980:Duplicate explicit target name: "cmdoption-preallocate-arg-prealloc-align".
make: *** [Makefile:1100: docs/system/index.html] Error 2
Traceback (most recent call last):
File "./tests/docker/docker.py", line 709, in <module>
sys.exit(main())
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=2b8332eeb0c84671bf5f795b37073245', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-msztbvd9/src/docker-src.2020-08-14-12.13.08.24140:/var/tmp/qemu:z,ro', 'qemu/fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=2b8332eeb0c84671bf5f795b37073245
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-msztbvd9/src'
make: *** [docker-run-test-mingw@fedora] Error 2
real 2m29.643s
user 0m7.966s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
TEST check-unit: tests/test-char
Unexpected error in object_property_try_add() at /tmp/qemu-test/src/qom/object.c:1181:
attempt to add duplicate property 'serial-id' to object (type 'container')
ERROR test-char - too few tests run (expected 38, got 9)
make: *** [check-unit] Error 1
make: *** Waiting for unfinished jobs....
TEST iotest-qcow2: 029
TEST check-qtest-x86_64: tests/qtest/hd-geo-test
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=933e39134d33428cb91c95a7f1ece9e6', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-u8odh47c/src/docker-src.2020-08-14-12.16.21.29250:/var/tmp/qemu:z,ro', 'qemu/centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=933e39134d33428cb91c95a7f1ece9e6
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-u8odh47c/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 13m58.743s
user 0m8.567s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
DROP Re: [PATCH v2 0/9] preallocate filter
In reply to Vladimir Sementsov-Ogievskiyv3 will come soon, don't look at this.
Quoted 49 lines · Vladimir Sementsov-Ogievskiy
Hi all!
Here is a filter, which does preallocation on write.
In Virtuozzo we have to deal with some custom distributed storage solution, where allocation is relatively expensive operation. We have to workaround it in Qemu, so here is a new filter.
For the details refer to original cover-letter
"[PATCH 0/5] preallocate filter"
https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg06443.htmlv2:
1-6 are new and substitutesbdrv_co_range_try_lockmechanism used in v1 07: add note to docs/system/qemu-block-drivers.rst.inc
add open options
rebase on newBDRV_REQ_NO_WAITflag
dropbs->filecheck in_co_flush()
08: new
09: use newiotests.verify_o_direct()Vladimir Sementsov-Ogievskiy (9):
block: simplify comment toBDRV_REQ_SERIALISINGblock/io.c: drop assertion on double waiting for request serialisation block/io: split outbdrv_find_conflicting_requestblock/io:bdrv_wait_serialising_requests_locked: drop extra bs arg
block:bdrv_mark_request_serialising: split non-waiting function
block: introduceBDRV_REQ_NO_WAITflag
block: introduce preallocate filter
iotests.py: addverify_o_directhelper
iotests: add 298 to test new preallocate filter driverdocs/system/qemu-block-drivers.rst.inc | 26 +++ qapi/block-core.json | 20 +- include/block/block.h | 20 +- include/block/block_int.h | 3 +- block/file-posix.c | 2 +- block/io.c | 131 +++++++----- block/preallocate.c | 264 +++++++++++++++++++++++++ block/Makefile.objs | 1 + tests/qemu-iotests/298 | 46 +++++ tests/qemu-iotests/298.out | 5 + tests/qemu-iotests/group | 1 + tests/qemu-iotests/iotests.py | 6 + 12 files changed, 457 insertions(+), 68 deletions(-)create mode 100644
block/preallocate.c
create mode 100644 tests/qemu-iotests/298
create mode 100644 tests/qemu-iotests/298.out
Signature · 2 lines
Best regards, Vladimir