]> git.ipfire.org Git - thirdparty/qemu.git/commit
xen-bus: Fix backend state transition on device reset
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 23 Aug 2019 10:15:33 +0000 (11:15 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 28 Oct 2019 04:42:16 +0000 (23:42 -0500)
commitb6cedc911e44a5bc6f3f120fee411c1ccc22f220
tree1248af154e32dc87caa287a8b75746cfbdc57a90
parent7ebcd375ade505358c1c45542de22f188c599bdd
xen-bus: Fix backend state transition on device reset

When a frontend wants to reset its state and the backend one, it
starts with setting "Closing", then waits for the backend (QEMU) to do
the same.

But when QEMU is setting "Closing" to its state, it triggers an event
(xenstore watch) that re-execute xen_device_backend_changed() and set
the backend state to "Closed". QEMU should wait for the frontend to
set "Closed" before doing the same.

Before setting "Closed" to the backend_state, we are also going to
check if there is a frontend. If that the case, when the backend state
is set to "Closing" the frontend should react and sets its state to
"Closing" then "Closed". The backend should wait for that to happen.

Fixes: b6af8926fb858c4f1426e5acb2cfc1f0580ec98a
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Message-Id: <20190823101534.465-2-anthony.perard@citrix.com>
(cherry picked from commit cb3231460747552d70af9d546dc53d8195bcb796)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/xen/xen-bus.c