1 | The following changes since commit 64175afc695c0672876fbbfc31b299c86d562cb4: | 1 | The following changes since commit cc6613e244e86c66f83467eab5284825d7057cea: |
---|---|---|---|
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/stefanha/tags/tracing-pull-request' into staging (2019-09-03 11:06:09 +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 | https://github.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to 56faeb9bb6872b3f926b3b3e0452a70beea10af2: | 9 | for you to fetch changes up to ebb6ff25cd888a52a64a9adc3692541c6d1d9a42: |
10 | 10 | ||
11 | block/gluster.c: Handle qdict_array_entries() failure (2017-06-09 08:41:29 -0400) | 11 | virtio-blk: Cancel the pending BH when the dataplane is reset (2019-09-03 16:11:18 +0100) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Gluster patch | 14 | Pull request |
15 | |||
15 | ---------------------------------------------------------------- | 16 | ---------------------------------------------------------------- |
16 | 17 | ||
17 | Peter Maydell (1): | 18 | Philippe Mathieu-Daudé (1): |
18 | block/gluster.c: Handle qdict_array_entries() failure | 19 | virtio-blk: Cancel the pending BH when the dataplane is reset |
19 | 20 | ||
20 | block/gluster.c | 3 +-- | 21 | hw/block/dataplane/virtio-blk.c | 3 +++ |
21 | 1 file changed, 1 insertion(+), 2 deletions(-) | 22 | 1 file changed, 3 insertions(+) |
22 | 23 | ||
23 | -- | 24 | -- |
24 | 2.9.3 | 25 | 2.21.0 |
25 | 26 | ||
26 | 27 | diff view generated by jsdifflib |
1 | From: Peter Maydell <peter.maydell@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | In qemu_gluster_parse_json(), the call to qdict_array_entries() | 3 | When 'system_reset' is called, the main loop clear the memory |
4 | could return a negative error code, which we were ignoring | 4 | region cache before the BH has a chance to execute. Later when |
5 | because we assigned the result to an unsigned variable. | 5 | the deferred function is called, some assumptions that were |
6 | Fix this by using the 'int' type instead, which matches the | 6 | made when scheduling them are no longer true when they actually |
7 | return type of qdict_array_entries() and also the type | 7 | execute. |
8 | we use for the loop enumeration variable 'i'. | ||
9 | 8 | ||
10 | (Spotted by Coverity, CID 1360960.) | 9 | This is what happens using a virtio-blk device (fresh RHEL7.8 install): |
11 | 10 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | $ (sleep 12.3; echo system_reset; sleep 12.3; echo system_reset; sleep 1; echo q) \ |
13 | Reviewed-by: Eric Blake <eblake@redhat.com> | 12 | | qemu-system-x86_64 -m 4G -smp 8 -boot menu=on \ |
14 | Reviewed-by: Jeff Cody <jcody@redhat.com> | 13 | -device virtio-blk-pci,id=image1,drive=drive_image1 \ |
15 | Message-id: 1496682098-1540-1-git-send-email-peter.maydell@linaro.org | 14 | -drive file=/var/lib/libvirt/images/rhel78.qcow2,if=none,id=drive_image1,format=qcow2,cache=none \ |
16 | Signed-off-by: Jeff Cody <jcody@redhat.com> | 15 | -device virtio-net-pci,netdev=net0,id=nic0,mac=52:54:00:c4:e7:84 \ |
16 | -netdev tap,id=net0,script=/bin/true,downscript=/bin/true,vhost=on \ | ||
17 | -monitor stdio -serial null -nographic | ||
18 | (qemu) system_reset | ||
19 | (qemu) system_reset | ||
20 | (qemu) qemu-system-x86_64: hw/virtio/virtio.c:225: vring_get_region_caches: Assertion `caches != NULL' failed. | ||
21 | Aborted | ||
22 | |||
23 | (gdb) bt | ||
24 | Thread 1 (Thread 0x7f109c17b680 (LWP 10939)): | ||
25 | #0 0x00005604083296d1 in vring_get_region_caches (vq=0x56040a24bdd0) at hw/virtio/virtio.c:227 | ||
26 | #1 0x000056040832972b in vring_avail_flags (vq=0x56040a24bdd0) at hw/virtio/virtio.c:235 | ||
27 | #2 0x000056040832d13d in virtio_should_notify (vdev=0x56040a240630, vq=0x56040a24bdd0) at hw/virtio/virtio.c:1648 | ||
28 | #3 0x000056040832d1f8 in virtio_notify_irqfd (vdev=0x56040a240630, vq=0x56040a24bdd0) at hw/virtio/virtio.c:1662 | ||
29 | #4 0x00005604082d213d in notify_guest_bh (opaque=0x56040a243ec0) at hw/block/dataplane/virtio-blk.c:75 | ||
30 | #5 0x000056040883dc35 in aio_bh_call (bh=0x56040a243f10) at util/async.c:90 | ||
31 | #6 0x000056040883dccd in aio_bh_poll (ctx=0x560409161980) at util/async.c:118 | ||
32 | #7 0x0000560408842af7 in aio_dispatch (ctx=0x560409161980) at util/aio-posix.c:460 | ||
33 | #8 0x000056040883e068 in aio_ctx_dispatch (source=0x560409161980, callback=0x0, user_data=0x0) at util/async.c:261 | ||
34 | #9 0x00007f10a8fca06d in g_main_context_dispatch () at /lib64/libglib-2.0.so.0 | ||
35 | #10 0x0000560408841445 in glib_pollfds_poll () at util/main-loop.c:215 | ||
36 | #11 0x00005604088414bf in os_host_main_loop_wait (timeout=0) at util/main-loop.c:238 | ||
37 | #12 0x00005604088415c4 in main_loop_wait (nonblocking=0) at util/main-loop.c:514 | ||
38 | #13 0x0000560408416b1e in main_loop () at vl.c:1923 | ||
39 | #14 0x000056040841e0e8 in main (argc=20, argv=0x7ffc2c3f9c58, envp=0x7ffc2c3f9d00) at vl.c:4578 | ||
40 | |||
41 | Fix this by cancelling the BH when the virtio dataplane is stopped. | ||
42 | |||
43 | [This is version of the patch was modified as discussed with Philippe on | ||
44 | the mailing list thread. | ||
45 | --Stefan] | ||
46 | |||
47 | Reported-by: Yihuang Yu <yihyu@redhat.com> | ||
48 | Suggested-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
49 | Fixes: https://bugs.launchpad.net/qemu/+bug/1839428 | ||
50 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
51 | Message-Id: <20190816171503.24761-1-philmd@redhat.com> | ||
52 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
17 | --- | 53 | --- |
18 | block/gluster.c | 3 +-- | 54 | hw/block/dataplane/virtio-blk.c | 3 +++ |
19 | 1 file changed, 1 insertion(+), 2 deletions(-) | 55 | 1 file changed, 3 insertions(+) |
20 | 56 | ||
21 | diff --git a/block/gluster.c b/block/gluster.c | 57 | diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c |
22 | index XXXXXXX..XXXXXXX 100644 | 58 | index XXXXXXX..XXXXXXX 100644 |
23 | --- a/block/gluster.c | 59 | --- a/hw/block/dataplane/virtio-blk.c |
24 | +++ b/block/gluster.c | 60 | +++ b/hw/block/dataplane/virtio-blk.c |
25 | @@ -XXX,XX +XXX,XX @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf, | 61 | @@ -XXX,XX +XXX,XX @@ void virtio_blk_data_plane_stop(VirtIODevice *vdev) |
26 | Error *local_err = NULL; | 62 | virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); |
27 | char *str = NULL; | 63 | } |
28 | const char *ptr; | 64 | |
29 | - size_t num_servers; | 65 | + qemu_bh_cancel(s->bh); |
30 | - int i, type; | 66 | + notify_guest_bh(s); /* final chance to notify guest */ |
31 | + int i, type, num_servers; | 67 | + |
32 | 68 | /* Clean up guest notifier (irq) */ | |
33 | /* create opts info from runtime_json_opts list */ | 69 | k->set_guest_notifiers(qbus->parent, nvqs, false); |
34 | opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort); | 70 | |
35 | -- | 71 | -- |
36 | 2.9.3 | 72 | 2.21.0 |
37 | 73 | ||
38 | 74 | diff view generated by jsdifflib |