summary refs log tree commit diff stats
path: root/scripts/qapi/common.py
diff options
context:
space:
mode:
authorPaul Durrant <paul.durrant@citrix.com>2019-09-10 18:17:53 +0100
committerAnthony PERARD <anthony.perard@citrix.com>2019-09-24 12:18:47 +0100
commitdf6180bb56cd03949c2c64083da58755fed81a61 (patch)
treed0bda5c9d1f3a7af9f4ba758c1da81df1d0e030b /scripts/qapi/common.py
parent2f93a3ecdd3bb060bd04f698ccafe66efd98563a (diff)
downloadfocaccia-qemu-df6180bb56cd03949c2c64083da58755fed81a61.tar.gz
focaccia-qemu-df6180bb56cd03949c2c64083da58755fed81a61.zip
xen-bus: check whether the frontend is active during device reset...
...not the backend

Commit cb323146 "xen-bus: Fix backend state transition on device reset"
contained a subtle mistake. The hunk

@@ -539,11 +556,11 @@ static void xen_device_backend_changed(void *opaque)

     /*
      * If the toolstack (or unplug request callback) has set the backend
-     * state to Closing, but there is no active frontend (i.e. the
-     * state is not Connected) then set the backend state to Closed.
+     * state to Closing, but there is no active frontend then set the
+     * backend state to Closed.
      */
     if (xendev->backend_state == XenbusStateClosing &&
-        xendev->frontend_state != XenbusStateConnected) {
+        !xen_device_state_is_active(state)) {
         xen_device_backend_set_state(xendev, XenbusStateClosed);
     }

mistakenly replaced the check of 'xendev->frontend_state' with a check
(now in a helper function) of 'state', which actually equates to
'xendev->backend_state'.

This patch fixes the mistake.

Fixes: cb3231460747552d70af9d546dc53d8195bcb796
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190910171753.3775-1-paul.durrant@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Diffstat (limited to 'scripts/qapi/common.py')
0 files changed, 0 insertions, 0 deletions