]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
qemu/queue.h: add QLIST_SAFE_REMOVE()
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 14 Feb 2020 17:17:10 +0000 (17:17 +0000)
committerStefan Hajnoczi <stefanha@redhat.com>
Sat, 22 Feb 2020 08:26:47 +0000 (08:26 +0000)
commit195ed8cb365edeb0d0a70a2ffdeb7a073f9a8117
tree5178e83f699e90927825a009012c9ff17047c12c
parentca8c6b22754b0f17818b1d1910d31f0aa1a49cc7
qemu/queue.h: add QLIST_SAFE_REMOVE()

QLIST_REMOVE() assumes the element is in a list.  It also leaves the
element's linked list pointers dangling.

Introduce a safe version of QLIST_REMOVE() and convert open-coded
instances of this pattern.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Message-id: 20200214171712.541358-4-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block.c
chardev/spice.c
include/qemu/queue.h