win-pvdrivers

changeset 1018:9c6af8d0bdb6

fix problem with stopping xenvbd. Tidyup.
author James Harper <james.harper@bendigoit.com.au>
date Tue Feb 12 20:45:08 2013 +1100 (2013-02-12)
parents 9b6213b6be25
children df03fde445b8
files xenvbd_common/common_miniport.h xenvbd_common/common_xen.h
line diff
     1.1 --- a/xenvbd_common/common_miniport.h	Tue Feb 12 20:44:22 2013 +1100
     1.2 +++ b/xenvbd_common/common_miniport.h	Tue Feb 12 20:45:08 2013 +1100
     1.3 @@ -259,13 +259,8 @@ XenVbd_HandleEvent(PXENVBD_DEVICE_DATA x
     1.4      }
     1.5    }
     1.6  
     1.7 -#if 0
     1.8 -  if (dump_mode || xvdd->device_state == DEVICE_STATE_ACTIVE) {
     1.9 -    XenVbd_ProcessSrbList(xvdd);
    1.10 -  } else
    1.11 -#endif
    1.12 -  if (xvdd->device_state != DEVICE_STATE_ACTIVE && xvdd->shadow_free == SHADOW_ENTRIES) {
    1.13 -    FUNCTION_MSG("ring now empty - comleting disconnect\n");
    1.14 +  if (xvdd->device_state != DEVICE_STATE_ACTIVE && xvdd->device_state != DEVICE_STATE_INACTIVE && xvdd->shadow_free == SHADOW_ENTRIES) {
    1.15 +    FUNCTION_MSG("ring now empty - completing disconnect\n");
    1.16      XenVbd_CompleteDisconnect(xvdd);
    1.17    }
    1.18    return;
     2.1 --- a/xenvbd_common/common_xen.h	Tue Feb 12 20:44:22 2013 +1100
     2.2 +++ b/xenvbd_common/common_xen.h	Tue Feb 12 20:45:08 2013 +1100
     2.3 @@ -74,9 +74,8 @@ XenVbd_Connect(PXENVBD_DEVICE_DATA xvdd,
     2.4    if (!(((qemu_hide_flags_value & QEMU_UNPLUG_ALL_IDE_DISKS) && xvdd->device_type != XENVBD_DEVICETYPE_CDROM) || qemu_hide_filter)) {
     2.5      /* we never set backend state active if we are inactive */
     2.6      FUNCTION_MSG("Inactive\n");
     2.7 +    XnCloseDevice(xvdd->handle);
     2.8      xvdd->device_state = DEVICE_STATE_INACTIVE;
     2.9 -    /* still need to call StartRing here */
    2.10 -    XenVbd_StartRing(xvdd, suspend);
    2.11      return STATUS_SUCCESS;
    2.12    }
    2.13    status = XnBindEvent(xvdd->handle, &xvdd->event_channel, XenVbd_HandleEventDIRQL, xvdd);
    2.14 @@ -154,6 +153,11 @@ XenVbd_Disconnect(PVOID DeviceExtension,
    2.15    PXENVBD_DEVICE_DATA xvdd = (PXENVBD_DEVICE_DATA)DeviceExtension;
    2.16    PFN_NUMBER pfn;
    2.17  
    2.18 +  if (xvdd->device_state == DEVICE_STATE_INACTIVE) {
    2.19 +    /* state stays INACTIVE */
    2.20 +    return STATUS_SUCCESS;
    2.21 +  } 
    2.22 +
    2.23    if (xvdd->device_state != DEVICE_STATE_ACTIVE) {
    2.24      FUNCTION_MSG("state not DEVICE_STATE_ACTIVE, is %d instead\n", xvdd->device_state);
    2.25      FUNCTION_EXIT();