VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp@ 80239

Last change on this file since 80239 was 80191, checked in by vboxsync, 5 years ago

VMM/r3: Refactored VMCPU enumeration in preparation that aCpus will be replaced with a pointer array. Removed two raw-mode offset members from the CPUM and CPUMCPU sub-structures. bugref:9217 bugref:9517

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 40.4 KB
Line 
1/* $Id: PDMDevice.cpp 80191 2019-08-08 00:36:57Z vboxsync $ */
2/** @file
3 * PDM - Pluggable Device and Driver Manager, Device parts.
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*********************************************************************************************************************************
20* Header Files *
21*********************************************************************************************************************************/
22#define VBOX_BUGREF_9217_PART_I
23#define LOG_GROUP LOG_GROUP_PDM_DEVICE
24#include "PDMInternal.h"
25#include <VBox/vmm/pdm.h>
26#include <VBox/vmm/mm.h>
27#include <VBox/vmm/pgm.h>
28#include <VBox/vmm/iom.h>
29#include <VBox/vmm/hm.h>
30#include <VBox/vmm/cfgm.h>
31#include <VBox/vmm/apic.h>
32#ifdef VBOX_WITH_REM
33# include <VBox/vmm/rem.h>
34#endif
35#include <VBox/vmm/dbgf.h>
36#include <VBox/vmm/vm.h>
37#include <VBox/vmm/uvm.h>
38#include <VBox/vmm/vmm.h>
39
40#include <VBox/version.h>
41#include <VBox/log.h>
42#include <VBox/err.h>
43#include <iprt/alloc.h>
44#include <iprt/alloca.h>
45#include <iprt/asm.h>
46#include <iprt/assert.h>
47#include <iprt/path.h>
48#include <iprt/semaphore.h>
49#include <iprt/string.h>
50#include <iprt/thread.h>
51
52
53/*********************************************************************************************************************************
54* Structures and Typedefs *
55*********************************************************************************************************************************/
56/**
57 * Internal callback structure pointer.
58 * The main purpose is to define the extra data we associate
59 * with PDMDEVREGCB so we can find the VM instance and so on.
60 */
61typedef struct PDMDEVREGCBINT
62{
63 /** The callback structure. */
64 PDMDEVREGCB Core;
65 /** A bit of padding. */
66 uint32_t u32[4];
67 /** VM Handle. */
68 PVM pVM;
69 /** Pointer to the configuration node the registrations should be
70 * associated with. Can be NULL. */
71 PCFGMNODE pCfgNode;
72} PDMDEVREGCBINT;
73/** Pointer to a PDMDEVREGCBINT structure. */
74typedef PDMDEVREGCBINT *PPDMDEVREGCBINT;
75/** Pointer to a const PDMDEVREGCBINT structure. */
76typedef const PDMDEVREGCBINT *PCPDMDEVREGCBINT;
77
78
79/*********************************************************************************************************************************
80* Internal Functions *
81*********************************************************************************************************************************/
82static DECLCALLBACK(int) pdmR3DevReg_Register(PPDMDEVREGCB pCallbacks, PCPDMDEVREG pReg);
83static int pdmR3DevLoadModules(PVM pVM);
84static int pdmR3DevLoad(PVM pVM, PPDMDEVREGCBINT pRegCB, const char *pszFilename, const char *pszName);
85
86
87
88
89/**
90 * This function will initialize the devices for this VM instance.
91 *
92 *
93 * First of all this mean loading the builtin device and letting them
94 * register themselves. Beyond that any additional device modules are
95 * loaded and called for registration.
96 *
97 * Then the device configuration is enumerated, the instantiation order
98 * is determined, and finally they are instantiated.
99 *
100 * After all devices have been successfully instantiated the primary
101 * PCI Bus device is called to emulate the PCI BIOS, i.e. making the
102 * resource assignments. If there is no PCI device, this step is of course
103 * skipped.
104 *
105 * Finally the init completion routines of the instantiated devices
106 * are called.
107 *
108 * @returns VBox status code.
109 * @param pVM The cross context VM structure.
110 */
111int pdmR3DevInit(PVM pVM)
112{
113 LogFlow(("pdmR3DevInit:\n"));
114
115 AssertRelease(!(RT_UOFFSETOF(PDMDEVINS, achInstanceData) & 15));
116 AssertRelease(sizeof(pVM->pdm.s.pDevInstances->Internal.s) <= sizeof(pVM->pdm.s.pDevInstances->Internal.padding));
117
118 /*
119 * Load device modules.
120 */
121 int rc = pdmR3DevLoadModules(pVM);
122 if (RT_FAILURE(rc))
123 return rc;
124
125#ifdef VBOX_WITH_USB
126 /* ditto for USB Devices. */
127 rc = pdmR3UsbLoadModules(pVM);
128 if (RT_FAILURE(rc))
129 return rc;
130#endif
131
132 /*
133 * Get the RC & R0 devhlps and create the devhlp R3 task queue.
134 */
135 PCPDMDEVHLPRC pHlpRC = NIL_RTRCPTR;
136 if (VM_IS_RAW_MODE_ENABLED(pVM))
137 {
138 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "g_pdmRCDevHlp", &pHlpRC);
139 AssertReleaseRCReturn(rc, rc);
140 }
141
142 PCPDMDEVHLPR0 pHlpR0;
143 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "g_pdmR0DevHlp", &pHlpR0);
144 AssertReleaseRCReturn(rc, rc);
145
146 rc = PDMR3QueueCreateInternal(pVM, sizeof(PDMDEVHLPTASK), 8, 0, pdmR3DevHlpQueueConsumer, true, "DevHlp",
147 &pVM->pdm.s.pDevHlpQueueR3);
148 AssertRCReturn(rc, rc);
149 pVM->pdm.s.pDevHlpQueueR0 = PDMQueueR0Ptr(pVM->pdm.s.pDevHlpQueueR3);
150 pVM->pdm.s.pDevHlpQueueRC = PDMQueueRCPtr(pVM->pdm.s.pDevHlpQueueR3);
151
152
153 /*
154 *
155 * Enumerate the device instance configurations
156 * and come up with a instantiation order.
157 *
158 */
159 /* Switch to /Devices, which contains the device instantiations. */
160 PCFGMNODE pDevicesNode = CFGMR3GetChild(CFGMR3GetRoot(pVM), "Devices");
161
162 /*
163 * Count the device instances.
164 */
165 PCFGMNODE pCur;
166 PCFGMNODE pInstanceNode;
167 unsigned cDevs = 0;
168 for (pCur = CFGMR3GetFirstChild(pDevicesNode); pCur; pCur = CFGMR3GetNextChild(pCur))
169 for (pInstanceNode = CFGMR3GetFirstChild(pCur); pInstanceNode; pInstanceNode = CFGMR3GetNextChild(pInstanceNode))
170 cDevs++;
171 if (!cDevs)
172 {
173 Log(("PDM: No devices were configured!\n"));
174 return VINF_SUCCESS;
175 }
176 Log2(("PDM: cDevs=%u\n", cDevs));
177
178 /*
179 * Collect info on each device instance.
180 */
181 struct DEVORDER
182 {
183 /** Configuration node. */
184 PCFGMNODE pNode;
185 /** Pointer to device. */
186 PPDMDEV pDev;
187 /** Init order. */
188 uint32_t u32Order;
189 /** VBox instance number. */
190 uint32_t iInstance;
191 } *paDevs = (struct DEVORDER *)alloca(sizeof(paDevs[0]) * (cDevs + 1)); /* (One extra for swapping) */
192 Assert(paDevs);
193 unsigned i = 0;
194 for (pCur = CFGMR3GetFirstChild(pDevicesNode); pCur; pCur = CFGMR3GetNextChild(pCur))
195 {
196 /* Get the device name. */
197 char szName[sizeof(paDevs[0].pDev->pReg->szName)];
198 rc = CFGMR3GetName(pCur, szName, sizeof(szName));
199 AssertMsgRCReturn(rc, ("Configuration error: device name is too long (or something)! rc=%Rrc\n", rc), rc);
200
201 /* Find the device. */
202 PPDMDEV pDev = pdmR3DevLookup(pVM, szName);
203 AssertLogRelMsgReturn(pDev, ("Configuration error: device '%s' not found!\n", szName), VERR_PDM_DEVICE_NOT_FOUND);
204
205 /* Configured priority or use default based on device class? */
206 uint32_t u32Order;
207 rc = CFGMR3QueryU32(pCur, "Priority", &u32Order);
208 if (rc == VERR_CFGM_VALUE_NOT_FOUND)
209 {
210 uint32_t u32 = pDev->pReg->fClass;
211 for (u32Order = 1; !(u32 & u32Order); u32Order <<= 1)
212 /* nop */;
213 }
214 else
215 AssertMsgRCReturn(rc, ("Configuration error: reading \"Priority\" for the '%s' device failed rc=%Rrc!\n", szName, rc), rc);
216
217 /* Enumerate the device instances. */
218 uint32_t const iStart = i;
219 for (pInstanceNode = CFGMR3GetFirstChild(pCur); pInstanceNode; pInstanceNode = CFGMR3GetNextChild(pInstanceNode))
220 {
221 paDevs[i].pNode = pInstanceNode;
222 paDevs[i].pDev = pDev;
223 paDevs[i].u32Order = u32Order;
224
225 /* Get the instance number. */
226 char szInstance[32];
227 rc = CFGMR3GetName(pInstanceNode, szInstance, sizeof(szInstance));
228 AssertMsgRCReturn(rc, ("Configuration error: instance name is too long (or something)! rc=%Rrc\n", rc), rc);
229 char *pszNext = NULL;
230 rc = RTStrToUInt32Ex(szInstance, &pszNext, 0, &paDevs[i].iInstance);
231 AssertMsgRCReturn(rc, ("Configuration error: RTStrToInt32Ex failed on the instance name '%s'! rc=%Rrc\n", szInstance, rc), rc);
232 AssertMsgReturn(!*pszNext, ("Configuration error: the instance name '%s' isn't all digits. (%s)\n", szInstance, pszNext), VERR_INVALID_PARAMETER);
233
234 /* next instance */
235 i++;
236 }
237
238 /* check the number of instances */
239 if (i - iStart > pDev->pReg->cMaxInstances)
240 AssertLogRelMsgFailedReturn(("Configuration error: Too many instances of %s was configured: %u, max %u\n",
241 szName, i - iStart, pDev->pReg->cMaxInstances),
242 VERR_PDM_TOO_MANY_DEVICE_INSTANCES);
243 } /* devices */
244 Assert(i == cDevs);
245
246 /*
247 * Sort (bubble) the device array ascending on u32Order and instance number
248 * for a device.
249 */
250 unsigned c = cDevs - 1;
251 while (c)
252 {
253 unsigned j = 0;
254 for (i = 0; i < c; i++)
255 if ( paDevs[i].u32Order > paDevs[i + 1].u32Order
256 || ( paDevs[i].u32Order == paDevs[i + 1].u32Order
257 && paDevs[i].iInstance > paDevs[i + 1].iInstance
258 && paDevs[i].pDev == paDevs[i + 1].pDev) )
259 {
260 paDevs[cDevs] = paDevs[i + 1];
261 paDevs[i + 1] = paDevs[i];
262 paDevs[i] = paDevs[cDevs];
263 j = i;
264 }
265 c = j;
266 }
267
268
269 /*
270 *
271 * Instantiate the devices.
272 *
273 */
274 for (i = 0; i < cDevs; i++)
275 {
276 /*
277 * Gather a bit of config.
278 */
279 /* trusted */
280 bool fTrusted;
281 rc = CFGMR3QueryBool(paDevs[i].pNode, "Trusted", &fTrusted);
282 if (rc == VERR_CFGM_VALUE_NOT_FOUND)
283 fTrusted = false;
284 else if (RT_FAILURE(rc))
285 {
286 AssertMsgFailed(("configuration error: failed to query boolean \"Trusted\", rc=%Rrc\n", rc));
287 return rc;
288 }
289 /* config node */
290 PCFGMNODE pConfigNode = CFGMR3GetChild(paDevs[i].pNode, "Config");
291 if (!pConfigNode)
292 {
293 rc = CFGMR3InsertNode(paDevs[i].pNode, "Config", &pConfigNode);
294 if (RT_FAILURE(rc))
295 {
296 AssertMsgFailed(("Failed to create Config node! rc=%Rrc\n", rc));
297 return rc;
298 }
299 }
300 CFGMR3SetRestrictedRoot(pConfigNode);
301
302 /*
303 * Allocate the device instance and critical section.
304 */
305 AssertReturn(paDevs[i].pDev->cInstances < paDevs[i].pDev->pReg->cMaxInstances, VERR_PDM_TOO_MANY_DEVICE_INSTANCES);
306 size_t cb = RT_UOFFSETOF_DYN(PDMDEVINS, achInstanceData[paDevs[i].pDev->pReg->cbInstance]);
307 cb = RT_ALIGN_Z(cb, 16);
308 PPDMDEVINS pDevIns;
309 if (paDevs[i].pDev->pReg->fFlags & (PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0))
310 rc = MMR3HyperAllocOnceNoRel(pVM, cb, 0, MM_TAG_PDM_DEVICE, (void **)&pDevIns);
311 else
312 rc = MMR3HeapAllocZEx(pVM, MM_TAG_PDM_DEVICE, cb, (void **)&pDevIns);
313 AssertLogRelMsgRCReturn(rc,
314 ("Failed to allocate %d bytes of instance data for device '%s'. rc=%Rrc\n",
315 cb, paDevs[i].pDev->pReg->szName, rc),
316 rc);
317 PPDMCRITSECT pCritSect;
318 if (paDevs[i].pDev->pReg->fFlags & (PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0))
319 rc = MMHyperAlloc(pVM, sizeof(*pCritSect), 0, MM_TAG_PDM_DEVICE, (void **)&pCritSect);
320 else
321 rc = MMR3HeapAllocZEx(pVM, MM_TAG_PDM_DEVICE, sizeof(*pCritSect), (void **)&pCritSect);
322 AssertLogRelMsgRCReturn(rc, ("Failed to allocate a critical section for the device (%Rrc)\n", rc), rc);
323
324 /*
325 * Initialize it.
326 */
327 pDevIns->u32Version = PDM_DEVINS_VERSION;
328 pDevIns->iInstance = paDevs[i].iInstance;
329 //pDevIns->Internal.s.pNextR3 = NULL;
330 //pDevIns->Internal.s.pPerDeviceNextR3 = NULL;
331 pDevIns->Internal.s.pDevR3 = paDevs[i].pDev;
332 pDevIns->Internal.s.pVMR3 = pVM;
333 pDevIns->Internal.s.pVMR0 = pVM->pVMR0;
334 pDevIns->Internal.s.pVMRC = pVM->pVMRC;
335 //pDevIns->Internal.s.pLunsR3 = NULL;
336 pDevIns->Internal.s.pCfgHandle = paDevs[i].pNode;
337 //pDevIns->Internal.s.pHeadPciDevR3 = NULL;
338 //pDevIns->Internal.s.pHeadPciDevR0 = 0;
339 //pDevIns->Internal.s.pHeadPciDevRC = 0;
340 pDevIns->Internal.s.fIntFlags = PDMDEVINSINT_FLAGS_SUSPENDED;
341 //pDevIns->Internal.s.uLastIrqTag = 0;
342 pDevIns->pHlpR3 = fTrusted ? &g_pdmR3DevHlpTrusted : &g_pdmR3DevHlpUnTrusted;
343 pDevIns->pHlpRC = pHlpRC;
344 pDevIns->pHlpR0 = pHlpR0;
345 pDevIns->pReg = paDevs[i].pDev->pReg;
346 pDevIns->pCfg = pConfigNode;
347 //pDevIns->IBase.pfnQueryInterface = NULL;
348 //pDevIns->fTracing = 0;
349 pDevIns->idTracing = ++pVM->pdm.s.idTracingDev;
350 pDevIns->pvInstanceDataR3 = &pDevIns->achInstanceData[0];
351 pDevIns->pvInstanceDataRC = pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC
352 ? MMHyperR3ToRC(pVM, pDevIns->pvInstanceDataR3) : NIL_RTRCPTR;
353 pDevIns->pvInstanceDataR0 = pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0
354 ? MMHyperR3ToR0(pVM, pDevIns->pvInstanceDataR3) : NIL_RTR0PTR;
355
356 pDevIns->pCritSectRoR3 = pCritSect;
357 pDevIns->pCritSectRoRC = pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC
358 ? MMHyperR3ToRC(pVM, pCritSect) : NIL_RTRCPTR;
359 pDevIns->pCritSectRoR0 = pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0
360 ? MMHyperR3ToR0(pVM, pCritSect) : NIL_RTR0PTR;
361
362 rc = pdmR3CritSectInitDeviceAuto(pVM, pDevIns, pCritSect, RT_SRC_POS,
363 "%s#%uAuto", pDevIns->pReg->szName, pDevIns->iInstance);
364 AssertLogRelRCReturn(rc, rc);
365
366 /*
367 * Link it into all the lists.
368 */
369 /* The global instance FIFO. */
370 PPDMDEVINS pPrev1 = pVM->pdm.s.pDevInstances;
371 if (!pPrev1)
372 pVM->pdm.s.pDevInstances = pDevIns;
373 else
374 {
375 while (pPrev1->Internal.s.pNextR3)
376 pPrev1 = pPrev1->Internal.s.pNextR3;
377 pPrev1->Internal.s.pNextR3 = pDevIns;
378 }
379
380 /* The per device instance FIFO. */
381 PPDMDEVINS pPrev2 = paDevs[i].pDev->pInstances;
382 if (!pPrev2)
383 paDevs[i].pDev->pInstances = pDevIns;
384 else
385 {
386 while (pPrev2->Internal.s.pPerDeviceNextR3)
387 pPrev2 = pPrev2->Internal.s.pPerDeviceNextR3;
388 pPrev2->Internal.s.pPerDeviceNextR3 = pDevIns;
389 }
390
391 /*
392 * Call the constructor.
393 */
394 paDevs[i].pDev->cInstances++;
395 Log(("PDM: Constructing device '%s' instance %d...\n", pDevIns->pReg->szName, pDevIns->iInstance));
396 rc = pDevIns->pReg->pfnConstruct(pDevIns, pDevIns->iInstance, pDevIns->pCfg);
397 if (RT_FAILURE(rc))
398 {
399 LogRel(("PDM: Failed to construct '%s'/%d! %Rra\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
400 paDevs[i].pDev->cInstances--;
401 /* Because we're damn lazy, the destructor will be called even if
402 the constructor fails. So, no unlinking. */
403 return rc == VERR_VERSION_MISMATCH ? VERR_PDM_DEVICE_VERSION_MISMATCH : rc;
404 }
405 } /* for device instances */
406
407#ifdef VBOX_WITH_USB
408 /* ditto for USB Devices. */
409 rc = pdmR3UsbInstantiateDevices(pVM);
410 if (RT_FAILURE(rc))
411 return rc;
412#endif
413
414 LogFlow(("pdmR3DevInit: returns %Rrc\n", VINF_SUCCESS));
415 return VINF_SUCCESS;
416}
417
418
419/**
420 * Performs the init complete callback after ring-0 and raw-mode has been
421 * initialized.
422 *
423 * @returns VBox status code.
424 * @param pVM The cross context VM structure.
425 */
426int pdmR3DevInitComplete(PVM pVM)
427{
428 int rc;
429
430 /*
431 * Iterate thru the device instances and work the callback.
432 */
433 for (PPDMDEVINS pDevIns = pVM->pdm.s.pDevInstances; pDevIns; pDevIns = pDevIns->Internal.s.pNextR3)
434 {
435 if (pDevIns->pReg->pfnInitComplete)
436 {
437 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED);
438 rc = pDevIns->pReg->pfnInitComplete(pDevIns);
439 PDMCritSectLeave(pDevIns->pCritSectRoR3);
440 if (RT_FAILURE(rc))
441 {
442 AssertMsgFailed(("InitComplete on device '%s'/%d failed with rc=%Rrc\n",
443 pDevIns->pReg->szName, pDevIns->iInstance, rc));
444 return rc;
445 }
446 }
447 }
448
449#ifdef VBOX_WITH_USB
450 rc = pdmR3UsbVMInitComplete(pVM);
451 if (RT_FAILURE(rc))
452 {
453 Log(("pdmR3DevInit: returns %Rrc\n", rc));
454 return rc;
455 }
456#endif
457
458 LogFlow(("pdmR3DevInit: returns %Rrc\n", VINF_SUCCESS));
459 return VINF_SUCCESS;
460}
461
462
463/**
464 * Lookups a device structure by name.
465 * @internal
466 */
467PPDMDEV pdmR3DevLookup(PVM pVM, const char *pszName)
468{
469 size_t cchName = strlen(pszName);
470 for (PPDMDEV pDev = pVM->pdm.s.pDevs; pDev; pDev = pDev->pNext)
471 if ( pDev->cchName == cchName
472 && !strcmp(pDev->pReg->szName, pszName))
473 return pDev;
474 return NULL;
475}
476
477
478/**
479 * Loads the device modules.
480 *
481 * @returns VBox status code.
482 * @param pVM The cross context VM structure.
483 */
484static int pdmR3DevLoadModules(PVM pVM)
485{
486 /*
487 * Initialize the callback structure.
488 */
489 PDMDEVREGCBINT RegCB;
490 RegCB.Core.u32Version = PDM_DEVREG_CB_VERSION;
491 RegCB.Core.pfnRegister = pdmR3DevReg_Register;
492 RegCB.pVM = pVM;
493 RegCB.pCfgNode = NULL;
494
495 /*
496 * Load the internal VMM APIC device.
497 */
498 int rc = APICR3RegisterDevice(&RegCB.Core);
499 AssertRCReturn(rc, rc);
500
501 /*
502 * Load the builtin module.
503 */
504 PCFGMNODE pDevicesNode = CFGMR3GetChild(CFGMR3GetRoot(pVM), "PDM/Devices");
505 bool fLoadBuiltin;
506 rc = CFGMR3QueryBool(pDevicesNode, "LoadBuiltin", &fLoadBuiltin);
507 if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
508 fLoadBuiltin = true;
509 else if (RT_FAILURE(rc))
510 {
511 AssertMsgFailed(("Configuration error: Querying boolean \"LoadBuiltin\" failed with %Rrc\n", rc));
512 return rc;
513 }
514 if (fLoadBuiltin)
515 {
516 /* make filename */
517 char *pszFilename = pdmR3FileR3("VBoxDD", true /*fShared*/);
518 if (!pszFilename)
519 return VERR_NO_TMP_MEMORY;
520 rc = pdmR3DevLoad(pVM, &RegCB, pszFilename, "VBoxDD");
521 RTMemTmpFree(pszFilename);
522 if (RT_FAILURE(rc))
523 return rc;
524
525 /* make filename */
526 pszFilename = pdmR3FileR3("VBoxDD2", true /*fShared*/);
527 if (!pszFilename)
528 return VERR_NO_TMP_MEMORY;
529 rc = pdmR3DevLoad(pVM, &RegCB, pszFilename, "VBoxDD2");
530 RTMemTmpFree(pszFilename);
531 if (RT_FAILURE(rc))
532 return rc;
533 }
534
535 /*
536 * Load additional device modules.
537 */
538 PCFGMNODE pCur;
539 for (pCur = CFGMR3GetFirstChild(pDevicesNode); pCur; pCur = CFGMR3GetNextChild(pCur))
540 {
541 /*
542 * Get the name and path.
543 */
544 char szName[PDMMOD_NAME_LEN];
545 rc = CFGMR3GetName(pCur, &szName[0], sizeof(szName));
546 if (rc == VERR_CFGM_NOT_ENOUGH_SPACE)
547 {
548 AssertMsgFailed(("configuration error: The module name is too long, cchName=%zu.\n", CFGMR3GetNameLen(pCur)));
549 return VERR_PDM_MODULE_NAME_TOO_LONG;
550 }
551 else if (RT_FAILURE(rc))
552 {
553 AssertMsgFailed(("CFGMR3GetName -> %Rrc.\n", rc));
554 return rc;
555 }
556
557 /* the path is optional, if no path the module name + path is used. */
558 char szFilename[RTPATH_MAX];
559 rc = CFGMR3QueryString(pCur, "Path", &szFilename[0], sizeof(szFilename));
560 if (rc == VERR_CFGM_VALUE_NOT_FOUND)
561 strcpy(szFilename, szName);
562 else if (RT_FAILURE(rc))
563 {
564 AssertMsgFailed(("configuration error: Failure to query the module path, rc=%Rrc.\n", rc));
565 return rc;
566 }
567
568 /* prepend path? */
569 if (!RTPathHavePath(szFilename))
570 {
571 char *psz = pdmR3FileR3(szFilename, false /*fShared*/);
572 if (!psz)
573 return VERR_NO_TMP_MEMORY;
574 size_t cch = strlen(psz) + 1;
575 if (cch > sizeof(szFilename))
576 {
577 RTMemTmpFree(psz);
578 AssertMsgFailed(("Filename too long! cch=%d '%s'\n", cch, psz));
579 return VERR_FILENAME_TOO_LONG;
580 }
581 memcpy(szFilename, psz, cch);
582 RTMemTmpFree(psz);
583 }
584
585 /*
586 * Load the module and register it's devices.
587 */
588 RegCB.pCfgNode = pCur;
589 rc = pdmR3DevLoad(pVM, &RegCB, szFilename, szName);
590 if (RT_FAILURE(rc))
591 return rc;
592 }
593
594 return VINF_SUCCESS;
595}
596
597
598/**
599 * Loads one device module and call the registration entry point.
600 *
601 * @returns VBox status code.
602 * @param pVM The cross context VM structure.
603 * @param pRegCB The registration callback stuff.
604 * @param pszFilename Module filename.
605 * @param pszName Module name.
606 */
607static int pdmR3DevLoad(PVM pVM, PPDMDEVREGCBINT pRegCB, const char *pszFilename, const char *pszName)
608{
609 /*
610 * Load it.
611 */
612 int rc = pdmR3LoadR3U(pVM->pUVM, pszFilename, pszName);
613 if (RT_SUCCESS(rc))
614 {
615 /*
616 * Get the registration export and call it.
617 */
618 FNPDMVBOXDEVICESREGISTER *pfnVBoxDevicesRegister;
619 rc = PDMR3LdrGetSymbolR3(pVM, pszName, "VBoxDevicesRegister", (void **)&pfnVBoxDevicesRegister);
620 if (RT_SUCCESS(rc))
621 {
622 Log(("PDM: Calling VBoxDevicesRegister (%p) of %s (%s)\n", pfnVBoxDevicesRegister, pszName, pszFilename));
623 rc = pfnVBoxDevicesRegister(&pRegCB->Core, VBOX_VERSION);
624 if (RT_SUCCESS(rc))
625 Log(("PDM: Successfully loaded device module %s (%s).\n", pszName, pszFilename));
626 else
627 AssertMsgFailed(("VBoxDevicesRegister failed with rc=%Rrc for module %s (%s)\n", rc, pszName, pszFilename));
628 }
629 else
630 {
631 AssertMsgFailed(("Failed to locate 'VBoxDevicesRegister' in %s (%s) rc=%Rrc\n", pszName, pszFilename, rc));
632 if (rc == VERR_SYMBOL_NOT_FOUND)
633 rc = VERR_PDM_NO_REGISTRATION_EXPORT;
634 }
635 }
636 else
637 AssertMsgFailed(("Failed to load %s %s!\n", pszFilename, pszName));
638 return rc;
639}
640
641
642/**
643 * @interface_method_impl{PDMDEVREGCB,pfnRegister}
644 */
645static DECLCALLBACK(int) pdmR3DevReg_Register(PPDMDEVREGCB pCallbacks, PCPDMDEVREG pReg)
646{
647 /*
648 * Validate the registration structure.
649 */
650 Assert(pReg);
651 AssertMsgReturn(pReg->u32Version == PDM_DEVREG_VERSION,
652 ("Unknown struct version %#x!\n", pReg->u32Version),
653 VERR_PDM_UNKNOWN_DEVREG_VERSION);
654
655 AssertMsgReturn( pReg->szName[0]
656 && strlen(pReg->szName) < sizeof(pReg->szName)
657 && pdmR3IsValidName(pReg->szName),
658 ("Invalid name '%.*s'\n", sizeof(pReg->szName), pReg->szName),
659 VERR_PDM_INVALID_DEVICE_REGISTRATION);
660 AssertMsgReturn( !(pReg->fFlags & PDM_DEVREG_FLAGS_RC)
661 || ( pReg->szRCMod[0]
662 && strlen(pReg->szRCMod) < sizeof(pReg->szRCMod)),
663 ("Invalid GC module name '%s' - (Device %s)\n", pReg->szRCMod, pReg->szName),
664 VERR_PDM_INVALID_DEVICE_REGISTRATION);
665 AssertMsgReturn( !(pReg->fFlags & PDM_DEVREG_FLAGS_R0)
666 || ( pReg->szR0Mod[0]
667 && strlen(pReg->szR0Mod) < sizeof(pReg->szR0Mod)),
668 ("Invalid R0 module name '%s' - (Device %s)\n", pReg->szR0Mod, pReg->szName),
669 VERR_PDM_INVALID_DEVICE_REGISTRATION);
670 AssertMsgReturn((pReg->fFlags & PDM_DEVREG_FLAGS_HOST_BITS_MASK) == PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT,
671 ("Invalid host bits flags! fFlags=%#x (Device %s)\n", pReg->fFlags, pReg->szName),
672 VERR_PDM_INVALID_DEVICE_HOST_BITS);
673 AssertMsgReturn((pReg->fFlags & PDM_DEVREG_FLAGS_GUEST_BITS_MASK),
674 ("Invalid guest bits flags! fFlags=%#x (Device %s)\n", pReg->fFlags, pReg->szName),
675 VERR_PDM_INVALID_DEVICE_REGISTRATION);
676 AssertMsgReturn(pReg->fClass,
677 ("No class! (Device %s)\n", pReg->szName),
678 VERR_PDM_INVALID_DEVICE_REGISTRATION);
679 AssertMsgReturn(pReg->cMaxInstances > 0,
680 ("Max instances %u! (Device %s)\n", pReg->cMaxInstances, pReg->szName),
681 VERR_PDM_INVALID_DEVICE_REGISTRATION);
682 AssertMsgReturn(pReg->cbInstance <= (uint32_t)(pReg->fFlags & (PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0) ? 96 * _1K : _1M),
683 ("Instance size %d bytes! (Device %s)\n", pReg->cbInstance, pReg->szName),
684 VERR_PDM_INVALID_DEVICE_REGISTRATION);
685 AssertMsgReturn(pReg->pfnConstruct,
686 ("No constructor! (Device %s)\n", pReg->szName),
687 VERR_PDM_INVALID_DEVICE_REGISTRATION);
688 AssertLogRelMsgReturn((pReg->fFlags & PDM_DEVREG_FLAGS_GUEST_BITS_MASK) == PDM_DEVREG_FLAGS_GUEST_BITS_DEFAULT,
689 ("PDM: Rejected device '%s' because it didn't match the guest bits.\n", pReg->szName),
690 VERR_PDM_INVALID_DEVICE_GUEST_BITS);
691 AssertLogRelMsg(pReg->u32VersionEnd == PDM_DEVREG_VERSION,
692 ("u32VersionEnd=%#x, expected %#x. (szName=%s)\n",
693 pReg->u32VersionEnd, PDM_DEVREG_VERSION, pReg->szName));
694
695 /*
696 * Check for duplicate and find FIFO entry at the same time.
697 */
698 PCPDMDEVREGCBINT pRegCB = (PCPDMDEVREGCBINT)pCallbacks;
699 PPDMDEV pDevPrev = NULL;
700 PPDMDEV pDev = pRegCB->pVM->pdm.s.pDevs;
701 for (; pDev; pDevPrev = pDev, pDev = pDev->pNext)
702 AssertMsgReturn(strcmp(pDev->pReg->szName, pReg->szName),
703 ("Device '%s' already exists\n", pReg->szName),
704 VERR_PDM_DEVICE_NAME_CLASH);
705
706 /*
707 * Allocate new device structure, initialize and insert it into the list.
708 */
709 int rc;
710 pDev = (PPDMDEV)MMR3HeapAlloc(pRegCB->pVM, MM_TAG_PDM_DEVICE, sizeof(*pDev));
711 if (pDev)
712 {
713 pDev->pNext = NULL;
714 pDev->cInstances = 0;
715 pDev->pInstances = NULL;
716 pDev->pReg = pReg;
717 pDev->cchName = (uint32_t)strlen(pReg->szName);
718 rc = CFGMR3QueryStringAllocDef( pRegCB->pCfgNode, "RCSearchPath", &pDev->pszRCSearchPath, NULL);
719 if (RT_SUCCESS(rc))
720 rc = CFGMR3QueryStringAllocDef(pRegCB->pCfgNode, "R0SearchPath", &pDev->pszR0SearchPath, NULL);
721 if (RT_SUCCESS(rc))
722 {
723 if (pDevPrev)
724 pDevPrev->pNext = pDev;
725 else
726 pRegCB->pVM->pdm.s.pDevs = pDev;
727 Log(("PDM: Registered device '%s'\n", pReg->szName));
728 return VINF_SUCCESS;
729 }
730
731 MMR3HeapFree(pDev);
732 }
733 else
734 rc = VERR_NO_MEMORY;
735 return rc;
736}
737
738
739/**
740 * Locates a LUN.
741 *
742 * @returns VBox status code.
743 * @param pVM The cross context VM structure.
744 * @param pszDevice Device name.
745 * @param iInstance Device instance.
746 * @param iLun The Logical Unit to obtain the interface of.
747 * @param ppLun Where to store the pointer to the LUN if found.
748 * @thread Try only do this in EMT...
749 */
750int pdmR3DevFindLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMLUN ppLun)
751{
752 /*
753 * Iterate registered devices looking for the device.
754 */
755 size_t cchDevice = strlen(pszDevice);
756 for (PPDMDEV pDev = pVM->pdm.s.pDevs; pDev; pDev = pDev->pNext)
757 {
758 if ( pDev->cchName == cchDevice
759 && !memcmp(pDev->pReg->szName, pszDevice, cchDevice))
760 {
761 /*
762 * Iterate device instances.
763 */
764 for (PPDMDEVINS pDevIns = pDev->pInstances; pDevIns; pDevIns = pDevIns->Internal.s.pPerDeviceNextR3)
765 {
766 if (pDevIns->iInstance == iInstance)
767 {
768 /*
769 * Iterate luns.
770 */
771 for (PPDMLUN pLun = pDevIns->Internal.s.pLunsR3; pLun; pLun = pLun->pNext)
772 {
773 if (pLun->iLun == iLun)
774 {
775 *ppLun = pLun;
776 return VINF_SUCCESS;
777 }
778 }
779 return VERR_PDM_LUN_NOT_FOUND;
780 }
781 }
782 return VERR_PDM_DEVICE_INSTANCE_NOT_FOUND;
783 }
784 }
785 return VERR_PDM_DEVICE_NOT_FOUND;
786}
787
788
789/**
790 * Attaches a preconfigured driver to an existing device instance.
791 *
792 * This is used to change drivers and suchlike at runtime.
793 *
794 * @returns VBox status code.
795 * @param pUVM The user mode VM handle.
796 * @param pszDevice Device name.
797 * @param iInstance Device instance.
798 * @param iLun The Logical Unit to obtain the interface of.
799 * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
800 * @param ppBase Where to store the base interface pointer. Optional.
801 * @thread EMT
802 */
803VMMR3DECL(int) PDMR3DeviceAttach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags, PPPDMIBASE ppBase)
804{
805 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
806 PVM pVM = pUVM->pVM;
807 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
808 VM_ASSERT_EMT(pVM);
809 LogFlow(("PDMR3DeviceAttach: pszDevice=%p:{%s} iInstance=%d iLun=%d fFlags=%#x ppBase=%p\n",
810 pszDevice, pszDevice, iInstance, iLun, fFlags, ppBase));
811
812 /*
813 * Find the LUN in question.
814 */
815 PPDMLUN pLun;
816 int rc = pdmR3DevFindLun(pVM, pszDevice, iInstance, iLun, &pLun);
817 if (RT_SUCCESS(rc))
818 {
819 /*
820 * Can we attach anything at runtime?
821 */
822 PPDMDEVINS pDevIns = pLun->pDevIns;
823 if (pDevIns->pReg->pfnAttach)
824 {
825 if (!pLun->pTop)
826 {
827 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED);
828 rc = pDevIns->pReg->pfnAttach(pDevIns, iLun, fFlags);
829 PDMCritSectLeave(pDevIns->pCritSectRoR3);
830 }
831 else
832 rc = VERR_PDM_DRIVER_ALREADY_ATTACHED;
833 }
834 else
835 rc = VERR_PDM_DEVICE_NO_RT_ATTACH;
836
837 if (ppBase)
838 *ppBase = pLun->pTop ? &pLun->pTop->IBase : NULL;
839 }
840 else if (ppBase)
841 *ppBase = NULL;
842
843 if (ppBase)
844 LogFlow(("PDMR3DeviceAttach: returns %Rrc *ppBase=%p\n", rc, *ppBase));
845 else
846 LogFlow(("PDMR3DeviceAttach: returns %Rrc\n", rc));
847 return rc;
848}
849
850
851/**
852 * Detaches a driver chain from an existing device instance.
853 *
854 * This is used to change drivers and suchlike at runtime.
855 *
856 * @returns VBox status code.
857 * @param pUVM The user mode VM handle.
858 * @param pszDevice Device name.
859 * @param iInstance Device instance.
860 * @param iLun The Logical Unit to obtain the interface of.
861 * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
862 * @thread EMT
863 */
864VMMR3DECL(int) PDMR3DeviceDetach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags)
865{
866 return PDMR3DriverDetach(pUVM, pszDevice, iInstance, iLun, NULL, 0, fFlags);
867}
868
869
870/**
871 * References the critical section associated with a device for the use by a
872 * timer or similar created by the device.
873 *
874 * @returns Pointer to the critical section.
875 * @param pVM The cross context VM structure.
876 * @param pDevIns The device instance in question.
877 *
878 * @internal
879 */
880VMMR3_INT_DECL(PPDMCRITSECT) PDMR3DevGetCritSect(PVM pVM, PPDMDEVINS pDevIns)
881{
882 VM_ASSERT_EMT(pVM); RT_NOREF_PV(pVM);
883 VM_ASSERT_STATE(pVM, VMSTATE_CREATING);
884 AssertPtr(pDevIns);
885
886 PPDMCRITSECT pCritSect = pDevIns->pCritSectRoR3;
887 AssertPtr(pCritSect);
888 pCritSect->s.fUsedByTimerOrSimilar = true;
889
890 return pCritSect;
891}
892
893
894/**
895 * Attaches a preconfigured driver to an existing device or driver instance.
896 *
897 * This is used to change drivers and suchlike at runtime. The driver or device
898 * at the end of the chain will be told to attach to whatever is configured
899 * below it.
900 *
901 * @returns VBox status code.
902 * @param pUVM The user mode VM handle.
903 * @param pszDevice Device name.
904 * @param iInstance Device instance.
905 * @param iLun The Logical Unit to obtain the interface of.
906 * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
907 * @param ppBase Where to store the base interface pointer. Optional.
908 *
909 * @thread EMT
910 */
911VMMR3DECL(int) PDMR3DriverAttach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags, PPPDMIBASE ppBase)
912{
913 LogFlow(("PDMR3DriverAttach: pszDevice=%p:{%s} iInstance=%d iLun=%d fFlags=%#x ppBase=%p\n",
914 pszDevice, pszDevice, iInstance, iLun, fFlags, ppBase));
915 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
916 PVM pVM = pUVM->pVM;
917 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
918 VM_ASSERT_EMT(pVM);
919
920 if (ppBase)
921 *ppBase = NULL;
922
923 /*
924 * Find the LUN in question.
925 */
926 PPDMLUN pLun;
927 int rc = pdmR3DevFindLun(pVM, pszDevice, iInstance, iLun, &pLun);
928 if (RT_SUCCESS(rc))
929 {
930 /*
931 * Anything attached to the LUN?
932 */
933 PPDMDRVINS pDrvIns = pLun->pTop;
934 if (!pDrvIns)
935 {
936 /* No, ask the device to attach to the new stuff. */
937 PPDMDEVINS pDevIns = pLun->pDevIns;
938 if (pDevIns->pReg->pfnAttach)
939 {
940 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED);
941 rc = pDevIns->pReg->pfnAttach(pDevIns, iLun, fFlags);
942 if (RT_SUCCESS(rc) && ppBase)
943 *ppBase = pLun->pTop ? &pLun->pTop->IBase : NULL;
944 PDMCritSectLeave(pDevIns->pCritSectRoR3);
945 }
946 else
947 rc = VERR_PDM_DEVICE_NO_RT_ATTACH;
948 }
949 else
950 {
951 /* Yes, find the bottom most driver and ask it to attach to the new stuff. */
952 while (pDrvIns->Internal.s.pDown)
953 pDrvIns = pDrvIns->Internal.s.pDown;
954 if (pDrvIns->pReg->pfnAttach)
955 {
956 rc = pDrvIns->pReg->pfnAttach(pDrvIns, fFlags);
957 if (RT_SUCCESS(rc) && ppBase)
958 *ppBase = pDrvIns->Internal.s.pDown
959 ? &pDrvIns->Internal.s.pDown->IBase
960 : NULL;
961 }
962 else
963 rc = VERR_PDM_DRIVER_NO_RT_ATTACH;
964 }
965 }
966
967 if (ppBase)
968 LogFlow(("PDMR3DriverAttach: returns %Rrc *ppBase=%p\n", rc, *ppBase));
969 else
970 LogFlow(("PDMR3DriverAttach: returns %Rrc\n", rc));
971 return rc;
972}
973
974
975/**
976 * Detaches the specified driver instance.
977 *
978 * This is used to replumb drivers at runtime for simulating hot plugging and
979 * media changes.
980 *
981 * This is a superset of PDMR3DeviceDetach. It allows detaching drivers from
982 * any driver or device by specifying the driver to start detaching at. The
983 * only prerequisite is that the driver or device above implements the
984 * pfnDetach callback (PDMDRVREG / PDMDEVREG).
985 *
986 * @returns VBox status code.
987 * @param pUVM The user mode VM handle.
988 * @param pszDevice Device name.
989 * @param iDevIns Device instance.
990 * @param iLun The Logical Unit in which to look for the driver.
991 * @param pszDriver The name of the driver which to detach. If NULL
992 * then the entire driver chain is detatched.
993 * @param iOccurrence The occurrence of that driver in the chain. This is
994 * usually 0.
995 * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
996 * @thread EMT
997 */
998VMMR3DECL(int) PDMR3DriverDetach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
999 const char *pszDriver, unsigned iOccurrence, uint32_t fFlags)
1000{
1001 LogFlow(("PDMR3DriverDetach: pszDevice=%p:{%s} iDevIns=%u iLun=%u pszDriver=%p:{%s} iOccurrence=%u fFlags=%#x\n",
1002 pszDevice, pszDevice, iDevIns, iLun, pszDriver, pszDriver, iOccurrence, fFlags));
1003 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
1004 PVM pVM = pUVM->pVM;
1005 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
1006 VM_ASSERT_EMT(pVM);
1007 AssertPtr(pszDevice);
1008 AssertPtrNull(pszDriver);
1009 Assert(iOccurrence == 0 || pszDriver);
1010 Assert(!(fFlags & ~(PDM_TACH_FLAGS_NOT_HOT_PLUG)));
1011
1012 /*
1013 * Find the LUN in question.
1014 */
1015 PPDMLUN pLun;
1016 int rc = pdmR3DevFindLun(pVM, pszDevice, iDevIns, iLun, &pLun);
1017 if (RT_SUCCESS(rc))
1018 {
1019 /*
1020 * Locate the driver.
1021 */
1022 PPDMDRVINS pDrvIns = pLun->pTop;
1023 if (pDrvIns)
1024 {
1025 if (pszDriver)
1026 {
1027 while (pDrvIns)
1028 {
1029 if (!strcmp(pDrvIns->pReg->szName, pszDriver))
1030 {
1031 if (iOccurrence == 0)
1032 break;
1033 iOccurrence--;
1034 }
1035 pDrvIns = pDrvIns->Internal.s.pDown;
1036 }
1037 }
1038 if (pDrvIns)
1039 rc = pdmR3DrvDetach(pDrvIns, fFlags);
1040 else
1041 rc = VERR_PDM_DRIVER_INSTANCE_NOT_FOUND;
1042 }
1043 else
1044 rc = VINF_PDM_NO_DRIVER_ATTACHED_TO_LUN;
1045 }
1046
1047 LogFlow(("PDMR3DriverDetach: returns %Rrc\n", rc));
1048 return rc;
1049}
1050
1051
1052/**
1053 * Runtime detach and reattach of a new driver chain or sub chain.
1054 *
1055 * This is intended to be called on a non-EMT thread, this will instantiate the
1056 * new driver (sub-)chain, and then the EMTs will do the actual replumbing. The
1057 * destruction of the old driver chain will be taken care of on the calling
1058 * thread.
1059 *
1060 * @returns VBox status code.
1061 * @param pUVM The user mode VM handle.
1062 * @param pszDevice Device name.
1063 * @param iDevIns Device instance.
1064 * @param iLun The Logical Unit in which to look for the driver.
1065 * @param pszDriver The name of the driver which to detach and replace.
1066 * If NULL then the entire driver chain is to be
1067 * reattached.
1068 * @param iOccurrence The occurrence of that driver in the chain. This is
1069 * usually 0.
1070 * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
1071 * @param pCfg The configuration of the new driver chain that is
1072 * going to be attached. The subtree starts with the
1073 * node containing a Driver key, a Config subtree and
1074 * optionally an AttachedDriver subtree.
1075 * If this parameter is NULL, then this call will work
1076 * like at a non-pause version of PDMR3DriverDetach.
1077 * @param ppBase Where to store the base interface pointer to the new
1078 * driver. Optional.
1079 *
1080 * @thread Any thread. The EMTs will be involved at some point though.
1081 */
1082VMMR3DECL(int) PDMR3DriverReattach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
1083 const char *pszDriver, unsigned iOccurrence, uint32_t fFlags,
1084 PCFGMNODE pCfg, PPPDMIBASE ppBase)
1085{
1086 NOREF(pUVM); NOREF(pszDevice); NOREF(iDevIns); NOREF(iLun); NOREF(pszDriver); NOREF(iOccurrence);
1087 NOREF(fFlags); NOREF(pCfg); NOREF(ppBase);
1088 return VERR_NOT_IMPLEMENTED;
1089}
1090
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