/* Enumerate all devices of the given type on this bus. */
STATIC VOID XenBusEnumerateDeviceType(XENBUS_DEVICE *Dev, CONST CHAR8 *Type)
/* Enumerate all devices of the given type on this bus. */
STATIC VOID XenBusEnumerateDeviceType(XENBUS_DEVICE *Dev, CONST CHAR8 *Type)
{
  CONST CHAR8      **Directory;
  UINTN            Index;
  UINT32           Count;
  XENSTORE_STATUS  Status;
  Status = XenStoreListDirectory (
             XST_NIL,
             "device",
             Type,
             &Count,
             &Directory
             );
  if (Status != XENSTORE_STATUS_SUCCESS) {
    return;
  }
  for (Index = 0; Index < Count; Index++) {
    XenBusAddDevice (Dev, Type, Directory[Index]);
  }
  FreePool ((VOID *)Directory);
}