[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 49/88] Make qemu_shutdown_requested signal-safe
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 49/88] Make qemu_shutdown_requested signal-safe |
Date: |
Thu, 8 Jan 2015 11:33:53 -0600 |
From: Jan Kiszka <address@hidden>
qemu_shutdown_requested may be interrupted by qemu_system_killed. If the
latter sets shutdown_requested after qemu_shutdown_requested has read it
but before it was cleared, the shutdown event is lost. Fix this by using
atomic_xchg.
This provides a different fix for the problem which commit 15124e142
attempts to deal with. That commit breaks use of ^C to drop into gdb,
and so this approach is better (and 15124e142 can be reverted).
Signed-off-by: Jan Kiszka <address@hidden>
Reviewed-by: Gonglei <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
[PMM: commit message tweak]
Signed-off-by: Peter Maydell <address@hidden>
(cherry picked from commit 817ef04db2cfa2df04daffd6917f4ea7605f6403)
Signed-off-by: Michael Roth <address@hidden>
---
vl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/vl.c b/vl.c
index 7f8bd39..3650f4f 100644
--- a/vl.c
+++ b/vl.c
@@ -1745,9 +1745,7 @@ int qemu_reset_requested_get(void)
static int qemu_shutdown_requested(void)
{
- int r = shutdown_requested;
- shutdown_requested = 0;
- return r;
+ return atomic_xchg(&shutdown_requested, 0);
}
static void qemu_kill_report(void)
--
1.9.1
- [Qemu-devel] [PATCH 37/88] virtio-rng: fix virtio-rng child refcount in transports, (continued)
- [Qemu-devel] [PATCH 37/88] virtio-rng: fix virtio-rng child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 41/88] pc: Fix disabling of vapic for compat PC models, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 48/88] libcacard: don't free sign buffer while sign op is pending, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 46/88] vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 50/88] vnc: sanitize bits_per_pixel from the client, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 40/88] virtio-9p: fix virtio-9p child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 45/88] vmware-vga: use vmsvga_verify_rect in vmsvga_copy_rect, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 51/88] virtio-scsi: sense in virtio_scsi_command_complete, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 52/88] tcg/mips: fix store softmmu slow path, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 47/88] qcow2: Do not overflow when writing an L1 sector, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 49/88] Make qemu_shutdown_requested signal-safe,
Michael Roth <=
- [Qemu-devel] [PATCH 54/88] hw/xtensa/xtfpga: treat uImage load address as virtual, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 53/88] hw/core/loader: implement address translation in uimage loader, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 57/88] esp-pci: fixup deadlock with linux, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 19/88] virtio-balloon: fix integer overflow in memory stats feature, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 56/88] hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*), Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 58/88] target-xtensa: add missing window check for entry, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 21/88] ivshmem: Check ivshmem_read() size argument, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 23/88] ivshmem: Fix potential OOB r/w access, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 55/88] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 61/88] libcacard: fix resource leak, Michael Roth, 2015/01/08