1 | The following changes since commit dd25f97c66a75d1508f1d4c6478ed2c95bec428f: | 1 | The following changes since commit 711c0418c8c1ce3a24346f058b001c4c5a2f0f81: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190913' into staging (2019-09-16 10:15:15 +0100) | 3 | Merge remote-tracking branch 'remotes/philmd/tags/mips-20210702' into staging (2021-07-04 14:04:12 +0100) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | https://github.com/XanClic/qemu.git tags/pull-block-2019-09-16 | 7 | https://gitlab.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to 1825cc0783ccf0ec5d9f0b225a99b340bdd4c68f: | 9 | for you to fetch changes up to 9f460c64e13897117f35ffb61f6f5e0102cabc70: |
10 | 10 | ||
11 | qemu-iotests: Add test for bz #1745922 (2019-09-16 15:37:12 +0200) | 11 | block/io: Merge discard request alignments (2021-07-06 14:28:55 +0100) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Block patches: | 14 | Pull request |
15 | - Fix for block jobs when used with I/O threads | ||
16 | - Fix for a corruption when using qcow2's LUKS encryption mode | ||
17 | - cURL fix | ||
18 | - check-block.sh cleanups (for make check) | ||
19 | - Refactoring | ||
20 | 15 | ||
21 | ---------------------------------------------------------------- | 16 | ---------------------------------------------------------------- |
22 | Max Reitz (7): | ||
23 | curl: Keep pointer to the CURLState in CURLSocket | ||
24 | curl: Keep *socket until the end of curl_sock_cb() | ||
25 | curl: Check completion in curl_multi_do() | ||
26 | curl: Pass CURLSocket to curl_multi_do() | ||
27 | curl: Report only ready sockets | ||
28 | curl: Handle success in multi_check_completion | ||
29 | curl: Check curl_multi_add_handle()'s return code | ||
30 | 17 | ||
31 | Maxim Levitsky (3): | 18 | Akihiko Odaki (3): |
32 | block/qcow2: Fix corruption introduced by commit 8ac0f15f335 | 19 | block/file-posix: Optimize for macOS |
33 | block/qcow2: refactor encryption code | 20 | block: Add backend_defaults property |
34 | qemu-iotests: Add test for bz #1745922 | 21 | block/io: Merge discard request alignments |
35 | 22 | ||
36 | Nir Soffer (2): | 23 | Stefan Hajnoczi (2): |
37 | block: Use QEMU_IS_ALIGNED | 24 | util/async: add a human-readable name to BHs for debugging |
38 | block: Remove unused masks | 25 | util/async: print leaked BH name when AioContext finalizes |
39 | 26 | ||
40 | Sergio Lopez (1): | 27 | include/block/aio.h | 31 ++++++++++++++++++++++--- |
41 | blockjob: update nodes head while removing all bdrv | 28 | include/hw/block/block.h | 3 +++ |
42 | 29 | include/qemu/main-loop.h | 4 +++- | |
43 | Thomas Huth (2): | 30 | block/file-posix.c | 27 ++++++++++++++++++++-- |
44 | tests/qemu-iotests/check: Replace "tests" with "iotests" in final | 31 | block/io.c | 2 ++ |
45 | status text | 32 | hw/block/block.c | 42 ++++++++++++++++++++++++++++++---- |
46 | tests/Makefile: Do not print the name of the check-block.sh shell | 33 | tests/unit/ptimer-test-stubs.c | 2 +- |
47 | script | 34 | util/async.c | 25 ++++++++++++++++---- |
48 | 35 | util/main-loop.c | 4 ++-- | |
49 | Vladimir Sementsov-Ogievskiy (1): | 36 | tests/qemu-iotests/172.out | 38 ++++++++++++++++++++++++++++++ |
50 | tests/qemu-iotests: Fix qemu-io related output in 026.out.nocache | 37 | 10 files changed, 161 insertions(+), 17 deletions(-) |
51 | |||
52 | tests/Makefile.include | 2 +- | ||
53 | block/qcow2.h | 8 +- | ||
54 | include/block/block.h | 2 - | ||
55 | block/bochs.c | 4 +- | ||
56 | block/cloop.c | 4 +- | ||
57 | block/curl.c | 133 ++++++++++------------- | ||
58 | block/dmg.c | 4 +- | ||
59 | block/io.c | 8 +- | ||
60 | block/qcow2-cluster.c | 40 +++---- | ||
61 | block/qcow2-threads.c | 63 ++++++++--- | ||
62 | block/qcow2.c | 9 +- | ||
63 | block/vvfat.c | 8 +- | ||
64 | blockjob.c | 17 ++- | ||
65 | migration/block.c | 2 +- | ||
66 | qemu-img.c | 2 +- | ||
67 | tests/qemu-iotests/026.out.nocache | 168 ++++++++++++++--------------- | ||
68 | tests/qemu-iotests/263 | 91 ++++++++++++++++ | ||
69 | tests/qemu-iotests/263.out | 40 +++++++ | ||
70 | tests/qemu-iotests/check | 8 +- | ||
71 | tests/qemu-iotests/group | 1 + | ||
72 | 20 files changed, 380 insertions(+), 234 deletions(-) | ||
73 | create mode 100755 tests/qemu-iotests/263 | ||
74 | create mode 100644 tests/qemu-iotests/263.out | ||
75 | 38 | ||
76 | -- | 39 | -- |
77 | 2.21.0 | 40 | 2.31.1 |
78 | 41 | ||
79 | diff view generated by jsdifflib |
1 | curl_multi_do_locked() currently marks all sockets as ready. That is | 1 | It can be difficult to debug issues with BHs in production environments. |
---|---|---|---|
2 | not only inefficient, but in fact unsafe (the loop is). A follow-up | 2 | Although BHs can usually be identified by looking up their ->cb() |
3 | patch will change that, but to do so, curl_multi_do_locked() needs to | 3 | function pointer, this requires debug information for the program. It is |
4 | know exactly which socket is ready; and that is accomplished by this | 4 | also not possible to print human-readable diagnostics about BHs because |
5 | patch here. | 5 | they have no identifier. |
6 | 6 | ||
7 | Cc: qemu-stable@nongnu.org | 7 | This patch adds a name to each BH. The name is not unique per instance |
8 | Signed-off-by: Max Reitz <mreitz@redhat.com> | 8 | but differentiates between cb() functions, which is usually enough. It's |
9 | Message-id: 20190910124136.10565-5-mreitz@redhat.com | 9 | done by changing aio_bh_new() and friends to macros that stringify cb. |
10 | Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> | 10 | |
11 | Reviewed-by: John Snow <jsnow@redhat.com> | 11 | The next patch will use the name field when reporting leaked BHs. |
12 | Signed-off-by: Max Reitz <mreitz@redhat.com> | 12 | |
13 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
14 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Message-Id: <20210414200247.917496-2-stefanha@redhat.com> | ||
13 | --- | 16 | --- |
14 | block/curl.c | 20 +++++++++++--------- | 17 | include/block/aio.h | 31 ++++++++++++++++++++++++++++--- |
15 | 1 file changed, 11 insertions(+), 9 deletions(-) | 18 | include/qemu/main-loop.h | 4 +++- |
19 | tests/unit/ptimer-test-stubs.c | 2 +- | ||
20 | util/async.c | 9 +++++++-- | ||
21 | util/main-loop.c | 4 ++-- | ||
22 | 5 files changed, 41 insertions(+), 9 deletions(-) | ||
16 | 23 | ||
17 | diff --git a/block/curl.c b/block/curl.c | 24 | diff --git a/include/block/aio.h b/include/block/aio.h |
18 | index XXXXXXX..XXXXXXX 100644 | 25 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/block/curl.c | 26 | --- a/include/block/aio.h |
20 | +++ b/block/curl.c | 27 | +++ b/include/block/aio.h |
21 | @@ -XXX,XX +XXX,XX @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, | 28 | @@ -XXX,XX +XXX,XX @@ void aio_context_acquire(AioContext *ctx); |
22 | switch (action) { | 29 | /* Relinquish ownership of the AioContext. */ |
23 | case CURL_POLL_IN: | 30 | void aio_context_release(AioContext *ctx); |
24 | aio_set_fd_handler(s->aio_context, fd, false, | 31 | |
25 | - curl_multi_do, NULL, NULL, state); | 32 | +/** |
26 | + curl_multi_do, NULL, NULL, socket); | 33 | + * aio_bh_schedule_oneshot_full: Allocate a new bottom half structure that will |
27 | break; | 34 | + * run only once and as soon as possible. |
28 | case CURL_POLL_OUT: | 35 | + * |
29 | aio_set_fd_handler(s->aio_context, fd, false, | 36 | + * @name: A human-readable identifier for debugging purposes. |
30 | - NULL, curl_multi_do, NULL, state); | 37 | + */ |
31 | + NULL, curl_multi_do, NULL, socket); | 38 | +void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, |
32 | break; | 39 | + const char *name); |
33 | case CURL_POLL_INOUT: | 40 | + |
34 | aio_set_fd_handler(s->aio_context, fd, false, | 41 | /** |
35 | - curl_multi_do, curl_multi_do, NULL, state); | 42 | * aio_bh_schedule_oneshot: Allocate a new bottom half structure that will run |
36 | + curl_multi_do, curl_multi_do, NULL, socket); | 43 | * only once and as soon as possible. |
37 | break; | 44 | + * |
38 | case CURL_POLL_REMOVE: | 45 | + * A convenience wrapper for aio_bh_schedule_oneshot_full() that uses cb as the |
39 | aio_set_fd_handler(s->aio_context, fd, false, | 46 | + * name string. |
40 | @@ -XXX,XX +XXX,XX @@ static void curl_multi_check_completion(BDRVCURLState *s) | 47 | */ |
48 | -void aio_bh_schedule_oneshot(AioContext *ctx, QEMUBHFunc *cb, void *opaque); | ||
49 | +#define aio_bh_schedule_oneshot(ctx, cb, opaque) \ | ||
50 | + aio_bh_schedule_oneshot_full((ctx), (cb), (opaque), (stringify(cb))) | ||
51 | |||
52 | /** | ||
53 | - * aio_bh_new: Allocate a new bottom half structure. | ||
54 | + * aio_bh_new_full: Allocate a new bottom half structure. | ||
55 | * | ||
56 | * Bottom halves are lightweight callbacks whose invocation is guaranteed | ||
57 | * to be wait-free, thread-safe and signal-safe. The #QEMUBH structure | ||
58 | * is opaque and must be allocated prior to its use. | ||
59 | + * | ||
60 | + * @name: A human-readable identifier for debugging purposes. | ||
61 | */ | ||
62 | -QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque); | ||
63 | +QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, | ||
64 | + const char *name); | ||
65 | + | ||
66 | +/** | ||
67 | + * aio_bh_new: Allocate a new bottom half structure | ||
68 | + * | ||
69 | + * A convenience wrapper for aio_bh_new_full() that uses the cb as the name | ||
70 | + * string. | ||
71 | + */ | ||
72 | +#define aio_bh_new(ctx, cb, opaque) \ | ||
73 | + aio_bh_new_full((ctx), (cb), (opaque), (stringify(cb))) | ||
74 | |||
75 | /** | ||
76 | * aio_notify: Force processing of pending events. | ||
77 | diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h | ||
78 | index XXXXXXX..XXXXXXX 100644 | ||
79 | --- a/include/qemu/main-loop.h | ||
80 | +++ b/include/qemu/main-loop.h | ||
81 | @@ -XXX,XX +XXX,XX @@ void qemu_cond_timedwait_iothread(QemuCond *cond, int ms); | ||
82 | |||
83 | void qemu_fd_register(int fd); | ||
84 | |||
85 | -QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque); | ||
86 | +#define qemu_bh_new(cb, opaque) \ | ||
87 | + qemu_bh_new_full((cb), (opaque), (stringify(cb))) | ||
88 | +QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name); | ||
89 | void qemu_bh_schedule_idle(QEMUBH *bh); | ||
90 | |||
91 | enum { | ||
92 | diff --git a/tests/unit/ptimer-test-stubs.c b/tests/unit/ptimer-test-stubs.c | ||
93 | index XXXXXXX..XXXXXXX 100644 | ||
94 | --- a/tests/unit/ptimer-test-stubs.c | ||
95 | +++ b/tests/unit/ptimer-test-stubs.c | ||
96 | @@ -XXX,XX +XXX,XX @@ int64_t qemu_clock_deadline_ns_all(QEMUClockType type, int attr_mask) | ||
97 | return deadline; | ||
41 | } | 98 | } |
42 | 99 | ||
43 | /* Called with s->mutex held. */ | 100 | -QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque) |
44 | -static void curl_multi_do_locked(CURLState *s) | 101 | +QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name) |
45 | +static void curl_multi_do_locked(CURLSocket *ready_socket) | ||
46 | { | 102 | { |
47 | CURLSocket *socket, *next_socket; | 103 | QEMUBH *bh = g_new(QEMUBH, 1); |
48 | + CURLState *s = ready_socket->state; | 104 | |
49 | int running; | 105 | diff --git a/util/async.c b/util/async.c |
50 | int r; | 106 | index XXXXXXX..XXXXXXX 100644 |
51 | 107 | --- a/util/async.c | |
52 | @@ -XXX,XX +XXX,XX @@ static void curl_multi_do_locked(CURLState *s) | 108 | +++ b/util/async.c |
53 | 109 | @@ -XXX,XX +XXX,XX @@ enum { | |
54 | static void curl_multi_do(void *arg) | 110 | |
111 | struct QEMUBH { | ||
112 | AioContext *ctx; | ||
113 | + const char *name; | ||
114 | QEMUBHFunc *cb; | ||
115 | void *opaque; | ||
116 | QSLIST_ENTRY(QEMUBH) next; | ||
117 | @@ -XXX,XX +XXX,XX @@ static QEMUBH *aio_bh_dequeue(BHList *head, unsigned *flags) | ||
118 | return bh; | ||
119 | } | ||
120 | |||
121 | -void aio_bh_schedule_oneshot(AioContext *ctx, QEMUBHFunc *cb, void *opaque) | ||
122 | +void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb, | ||
123 | + void *opaque, const char *name) | ||
55 | { | 124 | { |
56 | - CURLState *s = (CURLState *)arg; | 125 | QEMUBH *bh; |
57 | + CURLSocket *socket = arg; | 126 | bh = g_new(QEMUBH, 1); |
58 | + BDRVCURLState *s = socket->state->s; | 127 | @@ -XXX,XX +XXX,XX @@ void aio_bh_schedule_oneshot(AioContext *ctx, QEMUBHFunc *cb, void *opaque) |
59 | 128 | .ctx = ctx, | |
60 | - qemu_mutex_lock(&s->s->mutex); | 129 | .cb = cb, |
61 | - curl_multi_do_locked(s); | 130 | .opaque = opaque, |
62 | - curl_multi_check_completion(s->s); | 131 | + .name = name, |
63 | - qemu_mutex_unlock(&s->s->mutex); | 132 | }; |
64 | + qemu_mutex_lock(&s->mutex); | 133 | aio_bh_enqueue(bh, BH_SCHEDULED | BH_ONESHOT); |
65 | + curl_multi_do_locked(socket); | ||
66 | + curl_multi_check_completion(s); | ||
67 | + qemu_mutex_unlock(&s->mutex); | ||
68 | } | 134 | } |
69 | 135 | ||
70 | static void curl_multi_timeout_do(void *arg) | 136 | -QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque) |
137 | +QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, | ||
138 | + const char *name) | ||
139 | { | ||
140 | QEMUBH *bh; | ||
141 | bh = g_new(QEMUBH, 1); | ||
142 | @@ -XXX,XX +XXX,XX @@ QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque) | ||
143 | .ctx = ctx, | ||
144 | .cb = cb, | ||
145 | .opaque = opaque, | ||
146 | + .name = name, | ||
147 | }; | ||
148 | return bh; | ||
149 | } | ||
150 | diff --git a/util/main-loop.c b/util/main-loop.c | ||
151 | index XXXXXXX..XXXXXXX 100644 | ||
152 | --- a/util/main-loop.c | ||
153 | +++ b/util/main-loop.c | ||
154 | @@ -XXX,XX +XXX,XX @@ void main_loop_wait(int nonblocking) | ||
155 | |||
156 | /* Functions to operate on the main QEMU AioContext. */ | ||
157 | |||
158 | -QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque) | ||
159 | +QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name) | ||
160 | { | ||
161 | - return aio_bh_new(qemu_aio_context, cb, opaque); | ||
162 | + return aio_bh_new_full(qemu_aio_context, cb, opaque, name); | ||
163 | } | ||
164 | |||
165 | /* | ||
71 | -- | 166 | -- |
72 | 2.21.0 | 167 | 2.31.1 |
73 | 168 | ||
74 | diff view generated by jsdifflib |
1 | From: Maxim Levitsky <mlevitsk@redhat.com> | 1 | BHs must be deleted before the AioContext is finalized. If not, it's a |
---|---|---|---|
2 | bug and probably indicates that some part of the program still expects | ||
3 | the BH to run in the future. That can lead to memory leaks, inconsistent | ||
4 | state, or just hangs. | ||
2 | 5 | ||
3 | This fixes subtle corruption introduced by luks threaded encryption | 6 | Unfortunately the assert(flags & BH_DELETED) call in aio_ctx_finalize() |
4 | in commit 8ac0f15f335 | 7 | is difficult to debug because the assertion failure contains no |
8 | information about the BH! | ||
5 | 9 | ||
6 | Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1745922 | 10 | Use the QEMUBH name field added in the previous patch to show a useful |
11 | error when a leaked BH is detected. | ||
7 | 12 | ||
8 | The corruption happens when we do a write that | 13 | Suggested-by: Eric Ernst <eric.g.ernst@gmail.com> |
9 | * writes to two or more unallocated clusters at once | 14 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
10 | * doesn't fully cover the first sector | 15 | Message-Id: <20210414200247.917496-3-stefanha@redhat.com> |
11 | * doesn't fully cover the last sector | 16 | --- |
12 | * uses luks encryption | 17 | util/async.c | 16 ++++++++++++++-- |
18 | 1 file changed, 14 insertions(+), 2 deletions(-) | ||
13 | 19 | ||
14 | In this case, when allocating the new clusters we COW both areas | 20 | diff --git a/util/async.c b/util/async.c |
15 | prior to the write and after the write, and we encrypt them. | ||
16 | |||
17 | The above mentioned commit accidentally made it so we encrypt the | ||
18 | second COW area using the physical cluster offset of the first area. | ||
19 | |||
20 | The problem is that offset_in_cluster in do_perform_cow_encrypt | ||
21 | can be larger that the cluster size, thus cluster_offset | ||
22 | will no longer point to the start of the cluster at which encrypted | ||
23 | area starts. | ||
24 | |||
25 | Next patch in this series will refactor the code to avoid all these | ||
26 | assumptions. | ||
27 | |||
28 | In the bugreport that was triggered by rebasing a luks image to new, | ||
29 | zero filled base, which lot of such writes, and causes some files | ||
30 | with zero areas to contain garbage there instead. | ||
31 | But as described above it can happen elsewhere as well | ||
32 | |||
33 | Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> | ||
34 | Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | ||
35 | Message-id: 20190915203655.21638-2-mlevitsk@redhat.com | ||
36 | Reviewed-by: Max Reitz <mreitz@redhat.com> | ||
37 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
38 | --- | ||
39 | block/qcow2-cluster.c | 7 ++++--- | ||
40 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
41 | |||
42 | diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c | ||
43 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
44 | --- a/block/qcow2-cluster.c | 22 | --- a/util/async.c |
45 | +++ b/block/qcow2-cluster.c | 23 | +++ b/util/async.c |
46 | @@ -XXX,XX +XXX,XX @@ static bool coroutine_fn do_perform_cow_encrypt(BlockDriverState *bs, | 24 | @@ -XXX,XX +XXX,XX @@ aio_ctx_finalize(GSource *source) |
47 | assert(QEMU_IS_ALIGNED(offset_in_cluster, BDRV_SECTOR_SIZE)); | 25 | assert(QSIMPLEQ_EMPTY(&ctx->bh_slice_list)); |
48 | assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | 26 | |
49 | assert(s->crypto); | 27 | while ((bh = aio_bh_dequeue(&ctx->bh_list, &flags))) { |
50 | - if (qcow2_co_encrypt(bs, cluster_offset, | 28 | - /* qemu_bh_delete() must have been called on BHs in this AioContext */ |
51 | - src_cluster_offset + offset_in_cluster, | 29 | - assert(flags & BH_DELETED); |
52 | - buffer, bytes) < 0) { | 30 | + /* |
53 | + if (qcow2_co_encrypt(bs, | 31 | + * qemu_bh_delete() must have been called on BHs in this AioContext. In |
54 | + start_of_cluster(s, cluster_offset + offset_in_cluster), | 32 | + * many cases memory leaks, hangs, or inconsistent state occur when a |
55 | + src_cluster_offset + offset_in_cluster, | 33 | + * BH is leaked because something still expects it to run. |
56 | + buffer, bytes) < 0) { | 34 | + * |
57 | return false; | 35 | + * If you hit this, fix the lifecycle of the BH so that |
58 | } | 36 | + * qemu_bh_delete() and any associated cleanup is called before the |
37 | + * AioContext is finalized. | ||
38 | + */ | ||
39 | + if (unlikely(!(flags & BH_DELETED))) { | ||
40 | + fprintf(stderr, "%s: BH '%s' leaked, aborting...\n", | ||
41 | + __func__, bh->name); | ||
42 | + abort(); | ||
43 | + } | ||
44 | |||
45 | g_free(bh); | ||
59 | } | 46 | } |
60 | -- | 47 | -- |
61 | 2.21.0 | 48 | 2.31.1 |
62 | 49 | ||
63 | diff view generated by jsdifflib |
1 | Instead of reporting all sockets to cURL, only report the one that has | 1 | From: Akihiko Odaki <akihiko.odaki@gmail.com> |
---|---|---|---|
2 | caused curl_multi_do_locked() to be called. This lets us get rid of the | ||
3 | QLIST_FOREACH_SAFE() list, which was actually wrong: SAFE foreaches are | ||
4 | only safe when the current element is removed in each iteration. If it | ||
5 | possible for the list to be concurrently modified, we cannot guarantee | ||
6 | that only the current element will be removed. Therefore, we must not | ||
7 | use QLIST_FOREACH_SAFE() here. | ||
8 | 2 | ||
9 | Fixes: ff5ca1664af85b24a4180d595ea6873fd3deac57 | 3 | This commit introduces "punch hole" operation and optimizes transfer |
10 | Cc: qemu-stable@nongnu.org | 4 | block size for macOS. |
11 | Signed-off-by: Max Reitz <mreitz@redhat.com> | 5 | |
12 | Message-id: 20190910124136.10565-6-mreitz@redhat.com | 6 | Thanks to Konstantin Nazarov for detailed analysis of a flaw in an |
13 | Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> | 7 | old version of this change: |
14 | Reviewed-by: John Snow <jsnow@redhat.com> | 8 | https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3654667 |
15 | Signed-off-by: Max Reitz <mreitz@redhat.com> | 9 | |
10 | Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> | ||
11 | Message-id: 20210705130458.97642-1-akihiko.odaki@gmail.com | ||
12 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
16 | --- | 13 | --- |
17 | block/curl.c | 17 ++++++----------- | 14 | block/file-posix.c | 27 +++++++++++++++++++++++++-- |
18 | 1 file changed, 6 insertions(+), 11 deletions(-) | 15 | 1 file changed, 25 insertions(+), 2 deletions(-) |
19 | 16 | ||
20 | diff --git a/block/curl.c b/block/curl.c | 17 | diff --git a/block/file-posix.c b/block/file-posix.c |
21 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/block/curl.c | 19 | --- a/block/file-posix.c |
23 | +++ b/block/curl.c | 20 | +++ b/block/file-posix.c |
24 | @@ -XXX,XX +XXX,XX @@ static void curl_multi_check_completion(BDRVCURLState *s) | 21 | @@ -XXX,XX +XXX,XX @@ |
25 | } | 22 | #if defined(HAVE_HOST_BLOCK_DEVICE) |
26 | 23 | #include <paths.h> | |
27 | /* Called with s->mutex held. */ | 24 | #include <sys/param.h> |
28 | -static void curl_multi_do_locked(CURLSocket *ready_socket) | 25 | +#include <sys/mount.h> |
29 | +static void curl_multi_do_locked(CURLSocket *socket) | 26 | #include <IOKit/IOKitLib.h> |
30 | { | 27 | #include <IOKit/IOBSD.h> |
31 | - CURLSocket *socket, *next_socket; | 28 | #include <IOKit/storage/IOMediaBSDClient.h> |
32 | - CURLState *s = ready_socket->state; | 29 | @@ -XXX,XX +XXX,XX @@ static void raw_refresh_limits(BlockDriverState *bs, Error **errp) |
33 | + BDRVCURLState *s = socket->state->s; | ||
34 | int running; | ||
35 | int r; | ||
36 | |||
37 | - if (!s->s->multi) { | ||
38 | + if (!s->multi) { | ||
39 | return; | 30 | return; |
40 | } | 31 | } |
41 | 32 | ||
42 | - /* Need to use _SAFE because curl_multi_socket_action() may trigger | 33 | +#if defined(__APPLE__) && (__MACH__) |
43 | - * curl_sock_cb() which might modify this list */ | 34 | + struct statfs buf; |
44 | - QLIST_FOREACH_SAFE(socket, &s->sockets, next, next_socket) { | 35 | + |
45 | - do { | 36 | + if (!fstatfs(s->fd, &buf)) { |
46 | - r = curl_multi_socket_action(s->s->multi, socket->fd, 0, &running); | 37 | + bs->bl.opt_transfer = buf.f_iosize; |
47 | - } while (r == CURLM_CALL_MULTI_PERFORM); | 38 | + bs->bl.pdiscard_alignment = buf.f_bsize; |
48 | - } | 39 | + } |
49 | + do { | 40 | +#endif |
50 | + r = curl_multi_socket_action(s->multi, socket->fd, 0, &running); | 41 | + |
51 | + } while (r == CURLM_CALL_MULTI_PERFORM); | 42 | if (bs->sg || S_ISBLK(st.st_mode)) { |
43 | int ret = hdev_get_max_hw_transfer(s->fd, &st); | ||
44 | |||
45 | @@ -XXX,XX +XXX,XX @@ out: | ||
46 | } | ||
52 | } | 47 | } |
53 | 48 | ||
54 | static void curl_multi_do(void *arg) | 49 | +#if defined(CONFIG_FALLOCATE) || defined(BLKZEROOUT) || defined(BLKDISCARD) |
50 | static int translate_err(int err) | ||
51 | { | ||
52 | if (err == -ENODEV || err == -ENOSYS || err == -EOPNOTSUPP || | ||
53 | @@ -XXX,XX +XXX,XX @@ static int translate_err(int err) | ||
54 | } | ||
55 | return err; | ||
56 | } | ||
57 | +#endif | ||
58 | |||
59 | #ifdef CONFIG_FALLOCATE | ||
60 | static int do_fallocate(int fd, int mode, off_t offset, off_t len) | ||
61 | @@ -XXX,XX +XXX,XX @@ static int handle_aiocb_discard(void *opaque) | ||
62 | } | ||
63 | } while (errno == EINTR); | ||
64 | |||
65 | - ret = -errno; | ||
66 | + ret = translate_err(-errno); | ||
67 | #endif | ||
68 | } else { | ||
69 | #ifdef CONFIG_FALLOCATE_PUNCH_HOLE | ||
70 | ret = do_fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, | ||
71 | aiocb->aio_offset, aiocb->aio_nbytes); | ||
72 | + ret = translate_err(-errno); | ||
73 | +#elif defined(__APPLE__) && (__MACH__) | ||
74 | + fpunchhole_t fpunchhole; | ||
75 | + fpunchhole.fp_flags = 0; | ||
76 | + fpunchhole.reserved = 0; | ||
77 | + fpunchhole.fp_offset = aiocb->aio_offset; | ||
78 | + fpunchhole.fp_length = aiocb->aio_nbytes; | ||
79 | + if (fcntl(s->fd, F_PUNCHHOLE, &fpunchhole) == -1) { | ||
80 | + ret = errno == ENODEV ? -ENOTSUP : -errno; | ||
81 | + } else { | ||
82 | + ret = 0; | ||
83 | + } | ||
84 | #endif | ||
85 | } | ||
86 | |||
87 | - ret = translate_err(ret); | ||
88 | if (ret == -ENOTSUP) { | ||
89 | s->has_discard = false; | ||
90 | } | ||
55 | -- | 91 | -- |
56 | 2.21.0 | 92 | 2.31.1 |
57 | 93 | ||
58 | diff view generated by jsdifflib |
1 | From: Maxim Levitsky <mlevitsk@redhat.com> | 1 | From: Akihiko Odaki <akihiko.odaki@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | * Change the qcow2_co_{encrypt|decrypt} to just receive full host and | 3 | backend_defaults property allow users to control if default block |
4 | guest offsets and use this function directly instead of calling | 4 | properties should be decided with backend information. |
5 | do_perform_cow_encrypt (which is removed by that patch). | 5 | |
6 | 6 | If it is off, any backend information will be discarded, which is | |
7 | * Adjust qcow2_co_encdec to take full host and guest offsets as well. | 7 | suitable if you plan to perform live migration to a different disk backend. |
8 | 8 | ||
9 | * Document the qcow2_co_{encrypt|decrypt} arguments | 9 | If it is on, a block device may utilize backend information more |
10 | to prevent the bug fixed in former commit from hopefully | 10 | aggressively. |
11 | happening again. | 11 | |
12 | 12 | By default, it is auto, which uses backend information for block | |
13 | Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> | 13 | sizes and ignores the others, which is consistent with the older |
14 | Message-id: 20190915203655.21638-3-mlevitsk@redhat.com | 14 | versions. |
15 | Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 15 | |
16 | [mreitz: Let perform_cow() return the error value returned by | 16 | Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> |
17 | qcow2_co_encrypt(), as proposed by Vladimir] | 17 | Message-id: 20210705130458.97642-2-akihiko.odaki@gmail.com |
18 | Signed-off-by: Max Reitz <mreitz@redhat.com> | 18 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
19 | --- | 19 | --- |
20 | block/qcow2.h | 8 +++--- | 20 | include/hw/block/block.h | 3 +++ |
21 | block/qcow2-cluster.c | 41 +++++++++------------------- | 21 | hw/block/block.c | 42 ++++++++++++++++++++++++++++++++++---- |
22 | block/qcow2-threads.c | 63 +++++++++++++++++++++++++++++++++---------- | 22 | tests/qemu-iotests/172.out | 38 ++++++++++++++++++++++++++++++++++ |
23 | block/qcow2.c | 5 ++-- | 23 | 3 files changed, 79 insertions(+), 4 deletions(-) |
24 | 4 files changed, 69 insertions(+), 48 deletions(-) | 24 | |
25 | 25 | diff --git a/include/hw/block/block.h b/include/hw/block/block.h | |
26 | diff --git a/block/qcow2.h b/block/qcow2.h | ||
27 | index XXXXXXX..XXXXXXX 100644 | 26 | index XXXXXXX..XXXXXXX 100644 |
28 | --- a/block/qcow2.h | 27 | --- a/include/hw/block/block.h |
29 | +++ b/block/qcow2.h | 28 | +++ b/include/hw/block/block.h |
30 | @@ -XXX,XX +XXX,XX @@ ssize_t coroutine_fn | 29 | @@ -XXX,XX +XXX,XX @@ |
31 | qcow2_co_decompress(BlockDriverState *bs, void *dest, size_t dest_size, | 30 | |
32 | const void *src, size_t src_size); | 31 | typedef struct BlockConf { |
33 | int coroutine_fn | 32 | BlockBackend *blk; |
34 | -qcow2_co_encrypt(BlockDriverState *bs, uint64_t file_cluster_offset, | 33 | + OnOffAuto backend_defaults; |
35 | - uint64_t offset, void *buf, size_t len); | 34 | uint32_t physical_block_size; |
36 | +qcow2_co_encrypt(BlockDriverState *bs, uint64_t host_offset, | 35 | uint32_t logical_block_size; |
37 | + uint64_t guest_offset, void *buf, size_t len); | 36 | uint32_t min_io_size; |
38 | int coroutine_fn | 37 | @@ -XXX,XX +XXX,XX @@ static inline unsigned int get_physical_block_exp(BlockConf *conf) |
39 | -qcow2_co_decrypt(BlockDriverState *bs, uint64_t file_cluster_offset, | 38 | } |
40 | - uint64_t offset, void *buf, size_t len); | 39 | |
41 | +qcow2_co_decrypt(BlockDriverState *bs, uint64_t host_offset, | 40 | #define DEFINE_BLOCK_PROPERTIES_BASE(_state, _conf) \ |
42 | + uint64_t guest_offset, void *buf, size_t len); | 41 | + DEFINE_PROP_ON_OFF_AUTO("backend_defaults", _state, \ |
43 | 42 | + _conf.backend_defaults, ON_OFF_AUTO_AUTO), \ | |
44 | #endif | 43 | DEFINE_PROP_BLOCKSIZE("logical_block_size", _state, \ |
45 | diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c | 44 | _conf.logical_block_size), \ |
45 | DEFINE_PROP_BLOCKSIZE("physical_block_size", _state, \ | ||
46 | diff --git a/hw/block/block.c b/hw/block/block.c | ||
46 | index XXXXXXX..XXXXXXX 100644 | 47 | index XXXXXXX..XXXXXXX 100644 |
47 | --- a/block/qcow2-cluster.c | 48 | --- a/hw/block/block.c |
48 | +++ b/block/qcow2-cluster.c | 49 | +++ b/hw/block/block.c |
49 | @@ -XXX,XX +XXX,XX @@ static int coroutine_fn do_perform_cow_read(BlockDriverState *bs, | 50 | @@ -XXX,XX +XXX,XX @@ bool blkconf_blocksizes(BlockConf *conf, Error **errp) |
50 | return 0; | 51 | { |
51 | } | 52 | BlockBackend *blk = conf->blk; |
52 | 53 | BlockSizes blocksizes; | |
53 | -static bool coroutine_fn do_perform_cow_encrypt(BlockDriverState *bs, | 54 | - int backend_ret; |
54 | - uint64_t src_cluster_offset, | 55 | + BlockDriverState *bs; |
55 | - uint64_t cluster_offset, | 56 | + bool use_blocksizes; |
56 | - unsigned offset_in_cluster, | 57 | + bool use_bs; |
57 | - uint8_t *buffer, | ||
58 | - unsigned bytes) | ||
59 | -{ | ||
60 | - if (bytes && bs->encrypted) { | ||
61 | - BDRVQcow2State *s = bs->opaque; | ||
62 | - assert(QEMU_IS_ALIGNED(offset_in_cluster, BDRV_SECTOR_SIZE)); | ||
63 | - assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
64 | - assert(s->crypto); | ||
65 | - if (qcow2_co_encrypt(bs, | ||
66 | - start_of_cluster(s, cluster_offset + offset_in_cluster), | ||
67 | - src_cluster_offset + offset_in_cluster, | ||
68 | - buffer, bytes) < 0) { | ||
69 | - return false; | ||
70 | - } | ||
71 | - } | ||
72 | - return true; | ||
73 | -} | ||
74 | - | ||
75 | static int coroutine_fn do_perform_cow_write(BlockDriverState *bs, | ||
76 | uint64_t cluster_offset, | ||
77 | unsigned offset_in_cluster, | ||
78 | @@ -XXX,XX +XXX,XX @@ static int perform_cow(BlockDriverState *bs, QCowL2Meta *m) | ||
79 | |||
80 | /* Encrypt the data if necessary before writing it */ | ||
81 | if (bs->encrypted) { | ||
82 | - if (!do_perform_cow_encrypt(bs, m->offset, m->alloc_offset, | ||
83 | - start->offset, start_buffer, | ||
84 | - start->nb_bytes) || | ||
85 | - !do_perform_cow_encrypt(bs, m->offset, m->alloc_offset, | ||
86 | - end->offset, end_buffer, end->nb_bytes)) { | ||
87 | - ret = -EIO; | ||
88 | + ret = qcow2_co_encrypt(bs, | ||
89 | + m->alloc_offset + start->offset, | ||
90 | + m->offset + start->offset, | ||
91 | + start_buffer, start->nb_bytes); | ||
92 | + if (ret < 0) { | ||
93 | + goto fail; | ||
94 | + } | ||
95 | + | 58 | + |
96 | + ret = qcow2_co_encrypt(bs, | 59 | + switch (conf->backend_defaults) { |
97 | + m->alloc_offset + end->offset, | 60 | + case ON_OFF_AUTO_AUTO: |
98 | + m->offset + end->offset, | 61 | + use_blocksizes = !blk_probe_blocksizes(blk, &blocksizes); |
99 | + end_buffer, end->nb_bytes); | 62 | + use_bs = false; |
100 | + if (ret < 0) { | 63 | + break; |
101 | goto fail; | 64 | + |
65 | + case ON_OFF_AUTO_ON: | ||
66 | + use_blocksizes = !blk_probe_blocksizes(blk, &blocksizes); | ||
67 | + bs = blk_bs(blk); | ||
68 | + use_bs = bs; | ||
69 | + break; | ||
70 | + | ||
71 | + case ON_OFF_AUTO_OFF: | ||
72 | + use_blocksizes = false; | ||
73 | + use_bs = false; | ||
74 | + break; | ||
75 | + | ||
76 | + default: | ||
77 | + abort(); | ||
78 | + } | ||
79 | |||
80 | - backend_ret = blk_probe_blocksizes(blk, &blocksizes); | ||
81 | /* fill in detected values if they are not defined via qemu command line */ | ||
82 | if (!conf->physical_block_size) { | ||
83 | - if (!backend_ret) { | ||
84 | + if (use_blocksizes) { | ||
85 | conf->physical_block_size = blocksizes.phys; | ||
86 | } else { | ||
87 | conf->physical_block_size = BDRV_SECTOR_SIZE; | ||
102 | } | 88 | } |
103 | } | 89 | } |
104 | diff --git a/block/qcow2-threads.c b/block/qcow2-threads.c | 90 | if (!conf->logical_block_size) { |
91 | - if (!backend_ret) { | ||
92 | + if (use_blocksizes) { | ||
93 | conf->logical_block_size = blocksizes.log; | ||
94 | } else { | ||
95 | conf->logical_block_size = BDRV_SECTOR_SIZE; | ||
96 | } | ||
97 | } | ||
98 | + if (use_bs) { | ||
99 | + if (!conf->opt_io_size) { | ||
100 | + conf->opt_io_size = bs->bl.opt_transfer; | ||
101 | + } | ||
102 | + if (conf->discard_granularity == -1) { | ||
103 | + if (bs->bl.pdiscard_alignment) { | ||
104 | + conf->discard_granularity = bs->bl.pdiscard_alignment; | ||
105 | + } else if (bs->bl.request_alignment != 1) { | ||
106 | + conf->discard_granularity = bs->bl.request_alignment; | ||
107 | + } | ||
108 | + } | ||
109 | + } | ||
110 | |||
111 | if (conf->logical_block_size > conf->physical_block_size) { | ||
112 | error_setg(errp, | ||
113 | diff --git a/tests/qemu-iotests/172.out b/tests/qemu-iotests/172.out | ||
105 | index XXXXXXX..XXXXXXX 100644 | 114 | index XXXXXXX..XXXXXXX 100644 |
106 | --- a/block/qcow2-threads.c | 115 | --- a/tests/qemu-iotests/172.out |
107 | +++ b/block/qcow2-threads.c | 116 | +++ b/tests/qemu-iotests/172.out |
108 | @@ -XXX,XX +XXX,XX @@ static int qcow2_encdec_pool_func(void *opaque) | 117 | @@ -XXX,XX +XXX,XX @@ Testing: |
109 | } | 118 | dev: floppy, id "" |
110 | 119 | unit = 0 (0x0) | |
111 | static int coroutine_fn | 120 | drive = "floppy0" |
112 | -qcow2_co_encdec(BlockDriverState *bs, uint64_t file_cluster_offset, | 121 | + backend_defaults = "auto" |
113 | - uint64_t offset, void *buf, size_t len, Qcow2EncDecFunc func) | 122 | logical_block_size = 512 (512 B) |
114 | +qcow2_co_encdec(BlockDriverState *bs, uint64_t host_offset, | 123 | physical_block_size = 512 (512 B) |
115 | + uint64_t guest_offset, void *buf, size_t len, | 124 | min_io_size = 0 (0 B) |
116 | + Qcow2EncDecFunc func) | 125 | @@ -XXX,XX +XXX,XX @@ Testing: -fda TEST_DIR/t.qcow2 |
117 | { | 126 | dev: floppy, id "" |
118 | BDRVQcow2State *s = bs->opaque; | 127 | unit = 0 (0x0) |
119 | Qcow2EncDecData arg = { | 128 | drive = "floppy0" |
120 | .block = s->crypto, | 129 | + backend_defaults = "auto" |
121 | - .offset = s->crypt_physical_offset ? | 130 | logical_block_size = 512 (512 B) |
122 | - file_cluster_offset + offset_into_cluster(s, offset) : | 131 | physical_block_size = 512 (512 B) |
123 | - offset, | 132 | min_io_size = 0 (0 B) |
124 | + .offset = s->crypt_physical_offset ? host_offset : guest_offset, | 133 | @@ -XXX,XX +XXX,XX @@ Testing: -fdb TEST_DIR/t.qcow2 |
125 | .buf = buf, | 134 | dev: floppy, id "" |
126 | .len = len, | 135 | unit = 1 (0x1) |
127 | .func = func, | 136 | drive = "floppy1" |
128 | }; | 137 | + backend_defaults = "auto" |
129 | 138 | logical_block_size = 512 (512 B) | |
130 | - return qcow2_co_process(bs, qcow2_encdec_pool_func, &arg); | 139 | physical_block_size = 512 (512 B) |
131 | + assert(QEMU_IS_ALIGNED(guest_offset, BDRV_SECTOR_SIZE)); | 140 | min_io_size = 0 (0 B) |
132 | + assert(QEMU_IS_ALIGNED(host_offset, BDRV_SECTOR_SIZE)); | 141 | @@ -XXX,XX +XXX,XX @@ Testing: -fdb TEST_DIR/t.qcow2 |
133 | + assert(QEMU_IS_ALIGNED(len, BDRV_SECTOR_SIZE)); | 142 | dev: floppy, id "" |
134 | + assert(s->crypto); | 143 | unit = 0 (0x0) |
135 | + | 144 | drive = "floppy0" |
136 | + return len == 0 ? 0 : qcow2_co_process(bs, qcow2_encdec_pool_func, &arg); | 145 | + backend_defaults = "auto" |
137 | } | 146 | logical_block_size = 512 (512 B) |
138 | 147 | physical_block_size = 512 (512 B) | |
139 | +/* | 148 | min_io_size = 0 (0 B) |
140 | + * qcow2_co_encrypt() | 149 | @@ -XXX,XX +XXX,XX @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2 |
141 | + * | 150 | dev: floppy, id "" |
142 | + * Encrypts one or more contiguous aligned sectors | 151 | unit = 1 (0x1) |
143 | + * | 152 | drive = "floppy1" |
144 | + * @host_offset - underlying storage offset of the first sector of the | 153 | + backend_defaults = "auto" |
145 | + * data to be encrypted | 154 | logical_block_size = 512 (512 B) |
146 | + * | 155 | physical_block_size = 512 (512 B) |
147 | + * @guest_offset - guest (virtual) offset of the first sector of the | 156 | min_io_size = 0 (0 B) |
148 | + * data to be encrypted | 157 | @@ -XXX,XX +XXX,XX @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2 |
149 | + * | 158 | dev: floppy, id "" |
150 | + * @buf - buffer with the data to encrypt, that after encryption | 159 | unit = 0 (0x0) |
151 | + * will be written to the underlying storage device at | 160 | drive = "floppy0" |
152 | + * @host_offset | 161 | + backend_defaults = "auto" |
153 | + * | 162 | logical_block_size = 512 (512 B) |
154 | + * @len - length of the buffer (must be a BDRV_SECTOR_SIZE multiple) | 163 | physical_block_size = 512 (512 B) |
155 | + * | 164 | min_io_size = 0 (0 B) |
156 | + * Depending on the encryption method, @host_offset and/or @guest_offset | 165 | @@ -XXX,XX +XXX,XX @@ Testing: -fdb |
157 | + * may be used for generating the initialization vector for | 166 | dev: floppy, id "" |
158 | + * encryption. | 167 | unit = 1 (0x1) |
159 | + * | 168 | drive = "floppy1" |
160 | + * Note that while the whole range must be aligned on sectors, it | 169 | + backend_defaults = "auto" |
161 | + * does not have to be aligned on clusters and can also cross cluster | 170 | logical_block_size = 512 (512 B) |
162 | + * boundaries | 171 | physical_block_size = 512 (512 B) |
163 | + */ | 172 | min_io_size = 0 (0 B) |
164 | int coroutine_fn | 173 | @@ -XXX,XX +XXX,XX @@ Testing: -fdb |
165 | -qcow2_co_encrypt(BlockDriverState *bs, uint64_t file_cluster_offset, | 174 | dev: floppy, id "" |
166 | - uint64_t offset, void *buf, size_t len) | 175 | unit = 0 (0x0) |
167 | +qcow2_co_encrypt(BlockDriverState *bs, uint64_t host_offset, | 176 | drive = "floppy0" |
168 | + uint64_t guest_offset, void *buf, size_t len) | 177 | + backend_defaults = "auto" |
169 | { | 178 | logical_block_size = 512 (512 B) |
170 | - return qcow2_co_encdec(bs, file_cluster_offset, offset, buf, len, | 179 | physical_block_size = 512 (512 B) |
171 | - qcrypto_block_encrypt); | 180 | min_io_size = 0 (0 B) |
172 | + return qcow2_co_encdec(bs, host_offset, guest_offset, buf, len, | 181 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 |
173 | + qcrypto_block_encrypt); | 182 | dev: floppy, id "" |
174 | } | 183 | unit = 0 (0x0) |
175 | 184 | drive = "floppy0" | |
176 | +/* | 185 | + backend_defaults = "auto" |
177 | + * qcow2_co_decrypt() | 186 | logical_block_size = 512 (512 B) |
178 | + * | 187 | physical_block_size = 512 (512 B) |
179 | + * Decrypts one or more contiguous aligned sectors | 188 | min_io_size = 0 (0 B) |
180 | + * Similar to qcow2_co_encrypt | 189 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2,index=1 |
181 | + */ | 190 | dev: floppy, id "" |
182 | int coroutine_fn | 191 | unit = 1 (0x1) |
183 | -qcow2_co_decrypt(BlockDriverState *bs, uint64_t file_cluster_offset, | 192 | drive = "floppy1" |
184 | - uint64_t offset, void *buf, size_t len) | 193 | + backend_defaults = "auto" |
185 | +qcow2_co_decrypt(BlockDriverState *bs, uint64_t host_offset, | 194 | logical_block_size = 512 (512 B) |
186 | + uint64_t guest_offset, void *buf, size_t len) | 195 | physical_block_size = 512 (512 B) |
187 | { | 196 | min_io_size = 0 (0 B) |
188 | - return qcow2_co_encdec(bs, file_cluster_offset, offset, buf, len, | 197 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2,index=1 |
189 | - qcrypto_block_decrypt); | 198 | dev: floppy, id "" |
190 | + return qcow2_co_encdec(bs, host_offset, guest_offset, buf, len, | 199 | unit = 0 (0x0) |
191 | + qcrypto_block_decrypt); | 200 | drive = "floppy0" |
192 | } | 201 | + backend_defaults = "auto" |
193 | diff --git a/block/qcow2.c b/block/qcow2.c | 202 | logical_block_size = 512 (512 B) |
194 | index XXXXXXX..XXXXXXX 100644 | 203 | physical_block_size = 512 (512 B) |
195 | --- a/block/qcow2.c | 204 | min_io_size = 0 (0 B) |
196 | +++ b/block/qcow2.c | 205 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=floppy,file=TEST_DIR/t |
197 | @@ -XXX,XX +XXX,XX @@ static coroutine_fn int qcow2_co_preadv_part(BlockDriverState *bs, | 206 | dev: floppy, id "" |
198 | 207 | unit = 1 (0x1) | |
199 | assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | 208 | drive = "floppy1" |
200 | assert(QEMU_IS_ALIGNED(cur_bytes, BDRV_SECTOR_SIZE)); | 209 | + backend_defaults = "auto" |
201 | - if (qcow2_co_decrypt(bs, cluster_offset, offset, | 210 | logical_block_size = 512 (512 B) |
202 | + if (qcow2_co_decrypt(bs, cluster_offset + offset_in_cluster, | 211 | physical_block_size = 512 (512 B) |
203 | + offset, | 212 | min_io_size = 0 (0 B) |
204 | cluster_data, cur_bytes) < 0) { | 213 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=floppy,file=TEST_DIR/t |
205 | ret = -EIO; | 214 | dev: floppy, id "" |
206 | goto fail; | 215 | unit = 0 (0x0) |
207 | @@ -XXX,XX +XXX,XX @@ static coroutine_fn int qcow2_co_pwritev_part( | 216 | drive = "floppy0" |
208 | qemu_iovec_to_buf(qiov, qiov_offset + bytes_done, | 217 | + backend_defaults = "auto" |
209 | cluster_data, cur_bytes); | 218 | logical_block_size = 512 (512 B) |
210 | 219 | physical_block_size = 512 (512 B) | |
211 | - if (qcow2_co_encrypt(bs, cluster_offset, offset, | 220 | min_io_size = 0 (0 B) |
212 | + if (qcow2_co_encrypt(bs, cluster_offset + offset_in_cluster, offset, | 221 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0 |
213 | cluster_data, cur_bytes) < 0) { | 222 | dev: floppy, id "" |
214 | ret = -EIO; | 223 | unit = 0 (0x0) |
215 | goto out_unlocked; | 224 | drive = "none0" |
225 | + backend_defaults = "auto" | ||
226 | logical_block_size = 512 (512 B) | ||
227 | physical_block_size = 512 (512 B) | ||
228 | min_io_size = 0 (0 B) | ||
229 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,unit=1 | ||
230 | dev: floppy, id "" | ||
231 | unit = 1 (0x1) | ||
232 | drive = "none0" | ||
233 | + backend_defaults = "auto" | ||
234 | logical_block_size = 512 (512 B) | ||
235 | physical_block_size = 512 (512 B) | ||
236 | min_io_size = 0 (0 B) | ||
237 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco | ||
238 | dev: floppy, id "" | ||
239 | unit = 1 (0x1) | ||
240 | drive = "none1" | ||
241 | + backend_defaults = "auto" | ||
242 | logical_block_size = 512 (512 B) | ||
243 | physical_block_size = 512 (512 B) | ||
244 | min_io_size = 0 (0 B) | ||
245 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco | ||
246 | dev: floppy, id "" | ||
247 | unit = 0 (0x0) | ||
248 | drive = "none0" | ||
249 | + backend_defaults = "auto" | ||
250 | logical_block_size = 512 (512 B) | ||
251 | physical_block_size = 512 (512 B) | ||
252 | min_io_size = 0 (0 B) | ||
253 | @@ -XXX,XX +XXX,XX @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl | ||
254 | dev: floppy, id "" | ||
255 | unit = 1 (0x1) | ||
256 | drive = "none0" | ||
257 | + backend_defaults = "auto" | ||
258 | logical_block_size = 512 (512 B) | ||
259 | physical_block_size = 512 (512 B) | ||
260 | min_io_size = 0 (0 B) | ||
261 | @@ -XXX,XX +XXX,XX @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl | ||
262 | dev: floppy, id "" | ||
263 | unit = 0 (0x0) | ||
264 | drive = "floppy0" | ||
265 | + backend_defaults = "auto" | ||
266 | logical_block_size = 512 (512 B) | ||
267 | physical_block_size = 512 (512 B) | ||
268 | min_io_size = 0 (0 B) | ||
269 | @@ -XXX,XX +XXX,XX @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl | ||
270 | dev: floppy, id "" | ||
271 | unit = 1 (0x1) | ||
272 | drive = "none0" | ||
273 | + backend_defaults = "auto" | ||
274 | logical_block_size = 512 (512 B) | ||
275 | physical_block_size = 512 (512 B) | ||
276 | min_io_size = 0 (0 B) | ||
277 | @@ -XXX,XX +XXX,XX @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl | ||
278 | dev: floppy, id "" | ||
279 | unit = 0 (0x0) | ||
280 | drive = "floppy0" | ||
281 | + backend_defaults = "auto" | ||
282 | logical_block_size = 512 (512 B) | ||
283 | physical_block_size = 512 (512 B) | ||
284 | min_io_size = 0 (0 B) | ||
285 | @@ -XXX,XX +XXX,XX @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl | ||
286 | dev: floppy, id "" | ||
287 | unit = 0 (0x0) | ||
288 | drive = "none0" | ||
289 | + backend_defaults = "auto" | ||
290 | logical_block_size = 512 (512 B) | ||
291 | physical_block_size = 512 (512 B) | ||
292 | min_io_size = 0 (0 B) | ||
293 | @@ -XXX,XX +XXX,XX @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl | ||
294 | dev: floppy, id "" | ||
295 | unit = 1 (0x1) | ||
296 | drive = "floppy1" | ||
297 | + backend_defaults = "auto" | ||
298 | logical_block_size = 512 (512 B) | ||
299 | physical_block_size = 512 (512 B) | ||
300 | min_io_size = 0 (0 B) | ||
301 | @@ -XXX,XX +XXX,XX @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl | ||
302 | dev: floppy, id "" | ||
303 | unit = 0 (0x0) | ||
304 | drive = "none0" | ||
305 | + backend_defaults = "auto" | ||
306 | logical_block_size = 512 (512 B) | ||
307 | physical_block_size = 512 (512 B) | ||
308 | min_io_size = 0 (0 B) | ||
309 | @@ -XXX,XX +XXX,XX @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl | ||
310 | dev: floppy, id "" | ||
311 | unit = 1 (0x1) | ||
312 | drive = "floppy1" | ||
313 | + backend_defaults = "auto" | ||
314 | logical_block_size = 512 (512 B) | ||
315 | physical_block_size = 512 (512 B) | ||
316 | min_io_size = 0 (0 B) | ||
317 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q | ||
318 | dev: floppy, id "" | ||
319 | unit = 1 (0x1) | ||
320 | drive = "none0" | ||
321 | + backend_defaults = "auto" | ||
322 | logical_block_size = 512 (512 B) | ||
323 | physical_block_size = 512 (512 B) | ||
324 | min_io_size = 0 (0 B) | ||
325 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q | ||
326 | dev: floppy, id "" | ||
327 | unit = 0 (0x0) | ||
328 | drive = "floppy0" | ||
329 | + backend_defaults = "auto" | ||
330 | logical_block_size = 512 (512 B) | ||
331 | physical_block_size = 512 (512 B) | ||
332 | min_io_size = 0 (0 B) | ||
333 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q | ||
334 | dev: floppy, id "" | ||
335 | unit = 1 (0x1) | ||
336 | drive = "none0" | ||
337 | + backend_defaults = "auto" | ||
338 | logical_block_size = 512 (512 B) | ||
339 | physical_block_size = 512 (512 B) | ||
340 | min_io_size = 0 (0 B) | ||
341 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q | ||
342 | dev: floppy, id "" | ||
343 | unit = 0 (0x0) | ||
344 | drive = "floppy0" | ||
345 | + backend_defaults = "auto" | ||
346 | logical_block_size = 512 (512 B) | ||
347 | physical_block_size = 512 (512 B) | ||
348 | min_io_size = 0 (0 B) | ||
349 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -global floppy.drive=none0 -device | ||
350 | dev: floppy, id "" | ||
351 | unit = 0 (0x0) | ||
352 | drive = "none0" | ||
353 | + backend_defaults = "auto" | ||
354 | logical_block_size = 512 (512 B) | ||
355 | physical_block_size = 512 (512 B) | ||
356 | min_io_size = 0 (0 B) | ||
357 | @@ -XXX,XX +XXX,XX @@ Testing: -device floppy | ||
358 | dev: floppy, id "" | ||
359 | unit = 0 (0x0) | ||
360 | drive = "" | ||
361 | + backend_defaults = "auto" | ||
362 | logical_block_size = 512 (512 B) | ||
363 | physical_block_size = 512 (512 B) | ||
364 | min_io_size = 0 (0 B) | ||
365 | @@ -XXX,XX +XXX,XX @@ Testing: -device floppy,drive-type=120 | ||
366 | dev: floppy, id "" | ||
367 | unit = 0 (0x0) | ||
368 | drive = "" | ||
369 | + backend_defaults = "auto" | ||
370 | logical_block_size = 512 (512 B) | ||
371 | physical_block_size = 512 (512 B) | ||
372 | min_io_size = 0 (0 B) | ||
373 | @@ -XXX,XX +XXX,XX @@ Testing: -device floppy,drive-type=144 | ||
374 | dev: floppy, id "" | ||
375 | unit = 0 (0x0) | ||
376 | drive = "" | ||
377 | + backend_defaults = "auto" | ||
378 | logical_block_size = 512 (512 B) | ||
379 | physical_block_size = 512 (512 B) | ||
380 | min_io_size = 0 (0 B) | ||
381 | @@ -XXX,XX +XXX,XX @@ Testing: -device floppy,drive-type=288 | ||
382 | dev: floppy, id "" | ||
383 | unit = 0 (0x0) | ||
384 | drive = "" | ||
385 | + backend_defaults = "auto" | ||
386 | logical_block_size = 512 (512 B) | ||
387 | physical_block_size = 512 (512 B) | ||
388 | min_io_size = 0 (0 B) | ||
389 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t | ||
390 | dev: floppy, id "" | ||
391 | unit = 0 (0x0) | ||
392 | drive = "none0" | ||
393 | + backend_defaults = "auto" | ||
394 | logical_block_size = 512 (512 B) | ||
395 | physical_block_size = 512 (512 B) | ||
396 | min_io_size = 0 (0 B) | ||
397 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t | ||
398 | dev: floppy, id "" | ||
399 | unit = 0 (0x0) | ||
400 | drive = "none0" | ||
401 | + backend_defaults = "auto" | ||
402 | logical_block_size = 512 (512 B) | ||
403 | physical_block_size = 512 (512 B) | ||
404 | min_io_size = 0 (0 B) | ||
405 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,logical | ||
406 | dev: floppy, id "" | ||
407 | unit = 0 (0x0) | ||
408 | drive = "none0" | ||
409 | + backend_defaults = "auto" | ||
410 | logical_block_size = 512 (512 B) | ||
411 | physical_block_size = 512 (512 B) | ||
412 | min_io_size = 0 (0 B) | ||
413 | @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,physica | ||
414 | dev: floppy, id "" | ||
415 | unit = 0 (0x0) | ||
416 | drive = "none0" | ||
417 | + backend_defaults = "auto" | ||
418 | logical_block_size = 512 (512 B) | ||
419 | physical_block_size = 512 (512 B) | ||
420 | min_io_size = 0 (0 B) | ||
216 | -- | 421 | -- |
217 | 2.21.0 | 422 | 2.31.1 |
218 | 423 | ||
219 | diff view generated by jsdifflib |
1 | From: Nir Soffer <nirsof@gmail.com> | 1 | From: Akihiko Odaki <akihiko.odaki@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Replace instances of: | 3 | Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> |
4 | Message-id: 20210705130458.97642-3-akihiko.odaki@gmail.com | ||
5 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
6 | --- | ||
7 | block/io.c | 2 ++ | ||
8 | 1 file changed, 2 insertions(+) | ||
4 | 9 | ||
5 | (n & (BDRV_SECTOR_SIZE - 1)) == 0 | ||
6 | |||
7 | And: | ||
8 | |||
9 | (n & ~BDRV_SECTOR_MASK) == 0 | ||
10 | |||
11 | With: | ||
12 | |||
13 | QEMU_IS_ALIGNED(n, BDRV_SECTOR_SIZE) | ||
14 | |||
15 | Which reveals the intent of the code better, and makes it easier to | ||
16 | locate the code checking alignment. | ||
17 | |||
18 | Signed-off-by: Nir Soffer <nsoffer@redhat.com> | ||
19 | Message-id: 20190827185913.27427-2-nsoffer@redhat.com | ||
20 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
21 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
22 | --- | ||
23 | block/bochs.c | 4 ++-- | ||
24 | block/cloop.c | 4 ++-- | ||
25 | block/dmg.c | 4 ++-- | ||
26 | block/io.c | 8 ++++---- | ||
27 | block/qcow2-cluster.c | 4 ++-- | ||
28 | block/qcow2.c | 4 ++-- | ||
29 | block/vvfat.c | 8 ++++---- | ||
30 | qemu-img.c | 2 +- | ||
31 | 8 files changed, 19 insertions(+), 19 deletions(-) | ||
32 | |||
33 | diff --git a/block/bochs.c b/block/bochs.c | ||
34 | index XXXXXXX..XXXXXXX 100644 | ||
35 | --- a/block/bochs.c | ||
36 | +++ b/block/bochs.c | ||
37 | @@ -XXX,XX +XXX,XX @@ bochs_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, | ||
38 | QEMUIOVector local_qiov; | ||
39 | int ret; | ||
40 | |||
41 | - assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
42 | - assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
43 | + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | ||
44 | + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
45 | |||
46 | qemu_iovec_init(&local_qiov, qiov->niov); | ||
47 | qemu_co_mutex_lock(&s->lock); | ||
48 | diff --git a/block/cloop.c b/block/cloop.c | ||
49 | index XXXXXXX..XXXXXXX 100644 | ||
50 | --- a/block/cloop.c | ||
51 | +++ b/block/cloop.c | ||
52 | @@ -XXX,XX +XXX,XX @@ cloop_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, | ||
53 | int nb_sectors = bytes >> BDRV_SECTOR_BITS; | ||
54 | int ret, i; | ||
55 | |||
56 | - assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
57 | - assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
58 | + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | ||
59 | + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
60 | |||
61 | qemu_co_mutex_lock(&s->lock); | ||
62 | |||
63 | diff --git a/block/dmg.c b/block/dmg.c | ||
64 | index XXXXXXX..XXXXXXX 100644 | ||
65 | --- a/block/dmg.c | ||
66 | +++ b/block/dmg.c | ||
67 | @@ -XXX,XX +XXX,XX @@ dmg_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, | ||
68 | int nb_sectors = bytes >> BDRV_SECTOR_BITS; | ||
69 | int ret, i; | ||
70 | |||
71 | - assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
72 | - assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
73 | + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | ||
74 | + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
75 | |||
76 | qemu_co_mutex_lock(&s->lock); | ||
77 | |||
78 | diff --git a/block/io.c b/block/io.c | 10 | diff --git a/block/io.c b/block/io.c |
79 | index XXXXXXX..XXXXXXX 100644 | 11 | index XXXXXXX..XXXXXXX 100644 |
80 | --- a/block/io.c | 12 | --- a/block/io.c |
81 | +++ b/block/io.c | 13 | +++ b/block/io.c |
82 | @@ -XXX,XX +XXX,XX @@ static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs, | 14 | @@ -XXX,XX +XXX,XX @@ void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll) |
83 | sector_num = offset >> BDRV_SECTOR_BITS; | 15 | |
84 | nb_sectors = bytes >> BDRV_SECTOR_BITS; | 16 | static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src) |
85 | |||
86 | - assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
87 | - assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
88 | + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | ||
89 | + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
90 | assert(bytes <= BDRV_REQUEST_MAX_BYTES); | ||
91 | assert(drv->bdrv_co_readv); | ||
92 | |||
93 | @@ -XXX,XX +XXX,XX @@ static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs, | ||
94 | sector_num = offset >> BDRV_SECTOR_BITS; | ||
95 | nb_sectors = bytes >> BDRV_SECTOR_BITS; | ||
96 | |||
97 | - assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
98 | - assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
99 | + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | ||
100 | + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
101 | assert(bytes <= BDRV_REQUEST_MAX_BYTES); | ||
102 | |||
103 | assert(drv->bdrv_co_writev); | ||
104 | diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c | ||
105 | index XXXXXXX..XXXXXXX 100644 | ||
106 | --- a/block/qcow2-cluster.c | ||
107 | +++ b/block/qcow2-cluster.c | ||
108 | @@ -XXX,XX +XXX,XX @@ static bool coroutine_fn do_perform_cow_encrypt(BlockDriverState *bs, | ||
109 | { | 17 | { |
110 | if (bytes && bs->encrypted) { | 18 | + dst->pdiscard_alignment = MAX(dst->pdiscard_alignment, |
111 | BDRVQcow2State *s = bs->opaque; | 19 | + src->pdiscard_alignment); |
112 | - assert((offset_in_cluster & ~BDRV_SECTOR_MASK) == 0); | 20 | dst->opt_transfer = MAX(dst->opt_transfer, src->opt_transfer); |
113 | - assert((bytes & ~BDRV_SECTOR_MASK) == 0); | 21 | dst->max_transfer = MIN_NON_ZERO(dst->max_transfer, src->max_transfer); |
114 | + assert(QEMU_IS_ALIGNED(offset_in_cluster, BDRV_SECTOR_SIZE)); | 22 | dst->max_hw_transfer = MIN_NON_ZERO(dst->max_hw_transfer, |
115 | + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
116 | assert(s->crypto); | ||
117 | if (qcow2_co_encrypt(bs, cluster_offset, | ||
118 | src_cluster_offset + offset_in_cluster, | ||
119 | diff --git a/block/qcow2.c b/block/qcow2.c | ||
120 | index XXXXXXX..XXXXXXX 100644 | ||
121 | --- a/block/qcow2.c | ||
122 | +++ b/block/qcow2.c | ||
123 | @@ -XXX,XX +XXX,XX @@ static coroutine_fn int qcow2_co_preadv_part(BlockDriverState *bs, | ||
124 | goto fail; | ||
125 | } | ||
126 | |||
127 | - assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
128 | - assert((cur_bytes & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
129 | + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | ||
130 | + assert(QEMU_IS_ALIGNED(cur_bytes, BDRV_SECTOR_SIZE)); | ||
131 | if (qcow2_co_decrypt(bs, cluster_offset, offset, | ||
132 | cluster_data, cur_bytes) < 0) { | ||
133 | ret = -EIO; | ||
134 | diff --git a/block/vvfat.c b/block/vvfat.c | ||
135 | index XXXXXXX..XXXXXXX 100644 | ||
136 | --- a/block/vvfat.c | ||
137 | +++ b/block/vvfat.c | ||
138 | @@ -XXX,XX +XXX,XX @@ vvfat_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, | ||
139 | int nb_sectors = bytes >> BDRV_SECTOR_BITS; | ||
140 | void *buf; | ||
141 | |||
142 | - assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
143 | - assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
144 | + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | ||
145 | + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
146 | |||
147 | buf = g_try_malloc(bytes); | ||
148 | if (bytes && buf == NULL) { | ||
149 | @@ -XXX,XX +XXX,XX @@ vvfat_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, | ||
150 | int nb_sectors = bytes >> BDRV_SECTOR_BITS; | ||
151 | void *buf; | ||
152 | |||
153 | - assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
154 | - assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0); | ||
155 | + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); | ||
156 | + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); | ||
157 | |||
158 | buf = g_try_malloc(bytes); | ||
159 | if (bytes && buf == NULL) { | ||
160 | diff --git a/qemu-img.c b/qemu-img.c | ||
161 | index XXXXXXX..XXXXXXX 100644 | ||
162 | --- a/qemu-img.c | ||
163 | +++ b/qemu-img.c | ||
164 | @@ -XXX,XX +XXX,XX @@ static int img_convert(int argc, char **argv) | ||
165 | int64_t sval; | ||
166 | |||
167 | sval = cvtnum(optarg); | ||
168 | - if (sval < 0 || sval & (BDRV_SECTOR_SIZE - 1) || | ||
169 | + if (sval < 0 || !QEMU_IS_ALIGNED(sval, BDRV_SECTOR_SIZE) || | ||
170 | sval / BDRV_SECTOR_SIZE > MAX_BUF_SECTORS) { | ||
171 | error_report("Invalid buffer size for sparse output specified. " | ||
172 | "Valid sizes are multiples of %llu up to %llu. Select " | ||
173 | -- | 23 | -- |
174 | 2.21.0 | 24 | 2.31.1 |
175 | 25 | ||
176 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Nir Soffer <nirsof@gmail.com> | ||
2 | 1 | ||
3 | Replace confusing usage: | ||
4 | |||
5 | ~BDRV_SECTOR_MASK | ||
6 | |||
7 | With more clear: | ||
8 | |||
9 | (BDRV_SECTOR_SIZE - 1) | ||
10 | |||
11 | Remove BDRV_SECTOR_MASK and the unused BDRV_BLOCK_OFFSET_MASK which was | ||
12 | it's last user. | ||
13 | |||
14 | Signed-off-by: Nir Soffer <nsoffer@redhat.com> | ||
15 | Message-id: 20190827185913.27427-3-nsoffer@redhat.com | ||
16 | Reviewed-by: Juan Quintela <quintela@redhat.com> | ||
17 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
18 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
19 | --- | ||
20 | include/block/block.h | 2 -- | ||
21 | migration/block.c | 2 +- | ||
22 | 2 files changed, 1 insertion(+), 3 deletions(-) | ||
23 | |||
24 | diff --git a/include/block/block.h b/include/block/block.h | ||
25 | index XXXXXXX..XXXXXXX 100644 | ||
26 | --- a/include/block/block.h | ||
27 | +++ b/include/block/block.h | ||
28 | @@ -XXX,XX +XXX,XX @@ typedef struct HDGeometry { | ||
29 | |||
30 | #define BDRV_SECTOR_BITS 9 | ||
31 | #define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS) | ||
32 | -#define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1) | ||
33 | |||
34 | #define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \ | ||
35 | INT_MAX >> BDRV_SECTOR_BITS) | ||
36 | @@ -XXX,XX +XXX,XX @@ typedef struct HDGeometry { | ||
37 | #define BDRV_BLOCK_ALLOCATED 0x10 | ||
38 | #define BDRV_BLOCK_EOF 0x20 | ||
39 | #define BDRV_BLOCK_RECURSE 0x40 | ||
40 | -#define BDRV_BLOCK_OFFSET_MASK BDRV_SECTOR_MASK | ||
41 | |||
42 | typedef QSIMPLEQ_HEAD(BlockReopenQueue, BlockReopenQueueEntry) BlockReopenQueue; | ||
43 | |||
44 | diff --git a/migration/block.c b/migration/block.c | ||
45 | index XXXXXXX..XXXXXXX 100644 | ||
46 | --- a/migration/block.c | ||
47 | +++ b/migration/block.c | ||
48 | @@ -XXX,XX +XXX,XX @@ static int block_load(QEMUFile *f, void *opaque, int version_id) | ||
49 | do { | ||
50 | addr = qemu_get_be64(f); | ||
51 | |||
52 | - flags = addr & ~BDRV_SECTOR_MASK; | ||
53 | + flags = addr & (BDRV_SECTOR_SIZE - 1); | ||
54 | addr >>= BDRV_SECTOR_BITS; | ||
55 | |||
56 | if (flags & BLK_MIG_FLAG_DEVICE_BLOCK) { | ||
57 | -- | ||
58 | 2.21.0 | ||
59 | |||
60 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Thomas Huth <thuth@redhat.com> | ||
2 | 1 | ||
3 | When running "make check -j8" or something similar, the iotests are | ||
4 | running in parallel with the other tests. So when they are printing | ||
5 | out "Passed all xx tests" or a similar status message at the end, | ||
6 | it might not be quite clear that this message belongs to the iotests, | ||
7 | since the output might be mixed with the other tests. Thus change the | ||
8 | word "tests" here to "iotests" instead to avoid confusion. | ||
9 | |||
10 | Signed-off-by: Thomas Huth <thuth@redhat.com> | ||
11 | Message-id: 20190906113920.11271-1-thuth@redhat.com | ||
12 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
13 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
14 | --- | ||
15 | tests/qemu-iotests/check | 8 ++++---- | ||
16 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
17 | |||
18 | diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check | ||
19 | index XXXXXXX..XXXXXXX 100755 | ||
20 | --- a/tests/qemu-iotests/check | ||
21 | +++ b/tests/qemu-iotests/check | ||
22 | @@ -XXX,XX +XXX,XX @@ END { if (NR > 0) { | ||
23 | if [ ! -z "$n_bad" -a $n_bad != 0 ] | ||
24 | then | ||
25 | echo "Failures:$bad" | ||
26 | - echo "Failed $n_bad of $try tests" | ||
27 | + echo "Failed $n_bad of $try iotests" | ||
28 | echo "Failures:$bad" | fmt >>check.log | ||
29 | - echo "Failed $n_bad of $try tests" >>check.log | ||
30 | + echo "Failed $n_bad of $try iotests" >>check.log | ||
31 | else | ||
32 | - echo "Passed all $try tests" | ||
33 | - echo "Passed all $try tests" >>check.log | ||
34 | + echo "Passed all $try iotests" | ||
35 | + echo "Passed all $try iotests" >>check.log | ||
36 | fi | ||
37 | needwrap=false | ||
38 | fi | ||
39 | -- | ||
40 | 2.21.0 | ||
41 | |||
42 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Thomas Huth <thuth@redhat.com> | ||
2 | 1 | ||
3 | The check script is already printing out which iotest is currently | ||
4 | running, so printing out the name of the check-block.sh shell script | ||
5 | looks superfluous here. | ||
6 | |||
7 | Signed-off-by: Thomas Huth <thuth@redhat.com> | ||
8 | Message-id: 20190906113534.10907-1-thuth@redhat.com | ||
9 | Acked-by: John Snow <jsnow@redhat.com> | ||
10 | Reviewed-by: Max Reitz <mreitz@redhat.com> | ||
11 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
12 | --- | ||
13 | tests/Makefile.include | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/tests/Makefile.include b/tests/Makefile.include | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/tests/Makefile.include | ||
19 | +++ b/tests/Makefile.include | ||
20 | @@ -XXX,XX +XXX,XX @@ QEMU_IOTESTS_HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = tests/qemu | ||
21 | check-tests/check-block.sh: tests/check-block.sh qemu-img$(EXESUF) \ | ||
22 | qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \ | ||
23 | $(patsubst %,%/all,$(filter %-softmmu,$(TARGET_DIRS))) | ||
24 | - $< | ||
25 | + @$< | ||
26 | |||
27 | .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y)) | ||
28 | $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json | ||
29 | -- | ||
30 | 2.21.0 | ||
31 | |||
32 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | ||
2 | 1 | ||
3 | qemu-io now prefixes its error and warnings with "qemu-io:". | ||
4 | 36b9986b08787019e fixed a lot of iotests output but forget about | ||
5 | 026.out.nocache. Fix it too. | ||
6 | |||
7 | Fixes: 99e98d7c9fc1a1639fad ("qemu-io: Use error_[gs]et_progname()") | ||
8 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | ||
9 | Message-id: 20190816153015.447957-2-vsementsov@virtuozzo.com | ||
10 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
11 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
12 | --- | ||
13 | tests/qemu-iotests/026.out.nocache | 168 ++++++++++++++--------------- | ||
14 | 1 file changed, 84 insertions(+), 84 deletions(-) | ||
15 | |||
16 | diff --git a/tests/qemu-iotests/026.out.nocache b/tests/qemu-iotests/026.out.nocache | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/tests/qemu-iotests/026.out.nocache | ||
19 | +++ b/tests/qemu-iotests/026.out.nocache | ||
20 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
21 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
22 | |||
23 | Event: l1_update; errno: 5; imm: off; once: off; write | ||
24 | -Failed to flush the L2 table cache: Input/output error | ||
25 | -Failed to flush the refcount block cache: Input/output error | ||
26 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
27 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
28 | write failed: Input/output error | ||
29 | |||
30 | 1 leaked clusters were found on the image. | ||
31 | @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. | ||
32 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
33 | |||
34 | Event: l1_update; errno: 5; imm: off; once: off; write -b | ||
35 | -Failed to flush the L2 table cache: Input/output error | ||
36 | -Failed to flush the refcount block cache: Input/output error | ||
37 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
38 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
39 | write failed: Input/output error | ||
40 | |||
41 | 1 leaked clusters were found on the image. | ||
42 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
43 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
44 | |||
45 | Event: l1_update; errno: 28; imm: off; once: off; write | ||
46 | -Failed to flush the L2 table cache: No space left on device | ||
47 | -Failed to flush the refcount block cache: No space left on device | ||
48 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
49 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
50 | write failed: No space left on device | ||
51 | |||
52 | 1 leaked clusters were found on the image. | ||
53 | @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. | ||
54 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
55 | |||
56 | Event: l1_update; errno: 28; imm: off; once: off; write -b | ||
57 | -Failed to flush the L2 table cache: No space left on device | ||
58 | -Failed to flush the refcount block cache: No space left on device | ||
59 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
60 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
61 | write failed: No space left on device | ||
62 | |||
63 | 1 leaked clusters were found on the image. | ||
64 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
65 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
66 | |||
67 | Event: l2_update; errno: 5; imm: off; once: off; write | ||
68 | -Failed to flush the L2 table cache: Input/output error | ||
69 | -Failed to flush the refcount block cache: Input/output error | ||
70 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
71 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
72 | wrote 131072/131072 bytes at offset 0 | ||
73 | 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
74 | |||
75 | @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. | ||
76 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
77 | |||
78 | Event: l2_update; errno: 5; imm: off; once: off; write -b | ||
79 | -Failed to flush the L2 table cache: Input/output error | ||
80 | -Failed to flush the refcount block cache: Input/output error | ||
81 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
82 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
83 | wrote 131072/131072 bytes at offset 0 | ||
84 | 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
85 | |||
86 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
87 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
88 | |||
89 | Event: l2_update; errno: 28; imm: off; once: off; write | ||
90 | -Failed to flush the L2 table cache: No space left on device | ||
91 | -Failed to flush the refcount block cache: No space left on device | ||
92 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
93 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
94 | wrote 131072/131072 bytes at offset 0 | ||
95 | 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
96 | |||
97 | @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. | ||
98 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
99 | |||
100 | Event: l2_update; errno: 28; imm: off; once: off; write -b | ||
101 | -Failed to flush the L2 table cache: No space left on device | ||
102 | -Failed to flush the refcount block cache: No space left on device | ||
103 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
104 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
105 | wrote 131072/131072 bytes at offset 0 | ||
106 | 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
107 | |||
108 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
109 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
110 | |||
111 | Event: l2_alloc_write; errno: 5; imm: off; once: off; write | ||
112 | -Failed to flush the L2 table cache: Input/output error | ||
113 | -Failed to flush the refcount block cache: Input/output error | ||
114 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
115 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
116 | write failed: Input/output error | ||
117 | No errors were found on the image. | ||
118 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
119 | |||
120 | Event: l2_alloc_write; errno: 5; imm: off; once: off; write -b | ||
121 | -Failed to flush the L2 table cache: Input/output error | ||
122 | -Failed to flush the refcount block cache: Input/output error | ||
123 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
124 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
125 | write failed: Input/output error | ||
126 | |||
127 | 1 leaked clusters were found on the image. | ||
128 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
129 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
130 | |||
131 | Event: l2_alloc_write; errno: 28; imm: off; once: off; write | ||
132 | -Failed to flush the L2 table cache: No space left on device | ||
133 | -Failed to flush the refcount block cache: No space left on device | ||
134 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
135 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
136 | write failed: No space left on device | ||
137 | No errors were found on the image. | ||
138 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
139 | |||
140 | Event: l2_alloc_write; errno: 28; imm: off; once: off; write -b | ||
141 | -Failed to flush the L2 table cache: No space left on device | ||
142 | -Failed to flush the refcount block cache: No space left on device | ||
143 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
144 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
145 | write failed: No space left on device | ||
146 | |||
147 | 1 leaked clusters were found on the image. | ||
148 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
149 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
150 | |||
151 | Event: write_aio; errno: 5; imm: off; once: off; write | ||
152 | -Failed to flush the L2 table cache: Input/output error | ||
153 | -Failed to flush the refcount block cache: Input/output error | ||
154 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
155 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
156 | write failed: Input/output error | ||
157 | No errors were found on the image. | ||
158 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
159 | |||
160 | Event: write_aio; errno: 5; imm: off; once: off; write -b | ||
161 | -Failed to flush the L2 table cache: Input/output error | ||
162 | -Failed to flush the refcount block cache: Input/output error | ||
163 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
164 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
165 | write failed: Input/output error | ||
166 | No errors were found on the image. | ||
167 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
168 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
169 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
170 | |||
171 | Event: write_aio; errno: 28; imm: off; once: off; write | ||
172 | -Failed to flush the L2 table cache: No space left on device | ||
173 | -Failed to flush the refcount block cache: No space left on device | ||
174 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
175 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
176 | write failed: No space left on device | ||
177 | No errors were found on the image. | ||
178 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
179 | |||
180 | Event: write_aio; errno: 28; imm: off; once: off; write -b | ||
181 | -Failed to flush the L2 table cache: No space left on device | ||
182 | -Failed to flush the refcount block cache: No space left on device | ||
183 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
184 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
185 | write failed: No space left on device | ||
186 | No errors were found on the image. | ||
187 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
188 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
189 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
190 | |||
191 | Event: refblock_load; errno: 5; imm: off; once: off; write | ||
192 | -Failed to flush the L2 table cache: Input/output error | ||
193 | -Failed to flush the refcount block cache: Input/output error | ||
194 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
195 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
196 | write failed: Input/output error | ||
197 | No errors were found on the image. | ||
198 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
199 | |||
200 | Event: refblock_load; errno: 5; imm: off; once: off; write -b | ||
201 | -Failed to flush the L2 table cache: Input/output error | ||
202 | -Failed to flush the refcount block cache: Input/output error | ||
203 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
204 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
205 | write failed: Input/output error | ||
206 | No errors were found on the image. | ||
207 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
208 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
209 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
210 | |||
211 | Event: refblock_load; errno: 28; imm: off; once: off; write | ||
212 | -Failed to flush the L2 table cache: No space left on device | ||
213 | -Failed to flush the refcount block cache: No space left on device | ||
214 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
215 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
216 | write failed: No space left on device | ||
217 | No errors were found on the image. | ||
218 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
219 | |||
220 | Event: refblock_load; errno: 28; imm: off; once: off; write -b | ||
221 | -Failed to flush the L2 table cache: No space left on device | ||
222 | -Failed to flush the refcount block cache: No space left on device | ||
223 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
224 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
225 | write failed: No space left on device | ||
226 | No errors were found on the image. | ||
227 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
228 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
229 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
230 | |||
231 | Event: refblock_update_part; errno: 5; imm: off; once: off; write | ||
232 | -Failed to flush the L2 table cache: Input/output error | ||
233 | -Failed to flush the refcount block cache: Input/output error | ||
234 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
235 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
236 | write failed: Input/output error | ||
237 | No errors were found on the image. | ||
238 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
239 | |||
240 | Event: refblock_update_part; errno: 5; imm: off; once: off; write -b | ||
241 | -Failed to flush the L2 table cache: Input/output error | ||
242 | -Failed to flush the refcount block cache: Input/output error | ||
243 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
244 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
245 | write failed: Input/output error | ||
246 | No errors were found on the image. | ||
247 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
248 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
249 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
250 | |||
251 | Event: refblock_update_part; errno: 28; imm: off; once: off; write | ||
252 | -Failed to flush the L2 table cache: No space left on device | ||
253 | -Failed to flush the refcount block cache: No space left on device | ||
254 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
255 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
256 | write failed: No space left on device | ||
257 | No errors were found on the image. | ||
258 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
259 | |||
260 | Event: refblock_update_part; errno: 28; imm: off; once: off; write -b | ||
261 | -Failed to flush the L2 table cache: No space left on device | ||
262 | -Failed to flush the refcount block cache: No space left on device | ||
263 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
264 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
265 | write failed: No space left on device | ||
266 | No errors were found on the image. | ||
267 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
268 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
269 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
270 | |||
271 | Event: refblock_alloc; errno: 5; imm: off; once: off; write | ||
272 | -Failed to flush the L2 table cache: Input/output error | ||
273 | -Failed to flush the refcount block cache: Input/output error | ||
274 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
275 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
276 | write failed: Input/output error | ||
277 | No errors were found on the image. | ||
278 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
279 | |||
280 | Event: refblock_alloc; errno: 5; imm: off; once: off; write -b | ||
281 | -Failed to flush the L2 table cache: Input/output error | ||
282 | -Failed to flush the refcount block cache: Input/output error | ||
283 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
284 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
285 | write failed: Input/output error | ||
286 | No errors were found on the image. | ||
287 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
288 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
289 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
290 | |||
291 | Event: refblock_alloc; errno: 28; imm: off; once: off; write | ||
292 | -Failed to flush the L2 table cache: No space left on device | ||
293 | -Failed to flush the refcount block cache: No space left on device | ||
294 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
295 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
296 | write failed: No space left on device | ||
297 | No errors were found on the image. | ||
298 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
299 | |||
300 | Event: refblock_alloc; errno: 28; imm: off; once: off; write -b | ||
301 | -Failed to flush the L2 table cache: No space left on device | ||
302 | -Failed to flush the refcount block cache: No space left on device | ||
303 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
304 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
305 | write failed: No space left on device | ||
306 | No errors were found on the image. | ||
307 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
308 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
309 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
310 | |||
311 | Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write | ||
312 | -Failed to flush the L2 table cache: No space left on device | ||
313 | -Failed to flush the refcount block cache: No space left on device | ||
314 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
315 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
316 | write failed: No space left on device | ||
317 | |||
318 | 55 leaked clusters were found on the image. | ||
319 | @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. | ||
320 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
321 | |||
322 | Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write -b | ||
323 | -Failed to flush the L2 table cache: No space left on device | ||
324 | -Failed to flush the refcount block cache: No space left on device | ||
325 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
326 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
327 | write failed: No space left on device | ||
328 | |||
329 | 251 leaked clusters were found on the image. | ||
330 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
331 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
332 | |||
333 | Event: refblock_alloc_write; errno: 28; imm: off; once: off; write | ||
334 | -Failed to flush the L2 table cache: No space left on device | ||
335 | -Failed to flush the refcount block cache: No space left on device | ||
336 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
337 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
338 | write failed: No space left on device | ||
339 | No errors were found on the image. | ||
340 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
341 | |||
342 | Event: refblock_alloc_write; errno: 28; imm: off; once: off; write -b | ||
343 | -Failed to flush the L2 table cache: No space left on device | ||
344 | -Failed to flush the refcount block cache: No space left on device | ||
345 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
346 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
347 | write failed: No space left on device | ||
348 | No errors were found on the image. | ||
349 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
350 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
351 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
352 | |||
353 | Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write | ||
354 | -Failed to flush the L2 table cache: No space left on device | ||
355 | -Failed to flush the refcount block cache: No space left on device | ||
356 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
357 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
358 | write failed: No space left on device | ||
359 | |||
360 | 10 leaked clusters were found on the image. | ||
361 | @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. | ||
362 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
363 | |||
364 | Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write -b | ||
365 | -Failed to flush the L2 table cache: No space left on device | ||
366 | -Failed to flush the refcount block cache: No space left on device | ||
367 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
368 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
369 | write failed: No space left on device | ||
370 | |||
371 | 23 leaked clusters were found on the image. | ||
372 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
373 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
374 | |||
375 | Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write | ||
376 | -Failed to flush the L2 table cache: No space left on device | ||
377 | -Failed to flush the refcount block cache: No space left on device | ||
378 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
379 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
380 | write failed: No space left on device | ||
381 | |||
382 | 10 leaked clusters were found on the image. | ||
383 | @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. | ||
384 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
385 | |||
386 | Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write -b | ||
387 | -Failed to flush the L2 table cache: No space left on device | ||
388 | -Failed to flush the refcount block cache: No space left on device | ||
389 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
390 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
391 | write failed: No space left on device | ||
392 | |||
393 | 23 leaked clusters were found on the image. | ||
394 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
395 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
396 | |||
397 | Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write | ||
398 | -Failed to flush the L2 table cache: No space left on device | ||
399 | -Failed to flush the refcount block cache: No space left on device | ||
400 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
401 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
402 | write failed: No space left on device | ||
403 | |||
404 | 10 leaked clusters were found on the image. | ||
405 | @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. | ||
406 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
407 | |||
408 | Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write -b | ||
409 | -Failed to flush the L2 table cache: No space left on device | ||
410 | -Failed to flush the refcount block cache: No space left on device | ||
411 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
412 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
413 | write failed: No space left on device | ||
414 | |||
415 | 23 leaked clusters were found on the image. | ||
416 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
417 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
418 | |||
419 | Event: l1_grow_write_table; errno: 5; imm: off; once: off | ||
420 | -Failed to flush the L2 table cache: Input/output error | ||
421 | -Failed to flush the refcount block cache: Input/output error | ||
422 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
423 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
424 | write failed: Input/output error | ||
425 | No errors were found on the image. | ||
426 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
427 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
428 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
429 | |||
430 | Event: l1_grow_write_table; errno: 28; imm: off; once: off | ||
431 | -Failed to flush the L2 table cache: No space left on device | ||
432 | -Failed to flush the refcount block cache: No space left on device | ||
433 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
434 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
435 | write failed: No space left on device | ||
436 | No errors were found on the image. | ||
437 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
438 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
439 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
440 | |||
441 | Event: l1_grow_activate_table; errno: 5; imm: off; once: off | ||
442 | -Failed to flush the L2 table cache: Input/output error | ||
443 | -Failed to flush the refcount block cache: Input/output error | ||
444 | +qemu-io: Failed to flush the L2 table cache: Input/output error | ||
445 | +qemu-io: Failed to flush the refcount block cache: Input/output error | ||
446 | write failed: Input/output error | ||
447 | |||
448 | 96 leaked clusters were found on the image. | ||
449 | @@ -XXX,XX +XXX,XX @@ No errors were found on the image. | ||
450 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 | ||
451 | |||
452 | Event: l1_grow_activate_table; errno: 28; imm: off; once: off | ||
453 | -Failed to flush the L2 table cache: No space left on device | ||
454 | -Failed to flush the refcount block cache: No space left on device | ||
455 | +qemu-io: Failed to flush the L2 table cache: No space left on device | ||
456 | +qemu-io: Failed to flush the refcount block cache: No space left on device | ||
457 | write failed: No space left on device | ||
458 | |||
459 | 96 leaked clusters were found on the image. | ||
460 | -- | ||
461 | 2.21.0 | ||
462 | |||
463 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | A follow-up patch will make curl_multi_do() and curl_multi_read() take a | ||
2 | CURLSocket instead of the CURLState. They still need the latter, | ||
3 | though, so add a pointer to it to the former. | ||
4 | 1 | ||
5 | Cc: qemu-stable@nongnu.org | ||
6 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
7 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
8 | Message-id: 20190910124136.10565-2-mreitz@redhat.com | ||
9 | Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> | ||
10 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
11 | --- | ||
12 | block/curl.c | 3 +++ | ||
13 | 1 file changed, 3 insertions(+) | ||
14 | |||
15 | diff --git a/block/curl.c b/block/curl.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/block/curl.c | ||
18 | +++ b/block/curl.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static CURLMcode __curl_multi_socket_action(CURLM *multi_handle, | ||
20 | #define CURL_BLOCK_OPT_TIMEOUT_DEFAULT 5 | ||
21 | |||
22 | struct BDRVCURLState; | ||
23 | +struct CURLState; | ||
24 | |||
25 | static bool libcurl_initialized; | ||
26 | |||
27 | @@ -XXX,XX +XXX,XX @@ typedef struct CURLAIOCB { | ||
28 | |||
29 | typedef struct CURLSocket { | ||
30 | int fd; | ||
31 | + struct CURLState *state; | ||
32 | QLIST_ENTRY(CURLSocket) next; | ||
33 | } CURLSocket; | ||
34 | |||
35 | @@ -XXX,XX +XXX,XX @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, | ||
36 | if (!socket) { | ||
37 | socket = g_new0(CURLSocket, 1); | ||
38 | socket->fd = fd; | ||
39 | + socket->state = state; | ||
40 | QLIST_INSERT_HEAD(&state->sockets, socket, next); | ||
41 | } | ||
42 | socket = NULL; | ||
43 | -- | ||
44 | 2.21.0 | ||
45 | |||
46 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | This does not really change anything, but it makes the code a bit easier | ||
2 | to follow once we use @socket as the opaque pointer for | ||
3 | aio_set_fd_handler(). | ||
4 | 1 | ||
5 | Cc: qemu-stable@nongnu.org | ||
6 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
7 | Message-id: 20190910124136.10565-3-mreitz@redhat.com | ||
8 | Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> | ||
9 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
10 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
11 | --- | ||
12 | block/curl.c | 10 +++++----- | ||
13 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
14 | |||
15 | diff --git a/block/curl.c b/block/curl.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/block/curl.c | ||
18 | +++ b/block/curl.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, | ||
20 | |||
21 | QLIST_FOREACH(socket, &state->sockets, next) { | ||
22 | if (socket->fd == fd) { | ||
23 | - if (action == CURL_POLL_REMOVE) { | ||
24 | - QLIST_REMOVE(socket, next); | ||
25 | - g_free(socket); | ||
26 | - } | ||
27 | break; | ||
28 | } | ||
29 | } | ||
30 | @@ -XXX,XX +XXX,XX @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, | ||
31 | socket->state = state; | ||
32 | QLIST_INSERT_HEAD(&state->sockets, socket, next); | ||
33 | } | ||
34 | - socket = NULL; | ||
35 | |||
36 | trace_curl_sock_cb(action, (int)fd); | ||
37 | switch (action) { | ||
38 | @@ -XXX,XX +XXX,XX @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, | ||
39 | break; | ||
40 | } | ||
41 | |||
42 | + if (action == CURL_POLL_REMOVE) { | ||
43 | + QLIST_REMOVE(socket, next); | ||
44 | + g_free(socket); | ||
45 | + } | ||
46 | + | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | -- | ||
51 | 2.21.0 | ||
52 | |||
53 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | While it is more likely that transfers complete after some file | ||
2 | descriptor has data ready to read, we probably should not rely on it. | ||
3 | Better be safe than sorry and call curl_multi_check_completion() in | ||
4 | curl_multi_do(), too, just like it is done in curl_multi_read(). | ||
5 | 1 | ||
6 | With this change, curl_multi_do() and curl_multi_read() are actually the | ||
7 | same, so drop curl_multi_read() and use curl_multi_do() as the sole FD | ||
8 | handler. | ||
9 | |||
10 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
11 | Message-id: 20190910124136.10565-4-mreitz@redhat.com | ||
12 | Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> | ||
13 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
14 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
15 | --- | ||
16 | block/curl.c | 14 ++------------ | ||
17 | 1 file changed, 2 insertions(+), 12 deletions(-) | ||
18 | |||
19 | diff --git a/block/curl.c b/block/curl.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/block/curl.c | ||
22 | +++ b/block/curl.c | ||
23 | @@ -XXX,XX +XXX,XX @@ typedef struct BDRVCURLState { | ||
24 | |||
25 | static void curl_clean_state(CURLState *s); | ||
26 | static void curl_multi_do(void *arg); | ||
27 | -static void curl_multi_read(void *arg); | ||
28 | |||
29 | #ifdef NEED_CURL_TIMER_CALLBACK | ||
30 | /* Called from curl_multi_do_locked, with s->mutex held. */ | ||
31 | @@ -XXX,XX +XXX,XX @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, | ||
32 | switch (action) { | ||
33 | case CURL_POLL_IN: | ||
34 | aio_set_fd_handler(s->aio_context, fd, false, | ||
35 | - curl_multi_read, NULL, NULL, state); | ||
36 | + curl_multi_do, NULL, NULL, state); | ||
37 | break; | ||
38 | case CURL_POLL_OUT: | ||
39 | aio_set_fd_handler(s->aio_context, fd, false, | ||
40 | @@ -XXX,XX +XXX,XX @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, | ||
41 | break; | ||
42 | case CURL_POLL_INOUT: | ||
43 | aio_set_fd_handler(s->aio_context, fd, false, | ||
44 | - curl_multi_read, curl_multi_do, NULL, state); | ||
45 | + curl_multi_do, curl_multi_do, NULL, state); | ||
46 | break; | ||
47 | case CURL_POLL_REMOVE: | ||
48 | aio_set_fd_handler(s->aio_context, fd, false, | ||
49 | @@ -XXX,XX +XXX,XX @@ static void curl_multi_do(void *arg) | ||
50 | { | ||
51 | CURLState *s = (CURLState *)arg; | ||
52 | |||
53 | - qemu_mutex_lock(&s->s->mutex); | ||
54 | - curl_multi_do_locked(s); | ||
55 | - qemu_mutex_unlock(&s->s->mutex); | ||
56 | -} | ||
57 | - | ||
58 | -static void curl_multi_read(void *arg) | ||
59 | -{ | ||
60 | - CURLState *s = (CURLState *)arg; | ||
61 | - | ||
62 | qemu_mutex_lock(&s->s->mutex); | ||
63 | curl_multi_do_locked(s); | ||
64 | curl_multi_check_completion(s->s); | ||
65 | -- | ||
66 | 2.21.0 | ||
67 | |||
68 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Background: As of cURL 7.59.0, it verifies that several functions are | ||
2 | not called from within a callback. Among these functions is | ||
3 | curl_multi_add_handle(). | ||
4 | 1 | ||
5 | curl_read_cb() is a callback from cURL and not a coroutine. Waking up | ||
6 | acb->co will lead to entering it then and there, which means the current | ||
7 | request will settle and the caller (if it runs in the same coroutine) | ||
8 | may then issue the next request. In such a case, we will enter | ||
9 | curl_setup_preadv() effectively from within curl_read_cb(). | ||
10 | |||
11 | Calling curl_multi_add_handle() will then fail and the new request will | ||
12 | not be processed. | ||
13 | |||
14 | Fix this by not letting curl_read_cb() wake up acb->co. Instead, leave | ||
15 | the whole business of settling the AIOCB objects to | ||
16 | curl_multi_check_completion() (which is called from our timer callback | ||
17 | and our FD handler, so not from any cURL callbacks). | ||
18 | |||
19 | Reported-by: Natalie Gavrielov <ngavrilo@redhat.com> | ||
20 | Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1740193 | ||
21 | Cc: qemu-stable@nongnu.org | ||
22 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
23 | Message-id: 20190910124136.10565-7-mreitz@redhat.com | ||
24 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
25 | Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> | ||
26 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
27 | --- | ||
28 | block/curl.c | 69 ++++++++++++++++++++++------------------------------ | ||
29 | 1 file changed, 29 insertions(+), 40 deletions(-) | ||
30 | |||
31 | diff --git a/block/curl.c b/block/curl.c | ||
32 | index XXXXXXX..XXXXXXX 100644 | ||
33 | --- a/block/curl.c | ||
34 | +++ b/block/curl.c | ||
35 | @@ -XXX,XX +XXX,XX @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque) | ||
36 | { | ||
37 | CURLState *s = ((CURLState*)opaque); | ||
38 | size_t realsize = size * nmemb; | ||
39 | - int i; | ||
40 | |||
41 | trace_curl_read_cb(realsize); | ||
42 | |||
43 | @@ -XXX,XX +XXX,XX @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque) | ||
44 | memcpy(s->orig_buf + s->buf_off, ptr, realsize); | ||
45 | s->buf_off += realsize; | ||
46 | |||
47 | - for(i=0; i<CURL_NUM_ACB; i++) { | ||
48 | - CURLAIOCB *acb = s->acb[i]; | ||
49 | - | ||
50 | - if (!acb) | ||
51 | - continue; | ||
52 | - | ||
53 | - if ((s->buf_off >= acb->end)) { | ||
54 | - size_t request_length = acb->bytes; | ||
55 | - | ||
56 | - qemu_iovec_from_buf(acb->qiov, 0, s->orig_buf + acb->start, | ||
57 | - acb->end - acb->start); | ||
58 | - | ||
59 | - if (acb->end - acb->start < request_length) { | ||
60 | - size_t offset = acb->end - acb->start; | ||
61 | - qemu_iovec_memset(acb->qiov, offset, 0, | ||
62 | - request_length - offset); | ||
63 | - } | ||
64 | - | ||
65 | - acb->ret = 0; | ||
66 | - s->acb[i] = NULL; | ||
67 | - qemu_mutex_unlock(&s->s->mutex); | ||
68 | - aio_co_wake(acb->co); | ||
69 | - qemu_mutex_lock(&s->s->mutex); | ||
70 | - } | ||
71 | - } | ||
72 | - | ||
73 | read_end: | ||
74 | /* curl will error out if we do not return this value */ | ||
75 | return size * nmemb; | ||
76 | @@ -XXX,XX +XXX,XX @@ static void curl_multi_check_completion(BDRVCURLState *s) | ||
77 | break; | ||
78 | |||
79 | if (msg->msg == CURLMSG_DONE) { | ||
80 | + int i; | ||
81 | CURLState *state = NULL; | ||
82 | + bool error = msg->data.result != CURLE_OK; | ||
83 | + | ||
84 | curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, | ||
85 | (char **)&state); | ||
86 | |||
87 | - /* ACBs for successful messages get completed in curl_read_cb */ | ||
88 | - if (msg->data.result != CURLE_OK) { | ||
89 | - int i; | ||
90 | + if (error) { | ||
91 | static int errcount = 100; | ||
92 | |||
93 | /* Don't lose the original error message from curl, since | ||
94 | @@ -XXX,XX +XXX,XX @@ static void curl_multi_check_completion(BDRVCURLState *s) | ||
95 | error_report("curl: further errors suppressed"); | ||
96 | } | ||
97 | } | ||
98 | + } | ||
99 | |||
100 | - for (i = 0; i < CURL_NUM_ACB; i++) { | ||
101 | - CURLAIOCB *acb = state->acb[i]; | ||
102 | + for (i = 0; i < CURL_NUM_ACB; i++) { | ||
103 | + CURLAIOCB *acb = state->acb[i]; | ||
104 | |||
105 | - if (acb == NULL) { | ||
106 | - continue; | ||
107 | - } | ||
108 | + if (acb == NULL) { | ||
109 | + continue; | ||
110 | + } | ||
111 | + | ||
112 | + if (!error) { | ||
113 | + /* Assert that we have read all data */ | ||
114 | + assert(state->buf_off >= acb->end); | ||
115 | + | ||
116 | + qemu_iovec_from_buf(acb->qiov, 0, | ||
117 | + state->orig_buf + acb->start, | ||
118 | + acb->end - acb->start); | ||
119 | |||
120 | - acb->ret = -EIO; | ||
121 | - state->acb[i] = NULL; | ||
122 | - qemu_mutex_unlock(&s->mutex); | ||
123 | - aio_co_wake(acb->co); | ||
124 | - qemu_mutex_lock(&s->mutex); | ||
125 | + if (acb->end - acb->start < acb->bytes) { | ||
126 | + size_t offset = acb->end - acb->start; | ||
127 | + qemu_iovec_memset(acb->qiov, offset, 0, | ||
128 | + acb->bytes - offset); | ||
129 | + } | ||
130 | } | ||
131 | + | ||
132 | + acb->ret = error ? -EIO : 0; | ||
133 | + state->acb[i] = NULL; | ||
134 | + qemu_mutex_unlock(&s->mutex); | ||
135 | + aio_co_wake(acb->co); | ||
136 | + qemu_mutex_lock(&s->mutex); | ||
137 | } | ||
138 | |||
139 | curl_clean_state(state); | ||
140 | -- | ||
141 | 2.21.0 | ||
142 | |||
143 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | If we had done that all along, debugging would have been much simpler. | ||
2 | (Also, I/O errors are better than hangs.) | ||
3 | 1 | ||
4 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
5 | Message-id: 20190910124136.10565-8-mreitz@redhat.com | ||
6 | Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> | ||
7 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
8 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
9 | --- | ||
10 | block/curl.c | 8 +++++++- | ||
11 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/block/curl.c b/block/curl.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/block/curl.c | ||
16 | +++ b/block/curl.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static void curl_setup_preadv(BlockDriverState *bs, CURLAIOCB *acb) | ||
18 | trace_curl_setup_preadv(acb->bytes, start, state->range); | ||
19 | curl_easy_setopt(state->curl, CURLOPT_RANGE, state->range); | ||
20 | |||
21 | - curl_multi_add_handle(s->multi, state->curl); | ||
22 | + if (curl_multi_add_handle(s->multi, state->curl) != CURLM_OK) { | ||
23 | + state->acb[0] = NULL; | ||
24 | + acb->ret = -EIO; | ||
25 | + | ||
26 | + curl_clean_state(state); | ||
27 | + goto out; | ||
28 | + } | ||
29 | |||
30 | /* Tell curl it needs to kick things off */ | ||
31 | curl_multi_socket_action(s->multi, CURL_SOCKET_TIMEOUT, 0, &running); | ||
32 | -- | ||
33 | 2.21.0 | ||
34 | |||
35 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Sergio Lopez <slp@redhat.com> | ||
2 | 1 | ||
3 | block_job_remove_all_bdrv() iterates through job->nodes, calling | ||
4 | bdrv_root_unref_child() for each entry. The call to the latter may | ||
5 | reach child_job_[can_]set_aio_ctx(), which will also attempt to | ||
6 | traverse job->nodes, potentially finding entries that where freed | ||
7 | on previous iterations. | ||
8 | |||
9 | To avoid this situation, update job->nodes head on each iteration to | ||
10 | ensure that already freed entries are no longer linked to the list. | ||
11 | |||
12 | RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1746631 | ||
13 | Signed-off-by: Sergio Lopez <slp@redhat.com> | ||
14 | Cc: qemu-stable@nongnu.org | ||
15 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
16 | Message-id: 20190911100316.32282-1-mreitz@redhat.com | ||
17 | Reviewed-by: Sergio Lopez <slp@redhat.com> | ||
18 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
19 | --- | ||
20 | blockjob.c | 17 +++++++++++++---- | ||
21 | 1 file changed, 13 insertions(+), 4 deletions(-) | ||
22 | |||
23 | diff --git a/blockjob.c b/blockjob.c | ||
24 | index XXXXXXX..XXXXXXX 100644 | ||
25 | --- a/blockjob.c | ||
26 | +++ b/blockjob.c | ||
27 | @@ -XXX,XX +XXX,XX @@ static const BdrvChildRole child_job = { | ||
28 | |||
29 | void block_job_remove_all_bdrv(BlockJob *job) | ||
30 | { | ||
31 | - GSList *l; | ||
32 | - for (l = job->nodes; l; l = l->next) { | ||
33 | + /* | ||
34 | + * bdrv_root_unref_child() may reach child_job_[can_]set_aio_ctx(), | ||
35 | + * which will also traverse job->nodes, so consume the list one by | ||
36 | + * one to make sure that such a concurrent access does not attempt | ||
37 | + * to process an already freed BdrvChild. | ||
38 | + */ | ||
39 | + while (job->nodes) { | ||
40 | + GSList *l = job->nodes; | ||
41 | BdrvChild *c = l->data; | ||
42 | + | ||
43 | + job->nodes = l->next; | ||
44 | + | ||
45 | bdrv_op_unblock_all(c->bs, job->blocker); | ||
46 | bdrv_root_unref_child(c); | ||
47 | + | ||
48 | + g_slist_free_1(l); | ||
49 | } | ||
50 | - g_slist_free(job->nodes); | ||
51 | - job->nodes = NULL; | ||
52 | } | ||
53 | |||
54 | bool block_job_has_bdrv(BlockJob *job, BlockDriverState *bs) | ||
55 | -- | ||
56 | 2.21.0 | ||
57 | |||
58 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Maxim Levitsky <mlevitsk@redhat.com> | ||
2 | 1 | ||
3 | Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> | ||
4 | Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | ||
5 | Message-id: 20190915203655.21638-4-mlevitsk@redhat.com | ||
6 | Reviewed-by: Max Reitz <mreitz@redhat.com> | ||
7 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
8 | --- | ||
9 | tests/qemu-iotests/263 | 91 ++++++++++++++++++++++++++++++++++++++ | ||
10 | tests/qemu-iotests/263.out | 40 +++++++++++++++++ | ||
11 | tests/qemu-iotests/group | 1 + | ||
12 | 3 files changed, 132 insertions(+) | ||
13 | create mode 100755 tests/qemu-iotests/263 | ||
14 | create mode 100644 tests/qemu-iotests/263.out | ||
15 | |||
16 | diff --git a/tests/qemu-iotests/263 b/tests/qemu-iotests/263 | ||
17 | new file mode 100755 | ||
18 | index XXXXXXX..XXXXXXX | ||
19 | --- /dev/null | ||
20 | +++ b/tests/qemu-iotests/263 | ||
21 | @@ -XXX,XX +XXX,XX @@ | ||
22 | +#!/usr/bin/env bash | ||
23 | +# | ||
24 | +# Test encrypted write that crosses cluster boundary of two unallocated clusters | ||
25 | +# Based on 188 | ||
26 | +# | ||
27 | +# Copyright (C) 2019 Red Hat, Inc. | ||
28 | +# | ||
29 | +# This program is free software; you can redistribute it and/or modify | ||
30 | +# it under the terms of the GNU General Public License as published by | ||
31 | +# the Free Software Foundation; either version 2 of the License, or | ||
32 | +# (at your option) any later version. | ||
33 | +# | ||
34 | +# This program is distributed in the hope that it will be useful, | ||
35 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
36 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
37 | +# GNU General Public License for more details. | ||
38 | +# | ||
39 | +# You should have received a copy of the GNU General Public License | ||
40 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
41 | +# | ||
42 | + | ||
43 | +# creator | ||
44 | +owner=mlevitsk@redhat.com | ||
45 | + | ||
46 | +seq=`basename $0` | ||
47 | +echo "QA output created by $seq" | ||
48 | + | ||
49 | +status=1 # failure is the default! | ||
50 | + | ||
51 | +_cleanup() | ||
52 | +{ | ||
53 | + _cleanup_test_img | ||
54 | +} | ||
55 | +trap "_cleanup; exit \$status" 0 1 2 3 15 | ||
56 | + | ||
57 | +# get standard environment, filters and checks | ||
58 | +. ./common.rc | ||
59 | +. ./common.filter | ||
60 | + | ||
61 | +_supported_fmt qcow2 | ||
62 | +_supported_proto generic | ||
63 | +_supported_os Linux | ||
64 | + | ||
65 | + | ||
66 | +size=1M | ||
67 | + | ||
68 | +SECRET="secret,id=sec0,data=astrochicken" | ||
69 | +QEMU_IO_OPTIONS=$QEMU_IO_OPTIONS_NO_FMT | ||
70 | + | ||
71 | + | ||
72 | +_run_test() | ||
73 | +{ | ||
74 | + echo "== reading the whole image ==" | ||
75 | + $QEMU_IO --object $SECRET -c "read -P 0 0 $size" --image-opts "$1" | _filter_qemu_io | _filter_testdir | ||
76 | + | ||
77 | + echo | ||
78 | + echo "== write two 512 byte sectors on a cluster boundary ==" | ||
79 | + $QEMU_IO --object $SECRET -c "write -P 0xAA 0xFE00 0x400" --image-opts "$1" | _filter_qemu_io | _filter_testdir | ||
80 | + | ||
81 | + echo | ||
82 | + echo "== verify that the rest of the image is not changed ==" | ||
83 | + $QEMU_IO --object $SECRET -c "read -P 0x00 0x00000 0xFE00" --image-opts "$1" | _filter_qemu_io | _filter_testdir | ||
84 | + $QEMU_IO --object $SECRET -c "read -P 0xAA 0x0FE00 0x400" --image-opts "$1" | _filter_qemu_io | _filter_testdir | ||
85 | + $QEMU_IO --object $SECRET -c "read -P 0x00 0x10200 0xEFE00" --image-opts "$1" | _filter_qemu_io | _filter_testdir | ||
86 | + | ||
87 | +} | ||
88 | + | ||
89 | + | ||
90 | +echo | ||
91 | +echo "testing LUKS qcow2 encryption" | ||
92 | +echo | ||
93 | + | ||
94 | +_make_test_img --object $SECRET -o "encrypt.format=luks,encrypt.key-secret=sec0,encrypt.iter-time=10,cluster_size=64K" $size | ||
95 | +_run_test "driver=$IMGFMT,encrypt.key-secret=sec0,file.filename=$TEST_IMG" | ||
96 | +_cleanup_test_img | ||
97 | + | ||
98 | +echo | ||
99 | +echo "testing legacy AES qcow2 encryption" | ||
100 | +echo | ||
101 | + | ||
102 | + | ||
103 | +_make_test_img --object $SECRET -o "encrypt.format=aes,encrypt.key-secret=sec0,cluster_size=64K" $size | ||
104 | +_run_test "driver=$IMGFMT,encrypt.key-secret=sec0,file.filename=$TEST_IMG" | ||
105 | +_cleanup_test_img | ||
106 | + | ||
107 | + | ||
108 | + | ||
109 | +# success, all done | ||
110 | +echo "*** done" | ||
111 | +rm -f $seq.full | ||
112 | +status=0 | ||
113 | diff --git a/tests/qemu-iotests/263.out b/tests/qemu-iotests/263.out | ||
114 | new file mode 100644 | ||
115 | index XXXXXXX..XXXXXXX | ||
116 | --- /dev/null | ||
117 | +++ b/tests/qemu-iotests/263.out | ||
118 | @@ -XXX,XX +XXX,XX @@ | ||
119 | +QA output created by 263 | ||
120 | + | ||
121 | +testing LUKS qcow2 encryption | ||
122 | + | ||
123 | +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 encrypt.format=luks encrypt.key-secret=sec0 encrypt.iter-time=10 | ||
124 | +== reading the whole image == | ||
125 | +read 1048576/1048576 bytes at offset 0 | ||
126 | +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
127 | + | ||
128 | +== write two 512 byte sectors on a cluster boundary == | ||
129 | +wrote 1024/1024 bytes at offset 65024 | ||
130 | +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
131 | + | ||
132 | +== verify that the rest of the image is not changed == | ||
133 | +read 65024/65024 bytes at offset 0 | ||
134 | +63.500 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
135 | +read 1024/1024 bytes at offset 65024 | ||
136 | +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
137 | +read 982528/982528 bytes at offset 66048 | ||
138 | +959.500 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
139 | + | ||
140 | +testing legacy AES qcow2 encryption | ||
141 | + | ||
142 | +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 encrypt.format=aes encrypt.key-secret=sec0 | ||
143 | +== reading the whole image == | ||
144 | +read 1048576/1048576 bytes at offset 0 | ||
145 | +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
146 | + | ||
147 | +== write two 512 byte sectors on a cluster boundary == | ||
148 | +wrote 1024/1024 bytes at offset 65024 | ||
149 | +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
150 | + | ||
151 | +== verify that the rest of the image is not changed == | ||
152 | +read 65024/65024 bytes at offset 0 | ||
153 | +63.500 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
154 | +read 1024/1024 bytes at offset 65024 | ||
155 | +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
156 | +read 982528/982528 bytes at offset 66048 | ||
157 | +959.500 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | ||
158 | +*** done | ||
159 | diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group | ||
160 | index XXXXXXX..XXXXXXX 100644 | ||
161 | --- a/tests/qemu-iotests/group | ||
162 | +++ b/tests/qemu-iotests/group | ||
163 | @@ -XXX,XX +XXX,XX @@ | ||
164 | 257 rw | ||
165 | 258 rw quick | ||
166 | 262 rw quick migration | ||
167 | +263 rw quick | ||
168 | 265 rw auto quick | ||
169 | 266 rw quick | ||
170 | -- | ||
171 | 2.21.0 | ||
172 | |||
173 | diff view generated by jsdifflib |