VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmstorageifs.h@ 64274

Last change on this file since 64274 was 64274, checked in by vboxsync, 8 years ago

Devices/Storage: Doxygen fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 44.6 KB
Line 
1/** @file
2 * PDM - Pluggable Device Manager, Storage related interfaces.
3 */
4
5/*
6 * Copyright (C) 2006-2016 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___VBox_vmm_pdmstorageifs_h
27#define ___VBox_vmm_pdmstorageifs_h
28
29#include <iprt/sg.h>
30#include <VBox/types.h>
31
32RT_C_DECLS_BEGIN
33
34/** @defgroup grp_pdm_ifs_storage PDM Storage Interfaces
35 * @ingroup grp_pdm_interfaces
36 * @{
37 */
38
39
40/** Pointer to a mount interface. */
41typedef struct PDMIMOUNTNOTIFY *PPDMIMOUNTNOTIFY;
42/**
43 * Block interface (up).
44 * Pair with PDMIMOUNT.
45 */
46typedef struct PDMIMOUNTNOTIFY
47{
48 /**
49 * Called when a media is mounted.
50 *
51 * @param pInterface Pointer to the interface structure containing the called function pointer.
52 * @thread The emulation thread.
53 */
54 DECLR3CALLBACKMEMBER(void, pfnMountNotify,(PPDMIMOUNTNOTIFY pInterface));
55
56 /**
57 * Called when a media is unmounted
58 * @param pInterface Pointer to the interface structure containing the called function pointer.
59 * @thread The emulation thread.
60 */
61 DECLR3CALLBACKMEMBER(void, pfnUnmountNotify,(PPDMIMOUNTNOTIFY pInterface));
62} PDMIMOUNTNOTIFY;
63/** PDMIMOUNTNOTIFY interface ID. */
64#define PDMIMOUNTNOTIFY_IID "fa143ac9-9fc6-498e-997f-945380a558f9"
65
66
67/** Pointer to mount interface. */
68typedef struct PDMIMOUNT *PPDMIMOUNT;
69/**
70 * Mount interface (down).
71 * Pair with PDMIMOUNTNOTIFY.
72 */
73typedef struct PDMIMOUNT
74{
75 /**
76 * Unmount the media.
77 *
78 * The driver will validate and pass it on. On the rebounce it will decide whether or not to detach it self.
79 *
80 * @returns VBox status code.
81 * @param pInterface Pointer to the interface structure containing the called function pointer.
82 * @thread The emulation thread.
83 * @param fForce Force the unmount, even for locked media.
84 * @param fEject Eject the medium. Only relevant for host drives.
85 * @thread The emulation thread.
86 */
87 DECLR3CALLBACKMEMBER(int, pfnUnmount,(PPDMIMOUNT pInterface, bool fForce, bool fEject));
88
89 /**
90 * Checks if a media is mounted.
91 *
92 * @returns true if mounted.
93 * @returns false if not mounted.
94 * @param pInterface Pointer to the interface structure containing the called function pointer.
95 * @thread Any thread.
96 */
97 DECLR3CALLBACKMEMBER(bool, pfnIsMounted,(PPDMIMOUNT pInterface));
98
99 /**
100 * Locks the media, preventing any unmounting of it.
101 *
102 * @returns VBox status code.
103 * @param pInterface Pointer to the interface structure containing the called function pointer.
104 * @thread The emulation thread.
105 */
106 DECLR3CALLBACKMEMBER(int, pfnLock,(PPDMIMOUNT pInterface));
107
108 /**
109 * Unlocks the media, canceling previous calls to pfnLock().
110 *
111 * @returns VBox status code.
112 * @param pInterface Pointer to the interface structure containing the called function pointer.
113 * @thread The emulation thread.
114 */
115 DECLR3CALLBACKMEMBER(int, pfnUnlock,(PPDMIMOUNT pInterface));
116
117 /**
118 * Checks if a media is locked.
119 *
120 * @returns true if locked.
121 * @returns false if not locked.
122 * @param pInterface Pointer to the interface structure containing the called function pointer.
123 * @thread Any thread.
124 */
125 DECLR3CALLBACKMEMBER(bool, pfnIsLocked,(PPDMIMOUNT pInterface));
126} PDMIMOUNT;
127/** PDMIMOUNT interface ID. */
128#define PDMIMOUNT_IID "34fc7a4c-623a-4806-a6bf-5be1be33c99f"
129
130
131/**
132 * Callback which provides progress information.
133 *
134 * @return VBox status code.
135 * @param pvUser Opaque user data.
136 * @param uPercent Completion percentage.
137 */
138typedef DECLCALLBACK(int) FNSIMPLEPROGRESS(void *pvUser, unsigned uPercentage);
139/** Pointer to FNSIMPLEPROGRESS() */
140typedef FNSIMPLEPROGRESS *PFNSIMPLEPROGRESS;
141
142
143/**
144 * Media type.
145 */
146typedef enum PDMMEDIATYPE
147{
148 /** Error (for the query function). */
149 PDMMEDIATYPE_ERROR = 1,
150 /** 360KB 5 1/4" floppy drive. */
151 PDMMEDIATYPE_FLOPPY_360,
152 /** 720KB 3 1/2" floppy drive. */
153 PDMMEDIATYPE_FLOPPY_720,
154 /** 1.2MB 5 1/4" floppy drive. */
155 PDMMEDIATYPE_FLOPPY_1_20,
156 /** 1.44MB 3 1/2" floppy drive. */
157 PDMMEDIATYPE_FLOPPY_1_44,
158 /** 2.88MB 3 1/2" floppy drive. */
159 PDMMEDIATYPE_FLOPPY_2_88,
160 /** Fake drive that can take up to 15.6 MB images.
161 * C=255, H=2, S=63. */
162 PDMMEDIATYPE_FLOPPY_FAKE_15_6,
163 /** Fake drive that can take up to 63.5 MB images.
164 * C=255, H=2, S=255. */
165 PDMMEDIATYPE_FLOPPY_FAKE_63_5,
166 /** CDROM drive. */
167 PDMMEDIATYPE_CDROM,
168 /** DVD drive. */
169 PDMMEDIATYPE_DVD,
170 /** Hard disk drive. */
171 PDMMEDIATYPE_HARD_DISK
172} PDMMEDIATYPE;
173
174/** Check if the given block type is a floppy. */
175#define PDMMEDIATYPE_IS_FLOPPY(a_enmType) ( (a_enmType) >= PDMMEDIATYPE_FLOPPY_360 && (a_enmType) <= PDMMEDIATYPE_FLOPPY_2_88 )
176
177/**
178 * Raw command data transfer direction.
179 */
180typedef enum PDMMEDIATXDIR
181{
182 PDMMEDIATXDIR_NONE = 0,
183 PDMMEDIATXDIR_FROM_DEVICE,
184 PDMMEDIATXDIR_TO_DEVICE
185} PDMMEDIATXDIR;
186
187/**
188 * Media geometry structure.
189 */
190typedef struct PDMMEDIAGEOMETRY
191{
192 /** Number of cylinders. */
193 uint32_t cCylinders;
194 /** Number of heads. */
195 uint32_t cHeads;
196 /** Number of sectors. */
197 uint32_t cSectors;
198} PDMMEDIAGEOMETRY;
199
200/** Pointer to media geometry structure. */
201typedef PDMMEDIAGEOMETRY *PPDMMEDIAGEOMETRY;
202/** Pointer to constant media geometry structure. */
203typedef const PDMMEDIAGEOMETRY *PCPDMMEDIAGEOMETRY;
204
205/** Pointer to a media port interface. */
206typedef struct PDMIMEDIAPORT *PPDMIMEDIAPORT;
207/**
208 * Media port interface (down).
209 */
210typedef struct PDMIMEDIAPORT
211{
212 /**
213 * Returns the storage controller name, instance and LUN of the attached medium.
214 *
215 * @returns VBox status.
216 * @param pInterface Pointer to this interface.
217 * @param ppcszController Where to store the name of the storage controller.
218 * @param piInstance Where to store the instance number of the controller.
219 * @param piLUN Where to store the LUN of the attached device.
220 */
221 DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMIMEDIAPORT pInterface, const char **ppcszController,
222 uint32_t *piInstance, uint32_t *piLUN));
223
224} PDMIMEDIAPORT;
225/** PDMIMEDIAPORT interface ID. */
226#define PDMIMEDIAPORT_IID "9f7e8c9e-6d35-4453-bbef-1f78033174d6"
227
228/** Pointer to a media interface. */
229typedef struct PDMIMEDIA *PPDMIMEDIA;
230/**
231 * Media interface (up).
232 * Pairs with PDMIMEDIAPORT.
233 */
234typedef struct PDMIMEDIA
235{
236 /**
237 * Read bits.
238 *
239 * @returns VBox status code.
240 * @param pInterface Pointer to the interface structure containing the called function pointer.
241 * @param off Offset to start reading from. The offset must be aligned to a sector boundary.
242 * @param pvBuf Where to store the read bits.
243 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
244 * @thread Any thread.
245 */
246 DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIMEDIA pInterface, uint64_t off, void *pvBuf, size_t cbRead));
247
248 /**
249 * Read bits - version for DevPcBios.
250 *
251 * @returns VBox status code.
252 * @param pInterface Pointer to the interface structure containing the called function pointer.
253 * @param off Offset to start reading from. The offset must be aligned to a sector boundary.
254 * @param pvBuf Where to store the read bits.
255 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
256 * @thread Any thread.
257 *
258 * @note: Special version of pfnRead which doesn't try to suspend the VM when the DEKs for encrypted disks
259 * are missing but just returns an error.
260 */
261 DECLR3CALLBACKMEMBER(int, pfnReadPcBios,(PPDMIMEDIA pInterface, uint64_t off, void *pvBuf, size_t cbRead));
262
263 /**
264 * Write bits.
265 *
266 * @returns VBox status code.
267 * @param pInterface Pointer to the interface structure containing the called function pointer.
268 * @param off Offset to start writing at. The offset must be aligned to a sector boundary.
269 * @param pvBuf Where to store the write bits.
270 * @param cbWrite Number of bytes to write. Must be aligned to a sector boundary.
271 * @thread Any thread.
272 */
273 DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIMEDIA pInterface, uint64_t off, const void *pvBuf, size_t cbWrite));
274
275 /**
276 * Make sure that the bits written are actually on the storage medium.
277 *
278 * @returns VBox status code.
279 * @param pInterface Pointer to the interface structure containing the called function pointer.
280 * @thread Any thread.
281 */
282 DECLR3CALLBACKMEMBER(int, pfnFlush,(PPDMIMEDIA pInterface));
283
284 /**
285 * Send a raw command to the underlying device (CDROM).
286 * This method is optional (i.e. the function pointer may be NULL).
287 *
288 * @returns VBox status code.
289 * @param pInterface Pointer to the interface structure containing the called function pointer.
290 * @param pbCmd Offset to start reading from.
291 * @param enmTxDir Direction of transfer.
292 * @param pvBuf Pointer tp the transfer buffer.
293 * @param pcbBuf Size of the transfer buffer.
294 * @param pabSense Status of the command (when return value is VERR_DEV_IO_ERROR).
295 * @param cbSense Size of the sense buffer in bytes.
296 * @param cTimeoutMillies Command timeout in milliseconds.
297 * @thread Any thread.
298 */
299 DECLR3CALLBACKMEMBER(int, pfnSendCmd,(PPDMIMEDIA pInterface, const uint8_t *pbCmd, PDMMEDIATXDIR enmTxDir,
300 void *pvBuf, uint32_t *pcbBuf, uint8_t *pabSense, size_t cbSense,
301 uint32_t cTimeoutMillies));
302
303 /**
304 * Merge medium contents during a live snapshot deletion. All details
305 * must have been configured through CFGM or this will fail.
306 * This method is optional (i.e. the function pointer may be NULL).
307 *
308 * @returns VBox status code.
309 * @param pInterface Pointer to the interface structure containing the called function pointer.
310 * @param pfnProgress Function pointer for progress notification.
311 * @param pvUser Opaque user data for progress notification.
312 * @thread Any thread.
313 */
314 DECLR3CALLBACKMEMBER(int, pfnMerge,(PPDMIMEDIA pInterface, PFNSIMPLEPROGRESS pfnProgress, void *pvUser));
315
316 /**
317 * Sets the secret key retrieval interface to use to get secret keys.
318 *
319 * @returns VBox status code.
320 * @param pInterface Pointer to the interface structure containing the called function pointer.
321 * @param pIfSecKey The secret key interface to use.
322 * Use NULL to clear the currently set interface and clear all secret
323 * keys from the user.
324 * @param pIfSecKeyHlp The secret key helper interface to use.
325 * @thread Any thread.
326 */
327 DECLR3CALLBACKMEMBER(int, pfnSetSecKeyIf,(PPDMIMEDIA pInterface, PPDMISECKEY pIfSecKey,
328 PPDMISECKEYHLP pIfSecKeyHlp));
329
330 /**
331 * Get the media size in bytes.
332 *
333 * @returns Media size in bytes.
334 * @param pInterface Pointer to the interface structure containing the called function pointer.
335 * @thread Any thread.
336 */
337 DECLR3CALLBACKMEMBER(uint64_t, pfnGetSize,(PPDMIMEDIA pInterface));
338
339 /**
340 * Gets the media sector size in bytes.
341 *
342 * @returns Media sector size in bytes.
343 * @param pInterface Pointer to the interface structure containing the called function pointer.
344 * @thread Any thread.
345 */
346 DECLR3CALLBACKMEMBER(uint32_t, pfnGetSectorSize,(PPDMIMEDIA pInterface));
347
348 /**
349 * Check if the media is readonly or not.
350 *
351 * @returns true if readonly.
352 * @returns false if read/write.
353 * @param pInterface Pointer to the interface structure containing the called function pointer.
354 * @thread Any thread.
355 */
356 DECLR3CALLBACKMEMBER(bool, pfnIsReadOnly,(PPDMIMEDIA pInterface));
357
358 /**
359 * Returns whether the medium should be marked as rotational or not.
360 *
361 * @returns true if non rotating medium.
362 * @returns false if rotating medium.
363 * @param pInterface Pointer to the interface structure containing the called function pointer.
364 * @thread Any thread.
365 */
366 DECLR3CALLBACKMEMBER(bool, pfnIsNonRotational,(PPDMIMEDIA pInterface));
367
368 /**
369 * Get stored media geometry (physical CHS, PCHS) - BIOS property.
370 * This is an optional feature of a media.
371 *
372 * @returns VBox status code.
373 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
374 * @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnBiosSetPCHSGeometry() yet.
375 * @param pInterface Pointer to the interface structure containing the called function pointer.
376 * @param pPCHSGeometry Pointer to PCHS geometry (cylinders/heads/sectors).
377 * @remark This has no influence on the read/write operations.
378 * @thread Any thread.
379 */
380 DECLR3CALLBACKMEMBER(int, pfnBiosGetPCHSGeometry,(PPDMIMEDIA pInterface, PPDMMEDIAGEOMETRY pPCHSGeometry));
381
382 /**
383 * Store the media geometry (physical CHS, PCHS) - BIOS property.
384 * This is an optional feature of a media.
385 *
386 * @returns VBox status code.
387 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
388 * @param pInterface Pointer to the interface structure containing the called function pointer.
389 * @param pPCHSGeometry Pointer to PCHS geometry (cylinders/heads/sectors).
390 * @remark This has no influence on the read/write operations.
391 * @thread The emulation thread.
392 */
393 DECLR3CALLBACKMEMBER(int, pfnBiosSetPCHSGeometry,(PPDMIMEDIA pInterface, PCPDMMEDIAGEOMETRY pPCHSGeometry));
394
395 /**
396 * Get stored media geometry (logical CHS, LCHS) - BIOS property.
397 * This is an optional feature of a media.
398 *
399 * @returns VBox status code.
400 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
401 * @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnBiosSetLCHSGeometry() yet.
402 * @param pInterface Pointer to the interface structure containing the called function pointer.
403 * @param pLCHSGeometry Pointer to LCHS geometry (cylinders/heads/sectors).
404 * @remark This has no influence on the read/write operations.
405 * @thread Any thread.
406 */
407 DECLR3CALLBACKMEMBER(int, pfnBiosGetLCHSGeometry,(PPDMIMEDIA pInterface, PPDMMEDIAGEOMETRY pLCHSGeometry));
408
409 /**
410 * Store the media geometry (logical CHS, LCHS) - BIOS property.
411 * This is an optional feature of a media.
412 *
413 * @returns VBox status code.
414 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
415 * @param pInterface Pointer to the interface structure containing the called function pointer.
416 * @param pLCHSGeometry Pointer to LCHS geometry (cylinders/heads/sectors).
417 * @remark This has no influence on the read/write operations.
418 * @thread The emulation thread.
419 */
420 DECLR3CALLBACKMEMBER(int, pfnBiosSetLCHSGeometry,(PPDMIMEDIA pInterface, PCPDMMEDIAGEOMETRY pLCHSGeometry));
421
422 /**
423 * Checks if the device should be visible to the BIOS or not.
424 *
425 * @returns true if the device is visible to the BIOS.
426 * @returns false if the device is not visible to the BIOS.
427 * @param pInterface Pointer to the interface structure containing the called function pointer.
428 * @thread Any thread.
429 */
430 DECLR3CALLBACKMEMBER(bool, pfnBiosIsVisible,(PPDMIMEDIA pInterface));
431
432 /**
433 * Gets the media type.
434 *
435 * @returns media type.
436 * @param pInterface Pointer to the interface structure containing the called function pointer.
437 * @thread Any thread.
438 */
439 DECLR3CALLBACKMEMBER(PDMMEDIATYPE, pfnGetType,(PPDMIMEDIA pInterface));
440
441 /**
442 * Gets the UUID of the media drive.
443 *
444 * @returns VBox status code.
445 * @param pInterface Pointer to the interface structure containing the called function pointer.
446 * @param pUuid Where to store the UUID on success.
447 * @thread Any thread.
448 */
449 DECLR3CALLBACKMEMBER(int, pfnGetUuid,(PPDMIMEDIA pInterface, PRTUUID pUuid));
450
451 /**
452 * Discards the given range.
453 *
454 * @returns VBox status code.
455 * @param pInterface Pointer to the interface structure containing the called function pointer.
456 * @param paRanges Array of ranges to discard.
457 * @param cRanges Number of entries in the array.
458 * @thread Any thread.
459 */
460 DECLR3CALLBACKMEMBER(int, pfnDiscard,(PPDMIMEDIA pInterface, PCRTRANGE paRanges, unsigned cRanges));
461
462} PDMIMEDIA;
463/** PDMIMEDIA interface ID. */
464#define PDMIMEDIA_IID "d344aeaa-3ad0-4563-bb03-2733383e9230"
465
466
467/**
468 * Opaque I/O request handle.
469 *
470 * The specific content depends on the driver implementing this interface.
471 */
472typedef struct PDMMEDIAEXIOREQINT *PDMMEDIAEXIOREQ;
473/** Pointer to an I/O request handle. */
474typedef PDMMEDIAEXIOREQ *PPDMMEDIAEXIOREQ;
475
476/** A I/O request ID. */
477typedef uint64_t PDMMEDIAEXIOREQID;
478
479/**
480 * I/O Request Type.
481 */
482typedef enum PDMMEDIAEXIOREQTYPE
483{
484 /** Invalid tpe. */
485 PDMMEDIAEXIOREQTYPE_INVALID = 0,
486 /** Flush request. */
487 PDMMEDIAEXIOREQTYPE_FLUSH,
488 /** Write request. */
489 PDMMEDIAEXIOREQTYPE_WRITE,
490 /** Read request. */
491 PDMMEDIAEXIOREQTYPE_READ,
492 /** Discard request. */
493 PDMMEDIAEXIOREQTYPE_DISCARD,
494 /** SCSI command. */
495 PDMMEDIAEXIOREQTYPE_SCSI
496} PDMMEDIAEXIOREQTYPE;
497/** Pointer to a I/O request type. */
498typedef PDMMEDIAEXIOREQTYPE *PPDMMEDIAEXIOREQTYPE;
499
500/**
501 * Data direction for raw SCSI commands.
502 */
503typedef enum PDMMEDIAEXIOREQSCSITXDIR
504{
505 /** Invalid data direction. */
506 PDMMEDIAEXIOREQSCSITXDIR_INVALID = 0,
507 /** Direction is unknown. */
508 PDMMEDIAEXIOREQSCSITXDIR_UNKNOWN,
509 /** Direction is from device to host. */
510 PDMMEDIAEXIOREQSCSITXDIR_FROM_DEVICE,
511 /** Direction is from host to device. */
512 PDMMEDIAEXIOREQSCSITXDIR_TO_DEVICE,
513 /** No data transfer associated with this request. */
514 PDMMEDIAEXIOREQSCSITXDIR_NONE,
515 /** 32bit hack. */
516 PDMMEDIAEXIOREQSCSITXDIR_32BIT_HACK = 0x7fffffff
517} PDMMEDIAEXIOREQSCSITXDIR;
518
519/**
520 * I/O request state.
521 */
522typedef enum PDMMEDIAEXIOREQSTATE
523{
524 /** Invalid state. */
525 PDMMEDIAEXIOREQSTATE_INVALID = 0,
526 /** The request is active and being processed. */
527 PDMMEDIAEXIOREQSTATE_ACTIVE,
528 /** The request is suspended due to an error and no processing will take place. */
529 PDMMEDIAEXIOREQSTATE_SUSPENDED,
530 /** 32bit hack. */
531 PDMMEDIAEXIOREQSTATE_32BIT_HACK = 0x7fffffff
532} PDMMEDIAEXIOREQSTATE;
533/** Pointer to a I/O request state. */
534typedef PDMMEDIAEXIOREQSTATE *PPDMMEDIAEXIOREQSTATE;
535
536/** @name Supported feature flags
537 * @{ */
538/** I/O requests will execute asynchronously by default. */
539#define PDMIMEDIAEX_FEATURE_F_ASYNC RT_BIT_32(0)
540/** The discard request is supported. */
541#define PDMIMEDIAEX_FEATURE_F_DISCARD RT_BIT_32(1)
542/** The send raw SCSI command request is supported. */
543#define PDMIMEDIAEX_FEATURE_F_RAWSCSICMD RT_BIT_32(2)
544/** Mask of valid flags. */
545#define PDMIMEDIAEX_FEATURE_F_VALID (PDMIMEDIAEX_FEATURE_F_ASYNC | PDMIMEDIAEX_FEATURE_F_DISCARD | PDMIMEDIAEX_FEATURE_F_RAWSCSICMD)
546/** @} */
547
548/** @name I/O request specific flags
549 * @{ */
550/** Default behavior (async I/O).*/
551#define PDMIMEDIAEX_F_DEFAULT (0)
552/** The I/O request will be executed synchronously. */
553#define PDMIMEDIAEX_F_SYNC RT_BIT_32(0)
554/** Whether to suspend the VM on a recoverable error with
555 * an appropriate error message (disk full, etc.).
556 * The request will be retried by the driver implementing the interface
557 * when the VM resumes the next time. However before suspending the request
558 * the owner of the request will be notified using the PDMMEDIAEXPORT::pfnIoReqStateChanged.
559 * The same goes for resuming the request after the VM was resumed.
560 */
561#define PDMIMEDIAEX_F_SUSPEND_ON_RECOVERABLE_ERR RT_BIT_32(1)
562 /** Mask of valid flags. */
563#define PDMIMEDIAEX_F_VALID (PDMIMEDIAEX_F_SYNC | PDMIMEDIAEX_F_SUSPEND_ON_RECOVERABLE_ERR)
564/** @} */
565
566/** Pointer to an extended media notification interface. */
567typedef struct PDMIMEDIAEXPORT *PPDMIMEDIAEXPORT;
568
569/**
570 * Asynchronous version of the media interface (up).
571 * Pair with PDMIMEDIAEXPORT.
572 */
573typedef struct PDMIMEDIAEXPORT
574{
575 /**
576 * Notify completion of a I/O request.
577 *
578 * @returns VBox status code.
579 * @param pInterface Pointer to the interface structure containing the called function pointer.
580 * @param hIoReq The I/O request handle.
581 * @param pvIoReqAlloc The allocator specific memory for this request.
582 * @param rcReq IPRT Status code of the completed request.
583 * VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
584 * PDMIMEDIAEX::pfnIoReqCancel.
585 * @thread Any thread.
586 */
587 DECLR3CALLBACKMEMBER(int, pfnIoReqCompleteNotify, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
588 void *pvIoReqAlloc, int rcReq));
589
590 /**
591 * Copy data from the memory buffer of the caller to the callees memory buffer for the given request.
592 *
593 * @returns VBox status code.
594 * @retval VERR_PDM_MEDIAEX_IOBUF_OVERFLOW if there is not enough room to store the data.
595 * @param pInterface Pointer to the interface structure containing the called function pointer.
596 * @param hIoReq The I/O request handle.
597 * @param pvIoReqAlloc The allocator specific memory for this request.
598 * @param offDst The destination offset from the start to write the data to.
599 * @param pSgBuf The S/G buffer to read the data from.
600 * @param cbCopy How many bytes to copy.
601 */
602 DECLR3CALLBACKMEMBER(int, pfnIoReqCopyFromBuf, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
603 void *pvIoReqAlloc, uint32_t offDst, PRTSGBUF pSgBuf,
604 size_t cbCopy));
605
606 /**
607 * Copy data to the memory buffer of the caller from the callees memory buffer for the given request.
608 *
609 * @returns VBox status code.
610 * @retval VERR_PDM_MEDIAEX_IOBUF_UNDERRUN if there is not enough data to copy from the buffer.
611 * @param pInterface Pointer to the interface structure containing the called function pointer.
612 * @param hIoReq The I/O request handle.
613 * @param pvIoReqAlloc The allocator specific memory for this request.
614 * @param offSrc The offset from the start of the buffer to read the data from.
615 * @param pSgBuf The S/G buffer to write the data to.
616 * @param cbCopy How many bytes to copy.
617 */
618 DECLR3CALLBACKMEMBER(int, pfnIoReqCopyToBuf, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
619 void *pvIoReqAlloc, uint32_t offSrc, PRTSGBUF pSgBuf,
620 size_t cbCopy));
621
622 /**
623 * Queries the specified amount of ranges to discard from the callee for the given I/O request.
624 *
625 * @returns VBox status code.
626 * @param pInterface Pointer to the interface structure containing the called function pointer.
627 * @param hIoReq The I/O request handle.
628 * @param pvIoReqAlloc The allocator specific memory for this request.
629 * @param idxRangeStart The range index to start with.
630 * @param cRanges How man ranges can be stored in the provided array.
631 * @param paRanges Where to store the ranges on success.
632 * @param *pcRanges Where to store the number of ranges copied over on success.
633 */
634 DECLR3CALLBACKMEMBER(int, pfnIoReqQueryDiscardRanges, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
635 void *pvIoReqAlloc, uint32_t idxRangeStart,
636 uint32_t cRanges, PRTRANGE paRanges,
637 uint32_t *pcRanges));
638
639 /**
640 * Notify the request owner about a state change for the request.
641 *
642 * @returns nothing.
643 * @param pInterface Pointer to the interface structure containing the called function pointer.
644 * @param hIoReq The I/O request handle.
645 * @param pvIoReqAlloc The allocator specific memory for this request.
646 * @param enmState The new state of the request.
647 */
648 DECLR3CALLBACKMEMBER(void, pfnIoReqStateChanged, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
649 void *pvIoReqAlloc, PDMMEDIAEXIOREQSTATE enmState));
650
651 /**
652 * Informs the device that the underlying medium was ejected.
653 *
654 * @returns nothing.
655 * @param pInterface Pointer to the interface structure containing the called function pointer.
656 */
657 DECLR3CALLBACKMEMBER(void, pfnMediumEjected, (PPDMIMEDIAEXPORT pInterface));
658
659} PDMIMEDIAEXPORT;
660
661/** PDMIMEDIAAEXPORT interface ID. */
662#define PDMIMEDIAEXPORT_IID "e0a586a6-4186-40d0-8067-c754b6585b53"
663
664
665/** Pointer to an extended media interface. */
666typedef struct PDMIMEDIAEX *PPDMIMEDIAEX;
667
668/**
669 * Extended version of PDMIMEDIA (down).
670 * Pair with PDMIMEDIAEXPORT.
671 */
672typedef struct PDMIMEDIAEX
673{
674 /**
675 * Queries the features supported by the entity implementing this interface.
676 *
677 * @returns VBox status code.
678 * @param pInterface Pointer to the interface structure containing the called function pointer.
679 * @param pfFeatures Where to store the supported feature flags on success.
680 */
681 DECLR3CALLBACKMEMBER(int, pfnQueryFeatures, (PPDMIMEDIAEX pInterface, uint32_t *pfFeatures));
682
683 /**
684 * Sets the size of the allocator specific memory for a I/O request.
685 *
686 * @returns VBox status code.
687 * @param pInterface Pointer to the interface structure containing the called function pointer.
688 * @param cbIoReqAlloc The size of the allocator specific memory in bytes.
689 * @thread EMT.
690 */
691 DECLR3CALLBACKMEMBER(int, pfnIoReqAllocSizeSet, (PPDMIMEDIAEX pInterface, size_t cbIoReqAlloc));
692
693 /**
694 * Allocates a new I/O request.
695 *
696 * @returns VBox status code.
697 * @retval VERR_PDM_MEDIAEX_IOREQID_CONFLICT if the ID belongs to a still active request.
698 * @param pInterface Pointer to the interface structure containing the called function pointer.
699 * @param phIoReq Where to store the handle to the new I/O request on success.
700 * @param ppvIoReqAlloc Where to store the pointer to the allocator specific memory on success.
701 * NULL if the memory size was not set or set to 0.
702 * @param uIoReqId A custom request ID which can be used to cancel the request.
703 * @param fFlags A combination of PDMIMEDIAEX_F_* flags.
704 * @thread Any thread.
705 */
706 DECLR3CALLBACKMEMBER(int, pfnIoReqAlloc, (PPDMIMEDIAEX pInterface, PPDMMEDIAEXIOREQ phIoReq, void **ppvIoReqAlloc,
707 PDMMEDIAEXIOREQID uIoReqId, uint32_t fFlags));
708
709 /**
710 * Frees a given I/O request.
711 *
712 * @returns VBox status code.
713 * @retval VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE if the given request is still active.
714 * @param pInterface Pointer to the interface structure containing the called function pointer.
715 * @param hIoReq The I/O request to free.
716 * @thread Any thread.
717 */
718 DECLR3CALLBACKMEMBER(int, pfnIoReqFree, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq));
719
720 /**
721 * Queries the residual amount of data not transfered when the request completed.
722 *
723 * @returns VBox status code.
724 * @retval VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE has not completed yet.
725 * @param pInterface Pointer to the interface structure containing the called function pointer.
726 * @param hIoReq The I/O request.
727 * @param pcbResidual Where to store the amount of resdiual data in bytes.
728 * @thread Any thread.
729 */
730 DECLR3CALLBACKMEMBER(int, pfnIoReqQueryResidual, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, size_t *pcbResidual));
731
732 /**
733 * Cancels all I/O active requests.
734 *
735 * @returns VBox status code.
736 * @param pInterface Pointer to the interface structure containing the called function pointer.
737 * @thread Any thread.
738 */
739 DECLR3CALLBACKMEMBER(int, pfnIoReqCancelAll, (PPDMIMEDIAEX pInterface));
740
741 /**
742 * Cancels a I/O request identified by the ID.
743 *
744 * @returns VBox status code.
745 * @retval VERR_PDM_MEDIAEX_IOREQID_NOT_FOUND if the given ID could not be found in the active request list.
746 * (The request has either completed already or an invalid ID was given).
747 * @param pInterface Pointer to the interface structure containing the called function pointer.
748 * @param uIoReqId The I/O request ID
749 * @thread Any thread.
750 */
751 DECLR3CALLBACKMEMBER(int, pfnIoReqCancel, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQID uIoReqId));
752
753 /**
754 * Start a reading request.
755 *
756 * @returns VBox status code.
757 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
758 * PDMIMEDIAEX::pfnIoReqCancel.
759 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
760 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
761 * @retval VINF_SUCCESS if the request completed successfully.
762 * @param pInterface Pointer to the interface structure containing the called function pointer.
763 * @param hIoReq The I/O request to associate the read with.
764 * @param off Offset to start reading from. Must be aligned to a sector boundary.
765 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
766 * @thread Any thread.
767 */
768 DECLR3CALLBACKMEMBER(int, pfnIoReqRead, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, uint64_t off, size_t cbRead));
769
770 /**
771 * Start a writing request.
772 *
773 * @returns VBox status code.
774 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
775 * PDMIMEDIAEX::pfnIoReqCancel.
776 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
777 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
778 * @retval VINF_SUCCESS if the request completed successfully.
779 * @param pInterface Pointer to the interface structure containing the called function pointer.
780 * @param hIoReq The I/O request to associate the write with.
781 * @param off Offset to start reading from. Must be aligned to a sector boundary.
782 * @param cbWrite Number of bytes to write. Must be aligned to a sector boundary.
783 * @thread Any thread.
784 */
785 DECLR3CALLBACKMEMBER(int, pfnIoReqWrite, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, uint64_t off, size_t cbWrite));
786
787 /**
788 * Flush everything to disk.
789 *
790 * @returns VBox status code.
791 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
792 * PDMIMEDIAEX::pfnIoReqCancel.
793 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
794 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
795 * @retval VINF_SUCCESS if the request completed successfully.
796 * @param pInterface Pointer to the interface structure containing the called function pointer.
797 * @param hIoReq The I/O request to associate the flush with.
798 * @thread Any thread.
799 */
800 DECLR3CALLBACKMEMBER(int, pfnIoReqFlush, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq));
801
802 /**
803 * Discards the given range.
804 *
805 * @returns VBox status code.
806 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
807 * PDMIMEDIAEX::pfnIoReqCancel.
808 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
809 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
810 * @retval VINF_SUCCESS if the request completed successfully.
811 * @param pInterface Pointer to the interface structure containing the called function pointer.
812 * @param hIoReq The I/O request to associate the discard with.
813 * @param cRangesMax The maximum number of ranges this request has associated, this must not be accurate
814 * but can actually be bigger than the amount of ranges actually available.
815 * @thread Any thread.
816 */
817 DECLR3CALLBACKMEMBER(int, pfnIoReqDiscard, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, unsigned cRangesMax));
818
819 /**
820 * Send a raw command to the underlying device (CDROM).
821 *
822 * @returns VBox status code.
823 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
824 * PDMIMEDIAEX::pfnIoReqCancel.
825 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
826 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
827 * @param pInterface Pointer to the interface structure containing the called function pointer.
828 * @param hIoReq The I/O request to associate the command with.
829 * @param uLun The LUN the command is for.
830 * @param pbCdb The SCSI CDB containing the command.
831 * @param cbCdb Size of the CDB in bytes.
832 * @param enmTxDir Direction of transfer.
833 * @param cbBuf Size of the transfer buffer.
834 * @param pabSense Where to store the optional sense key.
835 * @param cbSense Size of the sense key buffer.
836 * @param pu8ScsiSts Where to store the SCSI status on success.
837 * @param cTimeoutMillies Command timeout in milliseconds.
838 * @thread Any thread.
839 */
840 DECLR3CALLBACKMEMBER(int, pfnIoReqSendScsiCmd,(PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, uint32_t uLun,
841 const uint8_t *pbCdb, size_t cbCdb, PDMMEDIAEXIOREQSCSITXDIR enmTxDir,
842 size_t cbBuf, uint8_t *pabSense, size_t cbSense, uint8_t *pu8ScsiSts,
843 uint32_t cTimeoutMillies));
844
845 /**
846 * Returns the number of active I/O requests.
847 *
848 * @returns Number of active I/O requests.
849 * @param pInterface Pointer to the interface structure containing the called function pointer.
850 * @thread Any thread.
851 */
852 DECLR3CALLBACKMEMBER(uint32_t, pfnIoReqGetActiveCount, (PPDMIMEDIAEX pInterface));
853
854 /**
855 * Returns the number of suspended requests.
856 *
857 * @returns Number of suspended I/O requests.
858 * @param pInterface Pointer to the interface structure containing the called function pointer.
859 * @thread Any thread.
860 */
861 DECLR3CALLBACKMEMBER(uint32_t, pfnIoReqGetSuspendedCount, (PPDMIMEDIAEX pInterface));
862
863 /**
864 * Gets the first suspended request handle.
865 *
866 * @returns VBox status code.
867 * @retval VERR_NOT_FOUND if there is no suspended request waiting.
868 * @param pInterface Pointer to the interface structure containing the called function pointer.
869 * @param phIoReq Where to store the request handle on success.
870 * @param ppvIoReqAlloc Where to store the pointer to the allocator specific memory on success.
871 * @thread Any thread.
872 *
873 * @note This should only be called when the VM is suspended to make sure the request doesn't suddenly
874 * changes into the active state again. The only purpose for this method for now is to make saving the state
875 * possible without breaking saved state versions.
876 */
877 DECLR3CALLBACKMEMBER(int, pfnIoReqQuerySuspendedStart, (PPDMIMEDIAEX pInterface, PPDMMEDIAEXIOREQ phIoReq, void **ppvIoReqAlloc));
878
879 /**
880 * Gets the next suspended request handle.
881 *
882 * @returns VBox status code.
883 * @retval VERR_NOT_FOUND if there is no suspended request waiting.
884 * @param pInterface Pointer to the interface structure containing the called function pointer.
885 * @param hIoReq The current request handle.
886 * @param phIoReqNext Where to store the request handle on success.
887 * @param ppvIoReqAllocNext Where to store the pointer to the allocator specific memory on success.
888 * @thread Any thread.
889 *
890 * @note This should only be called when the VM is suspended to make sure the request doesn't suddenly
891 * changes into the active state again. The only purpose for this method for now is to make saving the state
892 * possible without breaking saved state versions.
893 */
894 DECLR3CALLBACKMEMBER(int, pfnIoReqQuerySuspendedNext, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq,
895 PPDMMEDIAEXIOREQ phIoReqNext, void **ppvIoReqAllocNext));
896
897 /**
898 * Saves the given I/O request state in the provided saved state unit.
899 *
900 * @returns VBox status code.
901 * @param pInterface Pointer to the interface structure containing the called function pointer.
902 * @param pSSM The SSM handle.
903 * @param hIoReq The request handle to save.
904 */
905 DECLR3CALLBACKMEMBER(int, pfnIoReqSuspendedSave, (PPDMIMEDIAEX pInterface, PSSMHANDLE pSSM, PDMMEDIAEXIOREQ hIoReq));
906
907 /**
908 * Load a suspended request state from the given saved state unit and link it into the suspended list.
909 *
910 * @returns VBox status code.
911 * @param pInterface Pointer to the interface structure containing the called function pointer.
912 * @param pSSM The SSM handle to read the state from.
913 * @param hIoReq The request handle to load the state into.
914 */
915 DECLR3CALLBACKMEMBER(int, pfnIoReqSuspendedLoad, (PPDMIMEDIAEX pInterface, PSSMHANDLE pSSM, PDMMEDIAEXIOREQ hIoReq));
916
917} PDMIMEDIAEX;
918/** PDMIMEDIAEX interface ID. */
919#define PDMIMEDIAEX_IID "134a5ba9-0d6c-443f-8619-14fea6caaa8d"
920
921/**
922 * Data direction.
923 */
924typedef enum PDMSCSIREQUESTTXDIR
925{
926 PDMSCSIREQUESTTXDIR_UNKNOWN = 0x00,
927 PDMSCSIREQUESTTXDIR_FROM_DEVICE = 0x01,
928 PDMSCSIREQUESTTXDIR_TO_DEVICE = 0x02,
929 PDMSCSIREQUESTTXDIR_NONE = 0x03,
930 PDMSCSIREQUESTTXDIR_32BIT_HACK = 0x7fffffff
931} PDMSCSIREQUESTTXDIR;
932
933/**
934 * SCSI request structure.
935 */
936typedef struct PDMSCSIREQUEST
937{
938 /** The logical unit. */
939 uint32_t uLogicalUnit;
940 /** Direction of the data flow. */
941 PDMSCSIREQUESTTXDIR uDataDirection;
942 /** Size of the SCSI CDB. */
943 uint32_t cbCDB;
944 /** Pointer to the SCSI CDB. */
945 uint8_t *pbCDB;
946 /** Overall size of all scatter gather list elements
947 * for data transfer if any. */
948 uint32_t cbScatterGather;
949 /** Number of elements in the scatter gather list. */
950 uint32_t cScatterGatherEntries;
951 /** Pointer to the head of the scatter gather list. */
952 PRTSGSEG paScatterGatherHead;
953 /** Size of the sense buffer. */
954 uint32_t cbSenseBuffer;
955 /** Pointer to the sense buffer. *
956 * Current assumption that the sense buffer is not scattered. */
957 uint8_t *pbSenseBuffer;
958 /** Opaque user data for use by the device. Left untouched by everything else! */
959 void *pvUser;
960} PDMSCSIREQUEST, *PPDMSCSIREQUEST;
961/** Pointer to a const SCSI request structure. */
962typedef const PDMSCSIREQUEST *PCSCSIREQUEST;
963
964/** Pointer to a SCSI port interface. */
965typedef struct PDMISCSIPORT *PPDMISCSIPORT;
966/**
967 * SCSI command execution port interface (down).
968 * Pair with PDMISCSICONNECTOR.
969 */
970typedef struct PDMISCSIPORT
971{
972
973 /**
974 * Notify the device on request completion.
975 *
976 * @returns VBox status code.
977 * @param pInterface Pointer to this interface.
978 * @param pSCSIRequest Pointer to the finished SCSI request.
979 * @param rcCompletion SCSI_STATUS_* code for the completed request.
980 * @param fRedo Flag whether the request can to be redone
981 * when it failed.
982 * @param rcReq The status code the request completed with (VERR_*)
983 * Should be only used to choose the correct error message
984 * displayed to the user if the error can be fixed by him
985 * (fRedo is true).
986 */
987 DECLR3CALLBACKMEMBER(int, pfnSCSIRequestCompleted, (PPDMISCSIPORT pInterface, PPDMSCSIREQUEST pSCSIRequest,
988 int rcCompletion, bool fRedo, int rcReq));
989
990 /**
991 * Returns the storage controller name, instance and LUN of the attached medium.
992 *
993 * @returns VBox status.
994 * @param pInterface Pointer to this interface.
995 * @param ppcszController Where to store the name of the storage controller.
996 * @param piInstance Where to store the instance number of the controller.
997 * @param piLUN Where to store the LUN of the attached device.
998 */
999 DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMISCSIPORT pInterface, const char **ppcszController,
1000 uint32_t *piInstance, uint32_t *piLUN));
1001
1002} PDMISCSIPORT;
1003/** PDMISCSIPORT interface ID. */
1004#define PDMISCSIPORT_IID "05d9fc3b-e38c-4b30-8344-a323feebcfe5"
1005
1006/**
1007 * LUN type.
1008 */
1009typedef enum PDMSCSILUNTYPE
1010{
1011 PDMSCSILUNTYPE_INVALID = 0,
1012 PDMSCSILUNTYPE_SBC, /** Hard disk (SBC) */
1013 PDMSCSILUNTYPE_MMC, /** CD/DVD drive (MMC) */
1014 PDMSCSILUNTYPE_SSC, /** Tape drive (SSC) */
1015 PDMSCSILUNTYPE_32BIT_HACK = 0x7fffffff
1016} PDMSCSILUNTYPE, *PPDMSCSILUNTYPE;
1017
1018
1019/** Pointer to a SCSI connector interface. */
1020typedef struct PDMISCSICONNECTOR *PPDMISCSICONNECTOR;
1021/**
1022 * SCSI command execution connector interface (up).
1023 * Pair with PDMISCSIPORT.
1024 */
1025typedef struct PDMISCSICONNECTOR
1026{
1027
1028 /**
1029 * Submits a SCSI request for execution.
1030 *
1031 * @returns VBox status code.
1032 * @param pInterface Pointer to this interface.
1033 * @param pSCSIRequest Pointer to the SCSI request to execute.
1034 */
1035 DECLR3CALLBACKMEMBER(int, pfnSCSIRequestSend, (PPDMISCSICONNECTOR pInterface, PPDMSCSIREQUEST pSCSIRequest));
1036
1037 /**
1038 * Queries the type of the attached LUN.
1039 *
1040 * @returns VBox status code.
1041 * @param pInterface Pointer to this interface.
1042 * @param iLUN The logical unit number.
1043 * @param pSCSIRequest Pointer to the LUN to be returned.
1044 */
1045 DECLR3CALLBACKMEMBER(int, pfnQueryLUNType, (PPDMISCSICONNECTOR pInterface, uint32_t iLun, PPDMSCSILUNTYPE pLUNType));
1046
1047} PDMISCSICONNECTOR;
1048/** PDMISCSICONNECTOR interface ID. */
1049#define PDMISCSICONNECTOR_IID "94465fbd-a2f2-447e-88c9-7366421bfbfe"
1050
1051/** @} */
1052
1053RT_C_DECLS_END
1054
1055#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette