1
The following changes since commit df34fe314b5da628bc9a2664fb1b887bc0a6cc6d:
1
The following changes since commit 6972ef1440a9d685482d78672620a7482f2bd09a:
2
2
3
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190708' into staging (2019-07-08 14:23:32 +0100)
3
Merge tag 'pull-tcg-20230516-3' of https://gitlab.com/rth7680/qemu into staging (2023-05-16 21:30:27 -0700)
4
4
5
are available in the Git repository at:
5
are available in the Git repository at:
6
6
7
git://repo.or.cz/qemu/kevin.git tags/for-upstream
7
https://repo.or.cz/qemu/kevin.git tags/for-upstream
8
8
9
for you to fetch changes up to f7077c9860a438087c2d9a8cc27cb8438c98a748:
9
for you to fetch changes up to c1bc2467c25ae2b846eeb5d338d1c697c6f83833:
10
10
11
qcow2: Allow -o compat=v3 during qemu-img amend (2019-07-08 16:00:31 +0200)
11
iotests: Test commit with iothreads and ongoing I/O (2023-05-19 11:32:19 +0200)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Block layer patches:
14
Block layer patches
15
15
16
- virtio-scsi: Fix request resubmission after I/O error with iothreads
16
- qcow2 spec: Rename "zlib" compression to "deflate"
17
- qcow2: Fix missing v2/v3 subformat aliases for amend
17
- Honour graph read lock even in the main thread + prerequisite fixes
18
- qcow(1): More specific error message for wrong format version
18
- aio-posix: do not nest poll handlers (fixes infinite recursion)
19
- MAINTAINERS: update RBD block maintainer
19
- Refactor QMP blockdev transactions
20
- graph-lock: Disable locking for now
21
- iotests/245: Check if 'compress' driver is available
20
22
21
----------------------------------------------------------------
23
----------------------------------------------------------------
22
Eric Blake (1):
24
Akihiro Suda (1):
23
qcow2: Allow -o compat=v3 during qemu-img amend
25
docs/interop/qcow2.txt: fix description about "zlib" clusters
24
26
25
Jason Dillaman (1):
27
Kevin Wolf (12):
26
MAINTAINERS: update RBD block maintainer
28
block: Call .bdrv_co_create(_opts) unlocked
29
block/export: Fix null pointer dereference in error path
30
qcow2: Unlock the graph in qcow2_do_open() where necessary
31
qemu-img: Take graph lock more selectively
32
test-bdrv-drain: Take graph lock more selectively
33
test-bdrv-drain: Call bdrv_co_unref() in coroutine context
34
blockjob: Adhere to rate limit even when reentered early
35
graph-lock: Honour read locks even in the main thread
36
iotests/245: Check if 'compress' driver is available
37
graph-lock: Disable locking for now
38
nbd/server: Fix drained_poll to wake coroutine in right AioContext
39
iotests: Test commit with iothreads and ongoing I/O
27
40
28
John Snow (1):
41
Stefan Hajnoczi (2):
29
block/qcow: Improve error when opening qcow2 files as qcow
42
aio-posix: do not nest poll handlers
43
tested: add test for nested aio_poll() in poll handlers
30
44
31
Stefan Hajnoczi (3):
45
Vladimir Sementsov-Ogievskiy (6):
32
vl: add qemu_add_vm_change_state_handler_prio()
46
blockdev: refactor transaction to use Transaction API
33
qdev: add qdev_add_vm_change_state_handler()
47
blockdev: transactions: rename some things
34
virtio-scsi: restart DMA after iothread
48
blockdev: qmp_transaction: refactor loop to classic for
49
blockdev: transaction: refactor handling transaction properties
50
blockdev: use state.bitmap in block-dirty-bitmap-add action
51
blockdev: qmp_transaction: drop extra generic layer
35
52
36
include/hw/qdev-core.h | 5 ++++
53
docs/interop/qcow2.txt | 10 +-
37
include/sysemu/sysemu.h | 2 ++
54
include/block/block-global-state.h | 8 +-
38
block/qcow.c | 7 ++++-
55
include/block/block_int-common.h | 4 +-
39
block/qcow2.c | 6 ++--
56
include/block/blockjob_int.h | 14 +-
40
hw/core/vm-change-state-handler.c | 61 +++++++++++++++++++++++++++++++++++++++
57
include/io/channel.h | 10 +
41
hw/scsi/scsi-bus.c | 4 +--
58
block.c | 1 -
42
hw/virtio/virtio.c | 4 +--
59
block/commit.c | 7 +-
43
vl.c | 59 +++++++++++++++++++++++++++++--------
60
block/create.c | 1 -
44
MAINTAINERS | 2 +-
61
block/crypto.c | 25 +-
45
hw/core/Makefile.objs | 1 +
62
block/export/export.c | 6 +-
46
10 files changed, 130 insertions(+), 21 deletions(-)
63
block/graph-lock.c | 31 +-
47
create mode 100644 hw/core/vm-change-state-handler.c
64
block/mirror.c | 23 +-
48
65
block/parallels.c | 6 +-
66
block/qcow.c | 6 +-
67
block/qcow2.c | 43 +-
68
block/qed.c | 6 +-
69
block/raw-format.c | 2 +-
70
block/stream.c | 7 +-
71
block/vdi.c | 11 +-
72
block/vhdx.c | 8 +-
73
block/vmdk.c | 27 +-
74
block/vpc.c | 6 +-
75
blockdev.c | 606 +++++++++------------
76
blockjob.c | 22 +-
77
io/channel.c | 33 +-
78
nbd/server.c | 3 +-
79
qemu-img.c | 5 +-
80
tests/unit/test-bdrv-drain.c | 6 +-
81
tests/unit/test-nested-aio-poll.c | 130 +++++
82
util/aio-posix.c | 11 +
83
tests/qemu-iotests/iotests.py | 4 +
84
tests/qemu-iotests/245 | 7 +-
85
tests/qemu-iotests/245.out | 9 +-
86
tests/qemu-iotests/tests/graph-changes-while-io | 56 +-
87
.../qemu-iotests/tests/graph-changes-while-io.out | 4 +-
88
tests/unit/meson.build | 5 +-
89
36 files changed, 661 insertions(+), 502 deletions(-)
90
create mode 100644 tests/unit/test-nested-aio-poll.c
diff view generated by jsdifflib
Deleted patch
1
From: Stefan Hajnoczi <stefanha@redhat.com>
2
1
3
Add an API for registering vm change state handlers with a well-defined
4
ordering. This is necessary when handlers depend on each other.
5
6
Small coding style fixes are included to make checkpatch.pl happy.
7
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10
---
11
include/sysemu/sysemu.h | 2 ++
12
vl.c | 59 ++++++++++++++++++++++++++++++++---------
13
2 files changed, 49 insertions(+), 12 deletions(-)
14
15
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
16
index XXXXXXX..XXXXXXX 100644
17
--- a/include/sysemu/sysemu.h
18
+++ b/include/sysemu/sysemu.h
19
@@ -XXX,XX +XXX,XX @@ typedef void VMChangeStateHandler(void *opaque, int running, RunState state);
20
21
VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
22
void *opaque);
23
+VMChangeStateEntry *qemu_add_vm_change_state_handler_prio(
24
+ VMChangeStateHandler *cb, void *opaque, int priority);
25
void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
26
void vm_state_notify(int running, RunState state);
27
28
diff --git a/vl.c b/vl.c
29
index XXXXXXX..XXXXXXX 100644
30
--- a/vl.c
31
+++ b/vl.c
32
@@ -XXX,XX +XXX,XX @@ static int machine_help_func(QemuOpts *opts, MachineState *machine)
33
struct vm_change_state_entry {
34
VMChangeStateHandler *cb;
35
void *opaque;
36
- QLIST_ENTRY (vm_change_state_entry) entries;
37
+ QTAILQ_ENTRY(vm_change_state_entry) entries;
38
+ int priority;
39
};
40
41
-static QLIST_HEAD(, vm_change_state_entry) vm_change_state_head;
42
+static QTAILQ_HEAD(, vm_change_state_entry) vm_change_state_head;
43
44
-VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
45
- void *opaque)
46
+/**
47
+ * qemu_add_vm_change_state_handler_prio:
48
+ * @cb: the callback to invoke
49
+ * @opaque: user data passed to the callback
50
+ * @priority: low priorities execute first when the vm runs and the reverse is
51
+ * true when the vm stops
52
+ *
53
+ * Register a callback function that is invoked when the vm starts or stops
54
+ * running.
55
+ *
56
+ * Returns: an entry to be freed using qemu_del_vm_change_state_handler()
57
+ */
58
+VMChangeStateEntry *qemu_add_vm_change_state_handler_prio(
59
+ VMChangeStateHandler *cb, void *opaque, int priority)
60
{
61
VMChangeStateEntry *e;
62
+ VMChangeStateEntry *other;
63
64
- e = g_malloc0(sizeof (*e));
65
-
66
+ e = g_malloc0(sizeof(*e));
67
e->cb = cb;
68
e->opaque = opaque;
69
- QLIST_INSERT_HEAD(&vm_change_state_head, e, entries);
70
+ e->priority = priority;
71
+
72
+ /* Keep list sorted in ascending priority order */
73
+ QTAILQ_FOREACH(other, &vm_change_state_head, entries) {
74
+ if (priority < other->priority) {
75
+ QTAILQ_INSERT_BEFORE(other, e, entries);
76
+ return e;
77
+ }
78
+ }
79
+
80
+ QTAILQ_INSERT_TAIL(&vm_change_state_head, e, entries);
81
return e;
82
}
83
84
+VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
85
+ void *opaque)
86
+{
87
+ return qemu_add_vm_change_state_handler_prio(cb, opaque, 0);
88
+}
89
+
90
void qemu_del_vm_change_state_handler(VMChangeStateEntry *e)
91
{
92
- QLIST_REMOVE (e, entries);
93
- g_free (e);
94
+ QTAILQ_REMOVE(&vm_change_state_head, e, entries);
95
+ g_free(e);
96
}
97
98
void vm_state_notify(int running, RunState state)
99
@@ -XXX,XX +XXX,XX @@ void vm_state_notify(int running, RunState state)
100
101
trace_vm_state_notify(running, state, RunState_str(state));
102
103
- QLIST_FOREACH_SAFE(e, &vm_change_state_head, entries, next) {
104
- e->cb(e->opaque, running, state);
105
+ if (running) {
106
+ QTAILQ_FOREACH_SAFE(e, &vm_change_state_head, entries, next) {
107
+ e->cb(e->opaque, running, state);
108
+ }
109
+ } else {
110
+ QTAILQ_FOREACH_REVERSE_SAFE(e, &vm_change_state_head, entries, next) {
111
+ e->cb(e->opaque, running, state);
112
+ }
113
}
114
}
115
116
@@ -XXX,XX +XXX,XX @@ int main(int argc, char **argv, char **envp)
117
exit(1);
118
}
119
120
- QLIST_INIT (&vm_change_state_head);
121
+ QTAILQ_INIT(&vm_change_state_head);
122
os_setup_early_signal_handling();
123
124
cpu_option = NULL;
125
--
126
2.20.1
127
128
diff view generated by jsdifflib
Deleted patch
1
From: Stefan Hajnoczi <stefanha@redhat.com>
2
1
3
Children sometimes depend on their parent's vm change state handler
4
having completed. Add a vm change state handler API for devices that
5
guarantees tree depth ordering.
6
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9
---
10
include/hw/qdev-core.h | 5 +++
11
hw/core/vm-change-state-handler.c | 61 +++++++++++++++++++++++++++++++
12
hw/core/Makefile.objs | 1 +
13
3 files changed, 67 insertions(+)
14
create mode 100644 hw/core/vm-change-state-handler.c
15
16
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
17
index XXXXXXX..XXXXXXX 100644
18
--- a/include/hw/qdev-core.h
19
+++ b/include/hw/qdev-core.h
20
@@ -XXX,XX +XXX,XX @@
21
#include "qom/object.h"
22
#include "hw/irq.h"
23
#include "hw/hotplug.h"
24
+#include "sysemu/sysemu.h"
25
26
enum {
27
DEV_NVECTORS_UNSPECIFIED = -1,
28
@@ -XXX,XX +XXX,XX @@ static inline bool qbus_is_hotpluggable(BusState *bus)
29
void device_listener_register(DeviceListener *listener);
30
void device_listener_unregister(DeviceListener *listener);
31
32
+VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
33
+ VMChangeStateHandler *cb,
34
+ void *opaque);
35
+
36
#endif
37
diff --git a/hw/core/vm-change-state-handler.c b/hw/core/vm-change-state-handler.c
38
new file mode 100644
39
index XXXXXXX..XXXXXXX
40
--- /dev/null
41
+++ b/hw/core/vm-change-state-handler.c
42
@@ -XXX,XX +XXX,XX @@
43
+/*
44
+ * qdev vm change state handlers
45
+ *
46
+ * This program is free software; you can redistribute it and/or modify
47
+ * it under the terms of the GNU General Public License as published by
48
+ * the Free Software Foundation; either version 2 of the License,
49
+ * or (at your option) any later version.
50
+ *
51
+ * This program is distributed in the hope that it will be useful,
52
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
53
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54
+ * GNU General Public License for more details.
55
+ *
56
+ * You should have received a copy of the GNU General Public License
57
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
58
+ */
59
+
60
+#include "qemu/osdep.h"
61
+#include "hw/qdev.h"
62
+
63
+static int qdev_get_dev_tree_depth(DeviceState *dev)
64
+{
65
+ int depth;
66
+
67
+ for (depth = 0; dev; depth++) {
68
+ BusState *bus = dev->parent_bus;
69
+
70
+ if (!bus) {
71
+ break;
72
+ }
73
+
74
+ dev = bus->parent;
75
+ }
76
+
77
+ return depth;
78
+}
79
+
80
+/**
81
+ * qdev_add_vm_change_state_handler:
82
+ * @dev: the device that owns this handler
83
+ * @cb: the callback function to be invoked
84
+ * @opaque: user data passed to the callback function
85
+ *
86
+ * This function works like qemu_add_vm_change_state_handler() except callbacks
87
+ * are invoked in qdev tree depth order. Ordering is desirable when callbacks
88
+ * of children depend on their parent's callback having completed first.
89
+ *
90
+ * For example, when qdev_add_vm_change_state_handler() is used, a host
91
+ * controller's callback is invoked before the children on its bus when the VM
92
+ * starts running. The order is reversed when the VM stops running.
93
+ *
94
+ * Returns: an entry to be freed with qemu_del_vm_change_state_handler()
95
+ */
96
+VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
97
+ VMChangeStateHandler *cb,
98
+ void *opaque)
99
+{
100
+ int depth = qdev_get_dev_tree_depth(dev);
101
+
102
+ return qemu_add_vm_change_state_handler_prio(cb, opaque, depth);
103
+}
104
diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs
105
index XXXXXXX..XXXXXXX 100644
106
--- a/hw/core/Makefile.objs
107
+++ b/hw/core/Makefile.objs
108
@@ -XXX,XX +XXX,XX @@ common-obj-$(CONFIG_SOFTMMU) += fw-path-provider.o
109
common-obj-y += irq.o
110
common-obj-y += hotplug.o
111
common-obj-$(CONFIG_SOFTMMU) += nmi.o
112
+common-obj-$(CONFIG_SOFTMMU) += vm-change-state-handler.o
113
114
common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
115
common-obj-$(CONFIG_XILINX_AXI) += stream.o
116
--
117
2.20.1
118
119
diff view generated by jsdifflib
Deleted patch
1
From: Stefan Hajnoczi <stefanha@redhat.com>
2
1
3
When the 'cont' command resumes guest execution the vm change state
4
handlers are invoked. Unfortunately there is no explicit ordering
5
between classic qemu_add_vm_change_state_handler() callbacks. When two
6
layers of code both use vm change state handlers, we don't control which
7
handler runs first.
8
9
virtio-scsi with iothreads hits a deadlock when a failed SCSI command is
10
restarted and completes before the iothread is re-initialized.
11
12
This patch uses the new qdev_add_vm_change_state_handler() API to
13
guarantee that virtio-scsi's virtio change state handler executes before
14
the SCSI bus children. This way DMA is restarted after the iothread has
15
re-initialized.
16
17
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
18
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
19
---
20
hw/scsi/scsi-bus.c | 4 ++--
21
hw/virtio/virtio.c | 4 ++--
22
2 files changed, 4 insertions(+), 4 deletions(-)
23
24
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
25
index XXXXXXX..XXXXXXX 100644
26
--- a/hw/scsi/scsi-bus.c
27
+++ b/hw/scsi/scsi-bus.c
28
@@ -XXX,XX +XXX,XX @@ static void scsi_qdev_realize(DeviceState *qdev, Error **errp)
29
error_propagate(errp, local_err);
30
return;
31
}
32
- dev->vmsentry = qemu_add_vm_change_state_handler(scsi_dma_restart_cb,
33
- dev);
34
+ dev->vmsentry = qdev_add_vm_change_state_handler(DEVICE(dev),
35
+ scsi_dma_restart_cb, dev);
36
}
37
38
static void scsi_qdev_unrealize(DeviceState *qdev, Error **errp)
39
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
40
index XXXXXXX..XXXXXXX 100644
41
--- a/hw/virtio/virtio.c
42
+++ b/hw/virtio/virtio.c
43
@@ -XXX,XX +XXX,XX @@ void virtio_init(VirtIODevice *vdev, const char *name,
44
} else {
45
vdev->config = NULL;
46
}
47
- vdev->vmstate = qemu_add_vm_change_state_handler(virtio_vmstate_change,
48
- vdev);
49
+ vdev->vmstate = qdev_add_vm_change_state_handler(DEVICE(vdev),
50
+ virtio_vmstate_change, vdev);
51
vdev->device_endian = virtio_default_endian();
52
vdev->use_guest_notifier_mask = true;
53
}
54
--
55
2.20.1
56
57
diff view generated by jsdifflib
Deleted patch
1
From: John Snow <jsnow@redhat.com>
2
1
3
Reported-by: radmehrsaeed7@gmail.com
4
Fixes: https://bugs.launchpad.net/bugs/1832914
5
Signed-off-by: John Snow <jsnow@redhat.com>
6
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
7
Reviewed-by: Eric Blake <eblake@redhat.com>
8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9
---
10
block/qcow.c | 7 ++++++-
11
1 file changed, 6 insertions(+), 1 deletion(-)
12
13
diff --git a/block/qcow.c b/block/qcow.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/block/qcow.c
16
+++ b/block/qcow.c
17
@@ -XXX,XX +XXX,XX @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
18
goto fail;
19
}
20
if (header.version != QCOW_VERSION) {
21
- error_setg(errp, "Unsupported qcow version %" PRIu32, header.version);
22
+ error_setg(errp, "qcow (v%d) does not support qcow version %" PRIu32,
23
+ QCOW_VERSION, header.version);
24
+ if (header.version == 2 || header.version == 3) {
25
+ error_append_hint(errp, "Try the 'qcow2' driver instead.\n");
26
+ }
27
+
28
ret = -ENOTSUP;
29
goto fail;
30
}
31
--
32
2.20.1
33
34
diff view generated by jsdifflib
Deleted patch
1
From: Jason Dillaman <dillaman@redhat.com>
2
1
3
Remove Josh as per his request since he is no longer the upstream RBD
4
tech lead. Add myself as the maintainer since I am the current RBD tech
5
lead.
6
7
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
8
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
9
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10
---
11
MAINTAINERS | 2 +-
12
1 file changed, 1 insertion(+), 1 deletion(-)
13
14
diff --git a/MAINTAINERS b/MAINTAINERS
15
index XXXXXXX..XXXXXXX 100644
16
--- a/MAINTAINERS
17
+++ b/MAINTAINERS
18
@@ -XXX,XX +XXX,XX @@ S: Supported
19
F: block/vmdk.c
20
21
RBD
22
-M: Josh Durgin <jdurgin@redhat.com>
23
+M: Jason Dillaman <dillaman@redhat.com>
24
L: qemu-block@nongnu.org
25
S: Supported
26
F: block/rbd.c
27
--
28
2.20.1
29
30
diff view generated by jsdifflib
Deleted patch
1
From: Eric Blake <eblake@redhat.com>
2
1
3
Commit b76b4f60 allowed '-o compat=v3' as an alias for the
4
less-appealing '-o compat=1.1' for 'qemu-img create' since we want to
5
use the QMP form as much as possible, but forgot to do likewise for
6
qemu-img amend. Also, it doesn't help that '-o help' doesn't list our
7
new preferred spellings.
8
9
Signed-off-by: Eric Blake <eblake@redhat.com>
10
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11
---
12
block/qcow2.c | 6 +++---
13
1 file changed, 3 insertions(+), 3 deletions(-)
14
15
diff --git a/block/qcow2.c b/block/qcow2.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/block/qcow2.c
18
+++ b/block/qcow2.c
19
@@ -XXX,XX +XXX,XX @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
20
compat = qemu_opt_get(opts, BLOCK_OPT_COMPAT_LEVEL);
21
if (!compat) {
22
/* preserve default */
23
- } else if (!strcmp(compat, "0.10")) {
24
+ } else if (!strcmp(compat, "0.10") || !strcmp(compat, "v2")) {
25
new_version = 2;
26
- } else if (!strcmp(compat, "1.1")) {
27
+ } else if (!strcmp(compat, "1.1") || !strcmp(compat, "v3")) {
28
new_version = 3;
29
} else {
30
error_setg(errp, "Unknown compatibility level %s", compat);
31
@@ -XXX,XX +XXX,XX @@ static QemuOptsList qcow2_create_opts = {
32
{
33
.name = BLOCK_OPT_COMPAT_LEVEL,
34
.type = QEMU_OPT_STRING,
35
- .help = "Compatibility level (0.10 or 1.1)"
36
+ .help = "Compatibility level (v2 [0.10] or v3 [1.1])"
37
},
38
{
39
.name = BLOCK_OPT_BACKING_FILE,
40
--
41
2.20.1
42
43
diff view generated by jsdifflib