win-pvdrivers

changeset 748:fc7dfb98cc7a

Vbd changes for device hiding changes
author James Harper <james.harper@bendigoit.com.au>
date Sun Jan 10 10:07:48 2010 +1100 (2010-01-10)
parents f43c89df09b2
children 233c06b133e9
files xenvbd/xenvbd.c xenvbd/xenvbd.inx
line diff
     1.1 --- a/xenvbd/xenvbd.c	Sun Jan 10 10:07:32 2010 +1100
     1.2 +++ b/xenvbd/xenvbd.c	Sun Jan 10 10:07:48 2010 +1100
     1.3 @@ -121,11 +121,13 @@ XenVbd_InitFromConfig(PXENVBD_DEVICE_DAT
     1.4    USHORT type;
     1.5    PCHAR setting, value, value2;
     1.6    ULONG qemu_protocol_version = 0;
     1.7 +  BOOLEAN qemu_hide_filter = FALSE;
     1.8 +  ULONG qemu_hide_flags_value = 0;
     1.9  
    1.10    xvdd->device_type = XENVBD_DEVICETYPE_UNKNOWN;
    1.11    xvdd->sring = NULL;
    1.12    xvdd->event_channel = 0;
    1.13 -
    1.14 +  
    1.15    xvdd->inactive = TRUE;  
    1.16    ptr = xvdd->device_base;
    1.17    while((type = GET_XEN_INIT_RSP(&ptr, (PVOID)&setting, (PVOID)&value, (PVOID)&value2)) != XEN_INIT_TYPE_END)
    1.18 @@ -219,9 +221,6 @@ XenVbd_InitFromConfig(PXENVBD_DEVICE_DAT
    1.19        KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_DEVICE_STATE - %p\n", PtrToUlong(value)));
    1.20        xvdd->device_state = (PXENPCI_DEVICE_STATE)value;
    1.21        break;
    1.22 -    case XEN_INIT_TYPE_ACTIVE:
    1.23 -      xvdd->inactive = FALSE;
    1.24 -      break;
    1.25      case XEN_INIT_TYPE_QEMU_PROTOCOL_VERSION:
    1.26        qemu_protocol_version = PtrToUlong(value);
    1.27        break;
    1.28 @@ -229,11 +228,23 @@ XenVbd_InitFromConfig(PXENVBD_DEVICE_DAT
    1.29        KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_GRANT_ENTRIES - entries = %d\n", PtrToUlong(setting)));
    1.30        memcpy(xvdd->dump_grant_refs, value, PtrToUlong(setting) * sizeof(grant_ref_t));
    1.31        break;
    1.32 +    case XEN_INIT_TYPE_QEMU_HIDE_FLAGS:
    1.33 +      qemu_hide_flags_value = PtrToUlong(value);
    1.34 +      KdPrint((__DRIVER_NAME "     qemu_hide_flags_value = %d\n", qemu_hide_flags_value));
    1.35 +      break;
    1.36 +    case XEN_INIT_TYPE_QEMU_HIDE_FILTER:
    1.37 +      qemu_hide_filter = TRUE;
    1.38 +      KdPrint((__DRIVER_NAME "     qemu_hide_filter = TRUE\n"));
    1.39 +      break;
    1.40      default:
    1.41        KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_%d\n", type));
    1.42        break;
    1.43      }
    1.44    }
    1.45 +  
    1.46 +  if (((qemu_hide_flags_value & QEMU_UNPLUG_ALL_IDE_DISKS) && xvdd->device_type != XENVBD_DEVICETYPE_CDROM) || qemu_hide_filter)
    1.47 +    xvdd->inactive = FALSE;
    1.48 +  
    1.49    if (!xvdd->inactive && (xvdd->device_type == XENVBD_DEVICETYPE_UNKNOWN
    1.50        || xvdd->sring == NULL
    1.51        || xvdd->event_channel == 0
    1.52 @@ -244,11 +255,7 @@ XenVbd_InitFromConfig(PXENVBD_DEVICE_DAT
    1.53      KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    1.54      return SP_RETURN_BAD_CONFIG;
    1.55    }
    1.56 -  if (!xvdd->inactive && xvdd->device_type == XENVBD_DEVICETYPE_CDROM && qemu_protocol_version > 0)
    1.57 -  {
    1.58 -    xvdd->inactive = TRUE;
    1.59 -  }
    1.60 -  
    1.61 +
    1.62    if (xvdd->inactive)
    1.63      KdPrint((__DRIVER_NAME "     Device is inactive\n"));
    1.64    else
    1.65 @@ -1426,7 +1433,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.66      IoAllocateDriverObjectExtension(DriverObject, UlongToPtr(XEN_INIT_DRIVER_EXTENSION_MAGIC), PAGE_SIZE, &driver_extension);
    1.67      ptr = driver_extension;
    1.68      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RUN, NULL, NULL, NULL);
    1.69 -    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_MATCH_FRONT, "device-type", "disk", UlongToPtr(XEN_INIT_MATCH_TYPE_IF_NOT_MATCH|XEN_INIT_MATCH_TYPE_SET_INACTIVE|XEN_INIT_MATCH_TYPE_DONT_CONFIG));
    1.70 +    //ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_MATCH_FRONT, "device-type", "disk", UlongToPtr(XEN_INIT_MATCH_TYPE_IF_NOT_MATCH|XEN_INIT_MATCH_TYPE_SET_INACTIVE|XEN_INIT_MATCH_TYPE_DONT_CONFIG));
    1.71      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RING, "ring-ref", NULL, NULL);
    1.72      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_EVENT_CHANNEL_IRQ, "event-channel", NULL, NULL);
    1.73      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_FRONT, "device-type", NULL, NULL);
     2.1 --- a/xenvbd/xenvbd.inx	Sun Jan 10 10:07:32 2010 +1100
     2.2 +++ b/xenvbd/xenvbd.inx	Sun Jan 10 10:07:48 2010 +1100
     2.3 @@ -38,10 +38,13 @@ AddReg = XenVbd_Service_AddReg
     2.4  [XenVbd_Service_AddReg]
     2.5  HKR,"Parameters\PnpInterface", "15", 0x00010001, 0x00000001
     2.6  ; hide Qemu IDE in XenPCI
     2.7 +HKLM,"SYSTEM\CurrentControlSet\Services\XenPCI\Parameters", "hide_devices", 0x00010008, "#vbd#"
     2.8  HKLM,"SYSTEM\CurrentControlSet\Services\XenPCI\Parameters", "hide_devices", 0x00010008, "VEN_8086&DEV_7010"
     2.9  HKLM,"SYSTEM\CurrentControlSet\Services\XenPCI\Parameters", "hide_devices", 0x00010008, "primary_ide_channel"
    2.10  HKLM,"SYSTEM\CurrentControlSet\Services\XenPCI\Parameters", "hide_devices", 0x00010008, "secondary_ide_channel"
    2.11  HKLM,"SYSTEM\CurrentControlSet\Services\XenPCI\Parameters", "hide_devices", 0x00010008, "*pnp0600"
    2.12 +; tell Qemu to hide stuff
    2.13 +HKLM,"SYSTEM\CurrentControlSet\Services\XenPCI\Parameters", "qemu_hide_flags", 0x00010008, %QEMU_UNPLUG_ALL_IDE_DISKS%
    2.14  
    2.15  [XenVbd_EventLog]
    2.16  AddReg = XenVbd_EventLog_AddReg
    2.17 @@ -50,22 +53,22 @@ AddReg = XenVbd_EventLog_AddReg
    2.18  HKR,,EventMessageFile,0x00020000,"%SystemRoot%\System32\IoLogMsg.dll;%SystemRoot%\System32\drivers\XenVbd.sys"
    2.19  HKR,,TypesSupported,0x00010001,7
    2.20  
    2.21 -[DestinationDirs]
    2.22 -XenVbd_Inst_CoInstaller_CopyFiles = 11
    2.23 +;[DestinationDirs]
    2.24 +;XenVbd_Inst_CoInstaller_CopyFiles = 11
    2.25  
    2.26 -[XenVbd_Inst.NT.CoInstallers]
    2.27 -AddReg=XenVbd_Inst_CoInstaller_AddReg
    2.28 -CopyFiles=XenVbd_Inst_CoInstaller_CopyFiles
    2.29 +;[XenVbd_Inst.NT.CoInstallers]
    2.30 +;AddReg=XenVbd_Inst_CoInstaller_AddReg
    2.31 +;CopyFiles=XenVbd_Inst_CoInstaller_CopyFiles
    2.32  
    2.33 -[XenVbd_Inst_CoInstaller_AddReg]
    2.34 -HKR,,CoInstallers32,0x00010000, "xencoinst.dll,CoRequireReboot"
    2.35 +;[XenVbd_Inst_CoInstaller_AddReg]
    2.36 +;HKR,,CoInstallers32,0x00010000, "xencoinst.dll,CoRequireReboot"
    2.37  
    2.38 -[XenVbd_Inst_CoInstaller_CopyFiles]
    2.39 -xencoinst.dll
    2.40 +;[XenVbd_Inst_CoInstaller_CopyFiles]
    2.41 +;xencoinst.dll
    2.42  
    2.43  [SourceDisksFiles]
    2.44  xenvbd.sys=1
    2.45 -xencoinst.dll=1
    2.46 +;xencoinst.dll=1
    2.47  
    2.48  [SourceDisksNames]
    2.49  1 = %DISK_NAME%
    2.50 @@ -76,13 +79,6 @@ XenVbd.SVCDESC = "Xen Block Device Drive
    2.51  XenVbd.DRVDESC = "Xen Block Device Driver"
    2.52  DISK_NAME = "Xen Block Device Driver Install Disk"
    2.53  FLG_ADDREG_TYPE_DWORD = 0x00010001
    2.54 -XEN_INIT_TYPE_END = 0
    2.55 -XEN_INIT_TYPE_WRITE_STRING = 1
    2.56 -XEN_INIT_TYPE_RING = 2
    2.57 -XEN_INIT_TYPE_EVENT_CHANNEL = 3
    2.58 -XEN_INIT_TYPE_EVENT_CHANNEL_IRQ = 4
    2.59 -XEN_INIT_TYPE_READ_STRING_FRONT = 5
    2.60 -XEN_INIT_TYPE_READ_STRING_BACK = 6
    2.61 -XEN_INIT_TYPE_VECTORS = 7
    2.62 -XEN_INIT_TYPE_GRANT_ENTRIES = 8
    2.63 -XEN_INIT_TYPE_COPY_PTR = 9
    2.64 +QEMU_UNPLUG_ALL_IDE_DISKS = 1
    2.65 +QEMU_UNPLUG_ALL_NICS      = 2
    2.66 +QEMU_UNPLUG_AUX_IDE_DISKS = 4