[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen staging] xen-bus: check whether the frontend is active during device reset...



commit 1a704a96301726c247c350665bbd24d83d8350da
Author:     Paul Durrant <paul.durrant@xxxxxxxxxx>
AuthorDate: Tue Sep 10 18:17:53 2019 +0100
Commit:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
CommitDate: Fri Sep 27 11:21:34 2019 +0100

    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@xxxxxxxxxx>
    Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Message-Id: <20190910171753.3775-1-paul.durrant@xxxxxxxxxx>
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    (cherry picked from commit df6180bb56cd03949c2c64083da58755fed81a61)
---
 hw/xen/xen-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index 973c72ef64..d058668f13 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -560,7 +560,7 @@ static void xen_device_backend_changed(void *opaque)
      * backend state to Closed.
      */
     if (xendev->backend_state == XenbusStateClosing &&
-        !xen_device_state_is_active(state)) {
+        !xen_device_state_is_active(xendev->frontend_state)) {
         xen_device_backend_set_state(xendev, XenbusStateClosed);
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.