1
The following changes since commit 64175afc695c0672876fbbfc31b299c86d562cb4:
1
The following changes since commit ee135aa0428fe5af2af7be04ff16d2b596a9330a:
2
2
3
arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented (2017-06-07 17:21:44 +0100)
3
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-3.1-20180821' into staging (2018-08-21 13:27:11 +0100)
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
git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request
8
8
9
for you to fetch changes up to 56faeb9bb6872b3f926b3b3e0452a70beea10af2:
9
for you to fetch changes up to 26bf474ba92c76e61bea51726e22da6dfd185296:
10
10
11
block/gluster.c: Handle qdict_array_entries() failure (2017-06-09 08:41:29 -0400)
11
block: iotest to catch abort on forced blockjob cancel (2018-08-21 15:20:37 -0400)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Gluster patch
14
Block job patches
15
----------------------------------------------------------------
15
----------------------------------------------------------------
16
16
17
Peter Maydell (1):
17
Jeff Cody (2):
18
block/gluster.c: Handle qdict_array_entries() failure
18
block: for jobs, do not clear user_paused until after the resume
19
block: iotest to catch abort on forced blockjob cancel
19
20
20
block/gluster.c | 3 +--
21
job.c | 2 +-
21
1 file changed, 1 insertion(+), 2 deletions(-)
22
tests/qemu-iotests/229 | 95 ++++++++++++++++++++++++++++++++++++++
23
tests/qemu-iotests/229.out | 23 +++++++++
24
tests/qemu-iotests/group | 1 +
25
4 files changed, 120 insertions(+), 1 deletion(-)
26
create mode 100755 tests/qemu-iotests/229
27
create mode 100644 tests/qemu-iotests/229.out
22
28
23
--
29
--
24
2.9.3
30
2.17.1
25
31
26
32
diff view generated by jsdifflib
New patch
1
The function job_cancel_async() will always cause an assert for blockjob
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.
1
5
6
In that function, we assert that job.user_paused is set to true.
7
Unfortunately, right before calling this function, it has explicitly
8
been set to false.
9
10
The fix is pretty simple: set job->user_paused to false only after the
11
job user_resume() function has been called.
12
13
Reviewed-by: John Snow <jsnow@redhat.com>
14
Reviewed-by: Eric Blake <eblake@redhat.com>
15
Signed-off-by: Jeff Cody <jcody@redhat.com>
16
Message-id: bb183b77d8f2dd6bd67b8da559a90ac1e74b2052.1534868459.git.jcody@redhat.com
17
Signed-off-by: Jeff Cody <jcody@redhat.com>
18
---
19
job.c | 2 +-
20
1 file changed, 1 insertion(+), 1 deletion(-)
21
22
diff --git a/job.c b/job.c
23
index XXXXXXX..XXXXXXX 100644
24
--- a/job.c
25
+++ b/job.c
26
@@ -XXX,XX +XXX,XX @@ static void job_cancel_async(Job *job, bool force)
27
{
28
if (job->user_paused) {
29
/* Do not call job_enter here, the caller will handle it. */
30
- job->user_paused = false;
31
if (job->driver->user_resume) {
32
job->driver->user_resume(job);
33
}
34
+ job->user_paused = false;
35
assert(job->pause_count > 0);
36
job->pause_count--;
37
}
38
--
39
2.17.1
40
41
diff view generated by jsdifflib
1
From: Peter Maydell <peter.maydell@linaro.org>
1
Signed-off-by: Jeff Cody <jcody@redhat.com>
2
2
Reviewed-by: John Snow <jsnow@redhat.com>
3
In qemu_gluster_parse_json(), the call to qdict_array_entries()
3
Message-id: df317f617fbe5affcf699cb8560e7b0c2e028a64.1534868459.git.jcody@redhat.com
4
could return a negative error code, which we were ignoring
5
because we assigned the result to an unsigned variable.
6
Fix this by using the 'int' type instead, which matches the
7
return type of qdict_array_entries() and also the type
8
we use for the loop enumeration variable 'i'.
9
10
(Spotted by Coverity, CID 1360960.)
11
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Reviewed-by: Eric Blake <eblake@redhat.com>
14
Reviewed-by: Jeff Cody <jcody@redhat.com>
15
Message-id: 1496682098-1540-1-git-send-email-peter.maydell@linaro.org
16
Signed-off-by: Jeff Cody <jcody@redhat.com>
4
Signed-off-by: Jeff Cody <jcody@redhat.com>
17
---
5
---
18
block/gluster.c | 3 +--
6
tests/qemu-iotests/229 | 95 ++++++++++++++++++++++++++++++++++++++
19
1 file changed, 1 insertion(+), 2 deletions(-)
7
tests/qemu-iotests/229.out | 23 +++++++++
8
tests/qemu-iotests/group | 1 +
9
3 files changed, 119 insertions(+)
10
create mode 100755 tests/qemu-iotests/229
11
create mode 100644 tests/qemu-iotests/229.out
20
12
21
diff --git a/block/gluster.c b/block/gluster.c
13
diff --git a/tests/qemu-iotests/229 b/tests/qemu-iotests/229
14
new file mode 100755
15
index XXXXXXX..XXXXXXX
16
--- /dev/null
17
+++ b/tests/qemu-iotests/229
18
@@ -XXX,XX +XXX,XX @@
19
+#!/bin/bash
20
+#
21
+# Test for force canceling a running blockjob that is paused in
22
+# an error state.
23
+#
24
+# Copyright (C) 2018 Red Hat, Inc.
25
+#
26
+# This program is free software; you can redistribute it and/or modify
27
+# it under the terms of the GNU General Public License as published by
28
+# the Free Software Foundation; either version 2 of the License, or
29
+# (at your option) any later version.
30
+#
31
+# This program is distributed in the hope that it will be useful,
32
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
+# GNU General Public License for more details.
35
+#
36
+# You should have received a copy of the GNU General Public License
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
22
index XXXXXXX..XXXXXXX 100644
144
index XXXXXXX..XXXXXXX 100644
23
--- a/block/gluster.c
145
--- a/tests/qemu-iotests/group
24
+++ b/block/gluster.c
146
+++ b/tests/qemu-iotests/group
25
@@ -XXX,XX +XXX,XX @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
147
@@ -XXX,XX +XXX,XX @@
26
Error *local_err = NULL;
148
225 rw auto quick
27
char *str = NULL;
149
226 auto quick
28
const char *ptr;
150
227 auto quick
29
- size_t num_servers;
151
+229 auto quick
30
- int i, type;
31
+ int i, type, num_servers;
32
33
/* create opts info from runtime_json_opts list */
34
opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort);
35
--
152
--
36
2.9.3
153
2.17.1
37
154
38
155
diff view generated by jsdifflib