win-pvdrivers

changeset 288:812a4b0f9460 wdm

Added fix for whole machine (inc Dom0) hang when DomU bugchecked.
author James Harper <james.harper@bendigoit.com.au>
date Mon Jun 02 11:58:26 2008 +1000 (2008-06-02)
parents f02ee956fe94
children 691c6ebe92cf
files xenvbd/scsiport.c xenvbd/xenvbd.c
line diff
     1.1 --- a/xenvbd/scsiport.c	Sun Jun 01 23:16:27 2008 +1000
     1.2 +++ b/xenvbd/scsiport.c	Mon Jun 02 11:58:26 2008 +1000
     1.3 @@ -162,9 +162,11 @@ XenVbd_HwScsiFindAdapter(PVOID DeviceExt
     1.4        KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_RING - %s = %p\n", setting, value));
     1.5        if (strcmp(setting, "ring-ref") == 0)
     1.6        {
     1.7 -        
     1.8          sring = (blkif_sring_t *)value;
     1.9          FRONT_RING_INIT(&xvdd->ring, sring, PAGE_SIZE);
    1.10 +        /* this bit is for when we have to take over an existing ring on a bug check */
    1.11 +        xvdd->ring.req_prod_pvt = sring->req_prod;
    1.12 +        xvdd->ring.rsp_cons = sring->rsp_prod;
    1.13        }
    1.14        break;
    1.15      case XEN_INIT_TYPE_EVENT_CHANNEL: /* frontend event channel */
     2.1 --- a/xenvbd/xenvbd.c	Sun Jun 01 23:16:27 2008 +1000
     2.2 +++ b/xenvbd/xenvbd.c	Mon Jun 02 11:58:26 2008 +1000
     2.3 @@ -191,9 +191,15 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     2.4  
     2.5    status = ScsiPortInitialize(DriverObject, RegistryPath, &HwInitializationData, NULL);
     2.6    
     2.7 -  /* this is a bit naughty... */
     2.8 -  XenVbd_Pnp_Original = DriverObject->MajorFunction[IRP_MJ_PNP];
     2.9 -  DriverObject->MajorFunction[IRP_MJ_PNP] = XenVbd_Pnp;
    2.10 +  /* DriverObject will be NULL if we are being called in dump mode */
    2.11 +  if (DriverObject != NULL)
    2.12 +  {
    2.13 +    /* this is a bit naughty... */
    2.14 +    XenVbd_Pnp_Original = DriverObject->MajorFunction[IRP_MJ_PNP];
    2.15 +    DriverObject->MajorFunction[IRP_MJ_PNP] = XenVbd_Pnp;
    2.16 +  }
    2.17 +  else
    2.18 +    XenVbd_Pnp_Original = NULL;
    2.19  
    2.20    if(!NT_SUCCESS(status))
    2.21    {