1
The following changes since commit ee135aa0428fe5af2af7be04ff16d2b596a9330a:
1
The following changes since commit 15ef89d2a1a7b93845a6b09c2ee8e1979f6eb30b:
2
2
3
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-3.1-20180821' into staging (2018-08-21 13:27:11 +0100)
3
Update version for v7.0.0-rc1 release (2022-03-22 22:58:44 +0000)
4
4
5
are available in the Git repository at:
5
are available in the Git repository at:
6
6
7
git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request
7
https://gitlab.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to 26bf474ba92c76e61bea51726e22da6dfd185296:
9
for you to fetch changes up to 2539eade4f689eda7e9fe45486f18334bfbafaf0:
10
10
11
block: iotest to catch abort on forced blockjob cancel (2018-08-21 15:20:37 -0400)
11
hw: Fix misleading hexadecimal format (2022-03-24 10:38:42 +0000)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Block job patches
14
Pull request
15
16
Philippe found cases where the 0x%d format string was used, leading to
17
misleading output. The patches look harmless and could save people time, so I
18
think it's worth including them in 7.0.
19
15
----------------------------------------------------------------
20
----------------------------------------------------------------
16
21
17
Jeff Cody (2):
22
Philippe Mathieu-Daudé (2):
18
block: for jobs, do not clear user_paused until after the resume
23
block: Fix misleading hexadecimal format
19
block: iotest to catch abort on forced blockjob cancel
24
hw: Fix misleading hexadecimal format
20
25
21
job.c | 2 +-
26
block/parallels-ext.c | 2 +-
22
tests/qemu-iotests/229 | 95 ++++++++++++++++++++++++++++++++++++++
27
hw/i386/sgx.c | 2 +-
23
tests/qemu-iotests/229.out | 23 +++++++++
28
hw/i386/trace-events | 6 +++---
24
tests/qemu-iotests/group | 1 +
29
hw/misc/trace-events | 4 ++--
25
4 files changed, 120 insertions(+), 1 deletion(-)
30
hw/scsi/trace-events | 4 ++--
26
create mode 100755 tests/qemu-iotests/229
31
5 files changed, 9 insertions(+), 9 deletions(-)
27
create mode 100644 tests/qemu-iotests/229.out
28
32
29
--
33
--
30
2.17.1
34
2.35.1
31
35
32
diff view generated by jsdifflib
1
The function job_cancel_async() will always cause an assert for blockjob
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
user resume. We set job->user_paused to false, and then call
3
job->driver->user_resume(). In the case of blockjobs, this is the
4
block_job_user_resume() function.
5
2
6
In that function, we assert that job.user_paused is set to true.
3
"0x%u" format is very misleading, replace by "0x%x".
7
Unfortunately, right before calling this function, it has explicitly
8
been set to false.
9
4
10
The fix is pretty simple: set job->user_paused to false only after the
5
Found running:
11
job user_resume() function has been called.
12
6
13
Reviewed-by: John Snow <jsnow@redhat.com>
7
$ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' block/
14
Reviewed-by: Eric Blake <eblake@redhat.com>
8
15
Signed-off-by: Jeff Cody <jcody@redhat.com>
9
Inspired-by: Richard Henderson <richard.henderson@linaro.org>
16
Message-id: bb183b77d8f2dd6bd67b8da559a90ac1e74b2052.1534868459.git.jcody@redhat.com
10
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
17
Signed-off-by: Jeff Cody <jcody@redhat.com>
11
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
12
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13
Reviewed-by: Denis V. Lunev <den@openvz.org>
14
Message-id: 20220323114718.58714-2-philippe.mathieu.daude@gmail.com
15
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
18
---
16
---
19
job.c | 2 +-
17
block/parallels-ext.c | 2 +-
20
1 file changed, 1 insertion(+), 1 deletion(-)
18
1 file changed, 1 insertion(+), 1 deletion(-)
21
19
22
diff --git a/job.c b/job.c
20
diff --git a/block/parallels-ext.c b/block/parallels-ext.c
23
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
24
--- a/job.c
22
--- a/block/parallels-ext.c
25
+++ b/job.c
23
+++ b/block/parallels-ext.c
26
@@ -XXX,XX +XXX,XX @@ static void job_cancel_async(Job *job, bool force)
24
@@ -XXX,XX +XXX,XX @@ static int parallels_parse_format_extension(BlockDriverState *bs,
27
{
25
break;
28
if (job->user_paused) {
26
29
/* Do not call job_enter here, the caller will handle it. */
27
default:
30
- job->user_paused = false;
28
- error_setg(errp, "Unknown feature: 0x%" PRIu64, fh.magic);
31
if (job->driver->user_resume) {
29
+ error_setg(errp, "Unknown feature: 0x%" PRIx64, fh.magic);
32
job->driver->user_resume(job);
30
goto fail;
33
}
31
}
34
+ job->user_paused = false;
32
35
assert(job->pause_count > 0);
36
job->pause_count--;
37
}
38
--
33
--
39
2.17.1
34
2.35.1
40
35
41
36
diff view generated by jsdifflib
1
Signed-off-by: Jeff Cody <jcody@redhat.com>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
Reviewed-by: John Snow <jsnow@redhat.com>
2
3
Message-id: df317f617fbe5affcf699cb8560e7b0c2e028a64.1534868459.git.jcody@redhat.com
3
"0x%u" format is very misleading, replace by "0x%x".
4
Signed-off-by: Jeff Cody <jcody@redhat.com>
4
5
Found running:
6
7
$ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' hw/
8
9
Inspired-by: Richard Henderson <richard.henderson@linaro.org>
10
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
11
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
12
Message-id: 20220323114718.58714-3-philippe.mathieu.daude@gmail.com
13
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5
---
14
---
6
tests/qemu-iotests/229 | 95 ++++++++++++++++++++++++++++++++++++++
15
hw/i386/sgx.c | 2 +-
7
tests/qemu-iotests/229.out | 23 +++++++++
16
hw/i386/trace-events | 6 +++---
8
tests/qemu-iotests/group | 1 +
17
hw/misc/trace-events | 4 ++--
9
3 files changed, 119 insertions(+)
18
hw/scsi/trace-events | 4 ++--
10
create mode 100755 tests/qemu-iotests/229
19
4 files changed, 8 insertions(+), 8 deletions(-)
11
create mode 100644 tests/qemu-iotests/229.out
12
20
13
diff --git a/tests/qemu-iotests/229 b/tests/qemu-iotests/229
21
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
14
new file mode 100755
22
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX
23
--- a/hw/i386/sgx.c
16
--- /dev/null
24
+++ b/hw/i386/sgx.c
17
+++ b/tests/qemu-iotests/229
25
@@ -XXX,XX +XXX,XX @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
26
}
27
28
if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) {
29
- error_report("Size of all 'sgx-epc' =0x%"PRIu64" causes EPC to wrap",
30
+ error_report("Size of all 'sgx-epc' =0x%"PRIx64" causes EPC to wrap",
31
sgx_epc->size);
32
exit(EXIT_FAILURE);
33
}
34
diff --git a/hw/i386/trace-events b/hw/i386/trace-events
35
index XXXXXXX..XXXXXXX 100644
36
--- a/hw/i386/trace-events
37
+++ b/hw/i386/trace-events
38
@@ -XXX,XX +XXX,XX @@ vtd_fault_disabled(void) "Fault processing disabled for context entry"
39
vtd_replay_ce_valid(const char *mode, uint8_t bus, uint8_t dev, uint8_t fn, uint16_t domain, uint64_t hi, uint64_t lo) "%s: replay valid context device %02"PRIx8":%02"PRIx8".%02"PRIx8" domain 0x%"PRIx16" hi 0x%"PRIx64" lo 0x%"PRIx64
40
vtd_replay_ce_invalid(uint8_t bus, uint8_t dev, uint8_t fn) "replay invalid context device %02"PRIx8":%02"PRIx8".%02"PRIx8
41
vtd_page_walk_level(uint64_t addr, uint32_t level, uint64_t start, uint64_t end) "walk (base=0x%"PRIx64", level=%"PRIu32") iova range 0x%"PRIx64" - 0x%"PRIx64
42
-vtd_page_walk_one(uint16_t domain, uint64_t iova, uint64_t gpa, uint64_t mask, int perm) "domain 0x%"PRIu16" iova 0x%"PRIx64" -> gpa 0x%"PRIx64" mask 0x%"PRIx64" perm %d"
43
+vtd_page_walk_one(uint16_t domain, uint64_t iova, uint64_t gpa, uint64_t mask, int perm) "domain 0x%"PRIx16" iova 0x%"PRIx64" -> gpa 0x%"PRIx64" mask 0x%"PRIx64" perm %d"
44
vtd_page_walk_one_skip_map(uint64_t iova, uint64_t mask, uint64_t translated) "iova 0x%"PRIx64" mask 0x%"PRIx64" translated 0x%"PRIx64
45
vtd_page_walk_one_skip_unmap(uint64_t iova, uint64_t mask) "iova 0x%"PRIx64" mask 0x%"PRIx64
46
vtd_page_walk_skip_read(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to unable to read"
47
vtd_page_walk_skip_reserve(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to rsrv set"
48
vtd_switch_address_space(uint8_t bus, uint8_t slot, uint8_t fn, bool on) "Device %02x:%02x.%x switching address space (iommu enabled=%d)"
49
vtd_as_unmap_whole(uint8_t bus, uint8_t slot, uint8_t fn, uint64_t iova, uint64_t size) "Device %02x:%02x.%x start 0x%"PRIx64" size 0x%"PRIx64
50
-vtd_translate_pt(uint16_t sid, uint64_t addr) "source id 0x%"PRIu16", iova 0x%"PRIx64
51
-vtd_pt_enable_fast_path(uint16_t sid, bool success) "sid 0x%"PRIu16" %d"
52
+vtd_translate_pt(uint16_t sid, uint64_t addr) "source id 0x%"PRIx16", iova 0x%"PRIx64
53
+vtd_pt_enable_fast_path(uint16_t sid, bool success) "sid 0x%"PRIx16" %d"
54
vtd_irq_generate(uint64_t addr, uint64_t data) "addr 0x%"PRIx64" data 0x%"PRIx64
55
vtd_reg_read(uint64_t addr, uint64_t size) "addr 0x%"PRIx64" size 0x%"PRIx64
56
vtd_reg_write(uint64_t addr, uint64_t size, uint64_t val) "addr 0x%"PRIx64" size 0x%"PRIx64" value 0x%"PRIx64
57
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
58
index XXXXXXX..XXXXXXX 100644
59
--- a/hw/misc/trace-events
60
+++ b/hw/misc/trace-events
18
@@ -XXX,XX +XXX,XX @@
61
@@ -XXX,XX +XXX,XX @@
19
+#!/bin/bash
62
# See docs/devel/tracing.rst for syntax documentation.
20
+#
63
21
+# Test for force canceling a running blockjob that is paused in
64
# allwinner-cpucfg.c
22
+# an error state.
65
-allwinner_cpucfg_cpu_reset(uint8_t cpu_id, uint32_t reset_addr) "id %u, reset_addr 0x%" PRIu32
23
+#
66
+allwinner_cpucfg_cpu_reset(uint8_t cpu_id, uint32_t reset_addr) "id %u, reset_addr 0x%" PRIx32
24
+# Copyright (C) 2018 Red Hat, Inc.
67
allwinner_cpucfg_read(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
25
+#
68
allwinner_cpucfg_write(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
26
+# This program is free software; you can redistribute it and/or modify
69
27
+# it under the terms of the GNU General Public License as published by
70
@@ -XXX,XX +XXX,XX @@ imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value 0x%08
28
+# the Free Software Foundation; either version 2 of the License, or
71
29
+# (at your option) any later version.
72
# mos6522.c
30
+#
73
mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d"
31
+# This program is distributed in the hope that it will be useful,
74
-mos6522_get_next_irq_time(uint16_t latch, int64_t d, int64_t delta) "latch=%d counter=0x%"PRId64 " delta_next=0x%"PRId64
32
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
75
+mos6522_get_next_irq_time(uint16_t latch, int64_t d, int64_t delta) "latch=%d counter=0x%"PRIx64 " delta_next=0x%"PRIx64
33
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
76
mos6522_set_sr_int(void) "set sr_int"
34
+# GNU General Public License for more details.
77
mos6522_write(uint64_t addr, const char *name, uint64_t val) "reg=0x%"PRIx64 " [%s] val=0x%"PRIx64
35
+#
78
mos6522_read(uint64_t addr, const char *name, unsigned val) "reg=0x%"PRIx64 " [%s] val=0x%x"
36
+# You should have received a copy of the GNU General Public License
79
diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events
37
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
38
+#
39
+
40
+# creator
41
+owner=jcody@redhat.com
42
+
43
+seq="$(basename $0)"
44
+echo "QA output created by $seq"
45
+
46
+here="$PWD"
47
+status=1    # failure is the default!
48
+
49
+_cleanup()
50
+{
51
+ _cleanup_qemu
52
+ _cleanup_test_img
53
+ rm -f "$TEST_IMG" "$DEST_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
+. ./common.qemu
61
+
62
+# Needs backing file and backing format support
63
+_supported_fmt qcow2 qed
64
+_supported_proto file
65
+_supported_os Linux
66
+
67
+
68
+DEST_IMG="$TEST_DIR/d.$IMGFMT"
69
+TEST_IMG="$TEST_DIR/b.$IMGFMT"
70
+
71
+_make_test_img 2M
72
+
73
+# destination for mirror will be too small, causing error
74
+TEST_IMG=$DEST_IMG _make_test_img 1M
75
+
76
+$QEMU_IO -c 'write 0 2M' "$TEST_IMG" | _filter_qemu_io
77
+
78
+_launch_qemu -drive id=testdisk,file="$TEST_IMG",format="$IMGFMT"
79
+
80
+_send_qemu_cmd $QEMU_HANDLE \
81
+ "{'execute': 'qmp_capabilities'}" \
82
+ 'return'
83
+
84
+echo
85
+echo '=== Starting drive-mirror, causing error & stop ==='
86
+echo
87
+
88
+_send_qemu_cmd $QEMU_HANDLE \
89
+ "{'execute': 'drive-mirror',
90
+ 'arguments': {'device': 'testdisk',
91
+ 'mode': 'absolute-paths',
92
+ 'format': '$IMGFMT',
93
+ 'target': '$DEST_IMG',
94
+ 'sync': 'full',
95
+ 'mode': 'existing',
96
+ 'on-source-error': 'stop',
97
+ 'on-target-error': 'stop' }}" \
98
+ "JOB_STATUS_CHANGE.*pause"
99
+
100
+echo
101
+echo '=== Force cancel job paused in error state ==='
102
+echo
103
+
104
+success_or_failure="y" _send_qemu_cmd $QEMU_HANDLE \
105
+ "{'execute': 'block-job-cancel',
106
+ 'arguments': { 'device': 'testdisk',
107
+ 'force': true}}" \
108
+ "BLOCK_JOB_CANCELLED" "Assertion"
109
+
110
+# success, all done
111
+echo "*** done"
112
+rm -f $seq.full
113
+status=0
114
diff --git a/tests/qemu-iotests/229.out b/tests/qemu-iotests/229.out
115
new file mode 100644
116
index XXXXXXX..XXXXXXX
117
--- /dev/null
118
+++ b/tests/qemu-iotests/229.out
119
@@ -XXX,XX +XXX,XX @@
120
+QA output created by 229
121
+Formatting 'TEST_DIR/b.IMGFMT', fmt=IMGFMT size=2097152
122
+Formatting 'TEST_DIR/d.IMGFMT', fmt=IMGFMT size=1048576
123
+wrote 2097152/2097152 bytes at offset 0
124
+2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
125
+{"return": {}}
126
+
127
+=== Starting drive-mirror, causing error & stop ===
128
+
129
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "testdisk"}}
130
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "testdisk"}}
131
+{"return": {}}
132
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "testdisk", "operation": "write", "action": "stop"}}
133
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "paused", "id": "testdisk"}}
134
+
135
+=== Force cancel job paused in error state ===
136
+
137
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "testdisk"}}
138
+{"return": {}}
139
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "testdisk", "operation": "write", "action": "stop"}}
140
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "aborting", "id": "testdisk"}}
141
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "testdisk", "len": 2097152, "offset": 1048576, "speed": 0, "type": "mirror"}}
142
+*** done
143
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
144
index XXXXXXX..XXXXXXX 100644
80
index XXXXXXX..XXXXXXX 100644
145
--- a/tests/qemu-iotests/group
81
--- a/hw/scsi/trace-events
146
+++ b/tests/qemu-iotests/group
82
+++ b/hw/scsi/trace-events
147
@@ -XXX,XX +XXX,XX @@
83
@@ -XXX,XX +XXX,XX @@ lsi_bad_phase_interrupt(void) "Phase mismatch interrupt"
148
225 rw auto quick
84
lsi_bad_selection(uint32_t id) "Selected absent target %"PRIu32
149
226 auto quick
85
lsi_do_dma_unavailable(void) "DMA no data available"
150
227 auto quick
86
lsi_do_dma(uint64_t addr, int len) "DMA addr=0x%"PRIx64" len=%d"
151
+229 auto quick
87
-lsi_queue_command(uint32_t tag) "Queueing tag=0x%"PRId32
88
+lsi_queue_command(uint32_t tag) "Queueing tag=0x%"PRIx32
89
lsi_add_msg_byte_error(void) "MSG IN data too long"
90
lsi_add_msg_byte(uint8_t data) "MSG IN 0x%02x"
91
lsi_reselect(int id) "Reselected target %d"
92
@@ -XXX,XX +XXX,XX @@ lsi_do_msgout_noop(void) "MSG: No Operation"
93
lsi_do_msgout_extended(uint8_t msg, uint8_t len) "Extended message 0x%x (len %d)"
94
lsi_do_msgout_ignored(const char *msg) "%s (ignored)"
95
lsi_do_msgout_simplequeue(uint8_t select_tag) "SIMPLE queue tag=0x%x"
96
-lsi_do_msgout_abort(uint32_t tag) "MSG: ABORT TAG tag=0x%"PRId32
97
+lsi_do_msgout_abort(uint32_t tag) "MSG: ABORT TAG tag=0x%"PRIx32
98
lsi_do_msgout_clearqueue(uint32_t tag) "MSG: CLEAR QUEUE tag=0x%"PRIx32
99
lsi_do_msgout_busdevicereset(uint32_t tag) "MSG: BUS DEVICE RESET tag=0x%"PRIx32
100
lsi_do_msgout_select(int id) "Select LUN %d"
152
--
101
--
153
2.17.1
102
2.35.1
154
103
155
104
diff view generated by jsdifflib