win-pvdrivers

diff xenvbd_common/common_xen.h @ 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 4f7d5a8636bd
children 6547b07f3236
line diff
     1.1 --- a/xenvbd_common/common_xen.h	Tue Feb 12 20:44:22 2013 +1100
     1.2 +++ b/xenvbd_common/common_xen.h	Tue Feb 12 20:45:08 2013 +1100
     1.3 @@ -74,9 +74,8 @@ XenVbd_Connect(PXENVBD_DEVICE_DATA xvdd,
     1.4    if (!(((qemu_hide_flags_value & QEMU_UNPLUG_ALL_IDE_DISKS) && xvdd->device_type != XENVBD_DEVICETYPE_CDROM) || qemu_hide_filter)) {
     1.5      /* we never set backend state active if we are inactive */
     1.6      FUNCTION_MSG("Inactive\n");
     1.7 +    XnCloseDevice(xvdd->handle);
     1.8      xvdd->device_state = DEVICE_STATE_INACTIVE;
     1.9 -    /* still need to call StartRing here */
    1.10 -    XenVbd_StartRing(xvdd, suspend);
    1.11      return STATUS_SUCCESS;
    1.12    }
    1.13    status = XnBindEvent(xvdd->handle, &xvdd->event_channel, XenVbd_HandleEventDIRQL, xvdd);
    1.14 @@ -154,6 +153,11 @@ XenVbd_Disconnect(PVOID DeviceExtension,
    1.15    PXENVBD_DEVICE_DATA xvdd = (PXENVBD_DEVICE_DATA)DeviceExtension;
    1.16    PFN_NUMBER pfn;
    1.17  
    1.18 +  if (xvdd->device_state == DEVICE_STATE_INACTIVE) {
    1.19 +    /* state stays INACTIVE */
    1.20 +    return STATUS_SUCCESS;
    1.21 +  } 
    1.22 +
    1.23    if (xvdd->device_state != DEVICE_STATE_ACTIVE) {
    1.24      FUNCTION_MSG("state not DEVICE_STATE_ACTIVE, is %d instead\n", xvdd->device_state);
    1.25      FUNCTION_EXIT();