Changeset 91869 in vbox
- Timestamp:
- Oct 20, 2021 9:05:50 AM (3 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp
r83042 r91869 1807 1807 static DECLCALLBACK(int) drvdiskintConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags) 1808 1808 { 1809 int rc = VINF_SUCCESS; 1810 PDRVDISKINTEGRITY pThis = PDMINS_2_DATA(pDrvIns, PDRVDISKINTEGRITY); 1809 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 1810 PDRVDISKINTEGRITY pThis = PDMINS_2_DATA(pDrvIns, PDRVDISKINTEGRITY); 1811 PCPDMDRVHLPR3 pHlp = pDrvIns->pHlpR3; 1812 1811 1813 LogFlow(("drvdiskintConstruct: iInstance=%d\n", pDrvIns->iInstance)); 1812 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);1813 1814 1814 1815 /* 1815 1816 * Validate configuration. 1816 1817 */ 1817 if (!CFGMR3AreValuesValid(pCfg, "CheckConsistency\0"1818 "TraceRequests\0"1819 "CheckIntervalMs\0"1820 "ExpireIntervalMs\0"1821 "CheckDoubleCompletions\0"1822 "HistorySize\0"1823 "IoLogType\0"1824 "IoLogFile\0"1825 "IoLogAddress\0"1826 "IoLogPort\0"1827 "IoLogData\0"1828 "PrepopulateRamDisk\0"1829 "ReadAfterWrite\0"1830 "RecordWriteBeforeCompletion\0"1831 "ValidateMemoryBuffers\0"))1832 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;1833 1834 rc = CFGMR3QueryBoolDef(pCfg, "CheckConsistency", &pThis->fCheckConsistency, false);1818 PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "CheckConsistency" 1819 "|TraceRequests" 1820 "|CheckIntervalMs" 1821 "|ExpireIntervalMs" 1822 "|CheckDoubleCompletions" 1823 "|HistorySize" 1824 "|IoLogType" 1825 "|IoLogFile" 1826 "|IoLogAddress" 1827 "|IoLogPort" 1828 "|IoLogData" 1829 "|PrepopulateRamDisk" 1830 "|ReadAfterWrite" 1831 "|RecordWriteBeforeCompletion" 1832 "|ValidateMemoryBuffers", 1833 ""); 1834 1835 int rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "CheckConsistency", &pThis->fCheckConsistency, false); 1835 1836 AssertRC(rc); 1836 rc = CFGMR3QueryBoolDef(pCfg, "TraceRequests", &pThis->fTraceRequests, false);1837 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "TraceRequests", &pThis->fTraceRequests, false); 1837 1838 AssertRC(rc); 1838 rc = CFGMR3QueryU32Def(pCfg, "CheckIntervalMs", &pThis->uCheckIntervalMs, 5000); /* 5 seconds */1839 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "CheckIntervalMs", &pThis->uCheckIntervalMs, 5000); /* 5 seconds */ 1839 1840 AssertRC(rc); 1840 rc = CFGMR3QueryU32Def(pCfg, "ExpireIntervalMs", &pThis->uExpireIntervalMs, 20000); /* 20 seconds */1841 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "ExpireIntervalMs", &pThis->uExpireIntervalMs, 20000); /* 20 seconds */ 1841 1842 AssertRC(rc); 1842 rc = CFGMR3QueryBoolDef(pCfg, "CheckDoubleCompletions", &pThis->fCheckDoubleCompletion, false);1843 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "CheckDoubleCompletions", &pThis->fCheckDoubleCompletion, false); 1843 1844 AssertRC(rc); 1844 rc = CFGMR3QueryU32Def(pCfg, "HistorySize", &pThis->cEntries, 512);1845 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "HistorySize", &pThis->cEntries, 512); 1845 1846 AssertRC(rc); 1846 rc = CFGMR3QueryBoolDef(pCfg, "PrepopulateRamDisk", &pThis->fPrepopulateRamDisk, false);1847 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "PrepopulateRamDisk", &pThis->fPrepopulateRamDisk, false); 1847 1848 AssertRC(rc); 1848 rc = CFGMR3QueryBoolDef(pCfg, "ReadAfterWrite", &pThis->fReadAfterWrite, false);1849 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "ReadAfterWrite", &pThis->fReadAfterWrite, false); 1849 1850 AssertRC(rc); 1850 rc = CFGMR3QueryBoolDef(pCfg, "RecordWriteBeforeCompletion", &pThis->fRecordWriteBeforeCompletion, false);1851 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "RecordWriteBeforeCompletion", &pThis->fRecordWriteBeforeCompletion, false); 1851 1852 AssertRC(rc); 1852 rc = CFGMR3QueryBoolDef(pCfg, "ValidateMemoryBuffers", &pThis->fValidateMemBufs, false);1853 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "ValidateMemoryBuffers", &pThis->fValidateMemBufs, false); 1853 1854 AssertRC(rc); 1854 1855 1855 1856 bool fIoLogData = false; 1856 rc = CFGMR3QueryBoolDef(pCfg, "IoLogData", &fIoLogData, false);1857 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "IoLogData", &fIoLogData, false); 1857 1858 AssertRC(rc); 1858 1859 … … 1861 1862 char *pszAddress = NULL; 1862 1863 uint32_t uPort = 0; 1863 rc = CFGMR3QueryStringAlloc(pCfg, "IoLogType", &pszIoLogType);1864 rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "IoLogType", &pszIoLogType); 1864 1865 if (RT_SUCCESS(rc)) 1865 1866 { 1866 1867 if (!RTStrICmp(pszIoLogType, "File")) 1867 1868 { 1868 rc = CFGMR3QueryStringAlloc(pCfg, "IoLogFile", &pszIoLogFilename);1869 rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "IoLogFile", &pszIoLogFilename); 1869 1870 AssertRC(rc); 1870 1871 } 1871 1872 else if (!RTStrICmp(pszIoLogType, "Server")) 1872 1873 { 1873 rc = CFGMR3QueryStringAllocDef(pCfg, "IoLogAddress", &pszAddress, NULL);1874 rc = pHlp->pfnCFGMQueryStringAllocDef(pCfg, "IoLogAddress", &pszAddress, NULL); 1874 1875 AssertRC(rc); 1875 rc = CFGMR3QueryU32Def(pCfg, "IoLogPort", &uPort, 4000);1876 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IoLogPort", &uPort, 4000); 1876 1877 AssertRC(rc); 1877 1878 } 1878 1879 else if (!RTStrICmp(pszIoLogType, "Client")) 1879 1880 { 1880 rc = CFGMR3QueryStringAlloc(pCfg, "IoLogAddress", &pszAddress);1881 rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "IoLogAddress", &pszAddress); 1881 1882 AssertRC(rc); 1882 rc = CFGMR3QueryU32Def(pCfg, "IoLogPort", &uPort, 4000);1883 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IoLogPort", &uPort, 4000); 1883 1884 AssertRC(rc); 1884 1885 } -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r82968 r91869 1267 1267 { 1268 1268 int src = VINF_SUCCESS; 1269 PDRVHOSTBASE pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTBASE); 1269 PDRVHOSTBASE pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTBASE); 1270 PCPDMDRVHLPR3 pHlp = pDrvIns->pHlpR3; 1271 1270 1272 LogFlow(("%s-%d: DRVHostBaseInit: iInstance=%d\n", pDrvIns->pReg->szName, pDrvIns->iInstance, pDrvIns->iInstance)); 1271 1273 … … 1330 1332 drvHostBaseInitOs(pThis); 1331 1333 1332 if (! CFGMR3AreValuesValid(pCfg, pszCfgValid))1334 if (!pHlp->pfnCFGMAreValuesValid(pCfg, pszCfgValid)) 1333 1335 { 1334 1336 pThis->fAttachFailError = true; … … 1352 1354 */ 1353 1355 /* Device */ 1354 int rc = CFGMR3QueryStringAlloc(pCfg, "Path", &pThis->pszDevice);1356 int rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "Path", &pThis->pszDevice); 1355 1357 if (RT_FAILURE(rc)) 1356 1358 { … … 1361 1363 /* Mountable */ 1362 1364 uint32_t u32; 1363 rc = CFGMR3QueryU32Def(pCfg, "Interval", &u32, 1000);1365 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "Interval", &u32, 1000); 1364 1366 if (RT_SUCCESS(rc)) 1365 1367 pThis->cMilliesPoller = u32; … … 1376 1378 else 1377 1379 { 1378 rc = CFGMR3QueryBoolDef(pCfg, "ReadOnly", &pThis->fReadOnlyConfig,1379 enmType == PDMMEDIATYPE_DVD || enmType == PDMMEDIATYPE_CDROM1380 ? true1381 : false);1380 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "ReadOnly", &pThis->fReadOnlyConfig, 1381 enmType == PDMMEDIATYPE_DVD || enmType == PDMMEDIATYPE_CDROM 1382 ? true 1383 : false); 1382 1384 if (RT_FAILURE(rc)) 1383 1385 { … … 1388 1390 1389 1391 /* Locked */ 1390 rc = CFGMR3QueryBoolDef(pCfg, "Locked", &pThis->fLocked, false);1392 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "Locked", &pThis->fLocked, false); 1391 1393 if (RT_FAILURE(rc)) 1392 1394 { … … 1396 1398 1397 1399 /* BIOS visible */ 1398 rc = CFGMR3QueryBoolDef(pCfg, "BIOSVisible", &pThis->fBiosVisible, true);1400 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "BIOSVisible", &pThis->fBiosVisible, true); 1399 1401 if (RT_FAILURE(rc)) 1400 1402 { … … 1405 1407 /* Uuid */ 1406 1408 char *psz; 1407 rc = CFGMR3QueryStringAlloc(pCfg, "Uuid", &psz);1409 rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "Uuid", &psz); 1408 1410 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 1409 1411 RTUuidClear(&pThis->Uuid); … … 1427 1429 /* Define whether attach failure is an error (default) or not. */ 1428 1430 bool fAttachFailError = true; 1429 rc = CFGMR3QueryBoolDef(pCfg, "AttachFailError", &fAttachFailError, true);1431 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "AttachFailError", &fAttachFailError, true); 1430 1432 pThis->fAttachFailError = fAttachFailError; 1431 1433 -
trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp
r90791 r91869 468 468 { 469 469 RT_NOREF(fFlags); 470 PDRVHOSTDVD pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTDVD); 470 PDRVHOSTDVD pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTDVD); 471 PCPDMDRVHLPR3 pHlp = pDrvIns->pHlpR3; 472 471 473 LogFlow(("drvHostDvdConstruct: iInstance=%d\n", pDrvIns->iInstance)); 472 474 473 int rc = CFGMR3QueryBoolDef(pCfg, "InquiryOverwrite", &pThis->fInquiryOverwrite, true);475 int rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "InquiryOverwrite", &pThis->fInquiryOverwrite, true); 474 476 if (RT_FAILURE(rc)) 475 477 return PDMDRV_SET_ERROR(pDrvIns, rc, … … 477 479 478 480 bool fPassthrough; 479 rc = CFGMR3QueryBool(pCfg, "Passthrough", &fPassthrough);481 rc = pHlp->pfnCFGMQueryBool(pCfg, "Passthrough", &fPassthrough); 480 482 if (RT_SUCCESS(rc) && fPassthrough) 481 483 { -
trunk/src/VBox/Devices/Storage/DrvRamDisk.cpp
r87560 r91869 1656 1656 { 1657 1657 RT_NOREF1(fFlags); 1658 int rc = VINF_SUCCESS; 1659 uint32_t cbIoBufMax; 1660 PDRVRAMDISK pThis = PDMINS_2_DATA(pDrvIns, PDRVRAMDISK); 1658 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 1659 PDRVRAMDISK pThis = PDMINS_2_DATA(pDrvIns, PDRVRAMDISK); 1660 PCPDMDRVHLPR3 pHlp = pDrvIns->pHlpR3; 1661 1661 1662 LogFlow(("drvdiskintConstruct: iInstance=%d\n", pDrvIns->iInstance)); 1662 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);1663 1664 /*1665 * Validate configuration.1666 */1667 if (!CFGMR3AreValuesValid(pCfg, "Size\0"1668 "PreAlloc\0"1669 "IoBufMax\0"1670 "SectorSize\0"1671 "NonRotational\0"))1672 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;1673 1674 rc = CFGMR3QueryU64(pCfg, "Size", &pThis->cbDisk);1675 if (RT_FAILURE(rc))1676 return PDMDRV_SET_ERROR(pDrvIns, rc,1677 N_("RamDisk: Error querying the media size"));1678 rc = CFGMR3QueryBoolDef(pCfg, "PreAlloc", &pThis->fPreallocRamDisk, false);1679 if (RT_FAILURE(rc))1680 return PDMDRV_SET_ERROR(pDrvIns, rc,1681 N_("RamDisk: Error querying \"PreAlloc\""));1682 rc = CFGMR3QueryBoolDef(pCfg, "NonRotational", &pThis->fNonRotational, true);1683 if (RT_FAILURE(rc))1684 return PDMDRV_SET_ERROR(pDrvIns, rc,1685 N_("RamDisk: Error querying \"NonRotational\""));1686 rc = CFGMR3QueryU32Def(pCfg, "IoBufMax", &cbIoBufMax, 5 * _1M);1687 if (RT_FAILURE(rc))1688 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"IoBufMax\" from the config"));1689 rc = CFGMR3QueryU32Def(pCfg, "SectorSize", &pThis->cbSector, 512);1690 if (RT_FAILURE(rc))1691 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"SectorSize\" from the config"));1692 1663 1693 1664 /* … … 1737 1708 pThis->IMediaEx.pfnIoReqSuspendedSave = drvramdiskIoReqSuspendedSave; 1738 1709 pThis->IMediaEx.pfnIoReqSuspendedLoad = drvramdiskIoReqSuspendedLoad; 1710 1711 /* 1712 * Validate configuration. 1713 */ 1714 PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "Size" 1715 "|PreAlloc" 1716 "|IoBufMax" 1717 "|SectorSize" 1718 "|NonRotational", 1719 ""); 1720 1721 int rc = pHlp->pfnCFGMQueryU64(pCfg, "Size", &pThis->cbDisk); 1722 if (RT_FAILURE(rc)) 1723 return PDMDRV_SET_ERROR(pDrvIns, rc, 1724 N_("RamDisk: Error querying the media size")); 1725 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "PreAlloc", &pThis->fPreallocRamDisk, false); 1726 if (RT_FAILURE(rc)) 1727 return PDMDRV_SET_ERROR(pDrvIns, rc, 1728 N_("RamDisk: Error querying \"PreAlloc\"")); 1729 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "NonRotational", &pThis->fNonRotational, true); 1730 if (RT_FAILURE(rc)) 1731 return PDMDRV_SET_ERROR(pDrvIns, rc, 1732 N_("RamDisk: Error querying \"NonRotational\"")); 1733 1734 uint32_t cbIoBufMax; 1735 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IoBufMax", &cbIoBufMax, 5 * _1M); 1736 if (RT_FAILURE(rc)) 1737 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"IoBufMax\" from the config")); 1738 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "SectorSize", &pThis->cbSector, 512); 1739 if (RT_FAILURE(rc)) 1740 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"SectorSize\" from the config")); 1739 1741 1740 1742 /* Query the media port interface above us. */ -
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r90791 r91869 1416 1416 * Validate and read configuration. 1417 1417 */ 1418 if (!CFGMR3AreValuesValid(pCfg, "")) 1419 return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 1420 N_("SCSI configuration error: unknown option specified")); 1418 PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "", ""); 1421 1419 1422 1420 /* -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r90791 r91869 4478 4478 { 4479 4479 RT_NOREF(fFlags); 4480 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 4481 PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK); 4482 PCPDMDRVHLPR3 pHlp = pDrvIns->pHlpR3; 4483 4480 4484 LogFlowFunc(("\n")); 4481 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 4482 PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK); 4483 int rc = VINF_SUCCESS; 4485 4484 4486 char *pszName = NULL; /* The path of the disk image file. */ 4485 4487 char *pszFormat = NULL; /* The format backed to use for this image. */ … … 4573 4575 pThis->VDIfError.pfnError = drvvdErrorCallback; 4574 4576 pThis->VDIfError.pfnMessage = NULL; 4575 rc = VDInterfaceAdd(&pThis->VDIfError.Core, "DrvVD_VDIError", VDINTERFACETYPE_ERROR,4576 pDrvIns, sizeof(VDINTERFACEERROR), &pThis->pVDIfsDisk);4577 int rc = VDInterfaceAdd(&pThis->VDIfError.Core, "DrvVD_VDIError", VDINTERFACETYPE_ERROR, 4578 pDrvIns, sizeof(VDINTERFACEERROR), &pThis->pVDIfsDisk); 4577 4579 AssertRC(rc); 4578 4580 … … 4643 4645 /* Toplevel configuration additionally contains the global image 4644 4646 * open flags. Some might be converted to per-image flags later. */ 4645 fValid = CFGMR3AreValuesValid(pCurNode,4646 "Format\0Path\0"4647 "ReadOnly\0MaybeReadOnly\0TempReadOnly\0Shareable\0HonorZeroWrites\0"4648 "HostIPStack\0UseNewIo\0BootAcceleration\0BootAccelerationBuffer\0"4649 "SetupMerge\0MergeSource\0MergeTarget\0BwGroup\0Type\0BlockCache\0"4650 "CachePath\0CacheFormat\0Discard\0InformAboutZeroBlocks\0"4651 "SkipConsistencyChecks\0"4652 "Locked\0BIOSVisible\0Cylinders\0Heads\0Sectors\0Mountable\0"4653 "EmptyDrive\0IoBufMax\0NonRotationalMedium\0"4647 fValid = pHlp->pfnCFGMAreValuesValid(pCurNode, 4648 "Format\0Path\0" 4649 "ReadOnly\0MaybeReadOnly\0TempReadOnly\0Shareable\0HonorZeroWrites\0" 4650 "HostIPStack\0UseNewIo\0BootAcceleration\0BootAccelerationBuffer\0" 4651 "SetupMerge\0MergeSource\0MergeTarget\0BwGroup\0Type\0BlockCache\0" 4652 "CachePath\0CacheFormat\0Discard\0InformAboutZeroBlocks\0" 4653 "SkipConsistencyChecks\0" 4654 "Locked\0BIOSVisible\0Cylinders\0Heads\0Sectors\0Mountable\0" 4655 "EmptyDrive\0IoBufMax\0NonRotationalMedium\0" 4654 4656 #if defined(VBOX_PERIODIC_FLUSH) || defined(VBOX_IGNORE_FLUSH) 4655 "FlushInterval\0IgnoreFlush\0IgnoreFlushAsync\0"4657 "FlushInterval\0IgnoreFlush\0IgnoreFlushAsync\0" 4656 4658 #endif /* !(VBOX_PERIODIC_FLUSH || VBOX_IGNORE_FLUSH) */ 4657 4659 ); … … 4661 4663 /* All other image configurations only contain image name and 4662 4664 * the format information. */ 4663 fValid = CFGMR3AreValuesValid(pCurNode, "Format\0Path\0"4664 "MergeSource\0MergeTarget\0");4665 fValid = pHlp->pfnCFGMAreValuesValid(pCurNode, "Format\0Path\0" 4666 "MergeSource\0MergeTarget\0"); 4665 4667 } 4666 4668 if (!fValid) … … 4673 4675 if (pCurNode == pCfg) 4674 4676 { 4675 rc = CFGMR3QueryBoolDef(pCurNode, "HostIPStack", &fHostIP, true);4677 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "HostIPStack", &fHostIP, true); 4676 4678 if (RT_FAILURE(rc)) 4677 4679 { … … 4681 4683 } 4682 4684 4683 rc = CFGMR3QueryBoolDef(pCurNode, "HonorZeroWrites", &fHonorZeroWrites, false);4685 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "HonorZeroWrites", &fHonorZeroWrites, false); 4684 4686 if (RT_FAILURE(rc)) 4685 4687 { … … 4689 4691 } 4690 4692 4691 rc = CFGMR3QueryBoolDef(pCurNode, "ReadOnly", &fReadOnly, false);4693 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "ReadOnly", &fReadOnly, false); 4692 4694 if (RT_FAILURE(rc)) 4693 4695 { … … 4697 4699 } 4698 4700 4699 rc = CFGMR3QueryBoolDef(pCurNode, "MaybeReadOnly", &fMaybeReadOnly, false);4701 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "MaybeReadOnly", &fMaybeReadOnly, false); 4700 4702 if (RT_FAILURE(rc)) 4701 4703 { … … 4705 4707 } 4706 4708 4707 rc = CFGMR3QueryBoolDef(pCurNode, "TempReadOnly", &pThis->fTempReadOnly, false);4709 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "TempReadOnly", &pThis->fTempReadOnly, false); 4708 4710 if (RT_FAILURE(rc)) 4709 4711 { … … 4719 4721 } 4720 4722 4721 rc = CFGMR3QueryBoolDef(pCurNode, "Shareable", &pThis->fShareable, false);4723 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "Shareable", &pThis->fShareable, false); 4722 4724 if (RT_FAILURE(rc)) 4723 4725 { … … 4727 4729 } 4728 4730 4729 rc = CFGMR3QueryBoolDef(pCurNode, "UseNewIo", &fUseNewIo, false);4731 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "UseNewIo", &fUseNewIo, false); 4730 4732 if (RT_FAILURE(rc)) 4731 4733 { … … 4734 4736 break; 4735 4737 } 4736 rc = CFGMR3QueryBoolDef(pCurNode, "SetupMerge", &pThis->fMergePending, false);4738 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "SetupMerge", &pThis->fMergePending, false); 4737 4739 if (RT_FAILURE(rc)) 4738 4740 { … … 4747 4749 break; 4748 4750 } 4749 rc = CFGMR3QueryBoolDef(pCurNode, "BootAcceleration", &pThis->fBootAccelEnabled, false);4751 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "BootAcceleration", &pThis->fBootAccelEnabled, false); 4750 4752 if (RT_FAILURE(rc)) 4751 4753 { … … 4754 4756 break; 4755 4757 } 4756 rc = CFGMR3QueryU32Def(pCurNode, "BootAccelerationBuffer", (uint32_t *)&pThis->cbBootAccelBuffer, 16 * _1K);4758 rc = pHlp->pfnCFGMQueryU32Def(pCurNode, "BootAccelerationBuffer", (uint32_t *)&pThis->cbBootAccelBuffer, 16 * _1K); 4757 4759 if (RT_FAILURE(rc)) 4758 4760 { … … 4761 4763 break; 4762 4764 } 4763 rc = CFGMR3QueryBoolDef(pCurNode, "BlockCache", &fUseBlockCache, false);4765 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "BlockCache", &fUseBlockCache, false); 4764 4766 if (RT_FAILURE(rc)) 4765 4767 { … … 4768 4770 break; 4769 4771 } 4770 rc = CFGMR3QueryStringAlloc(pCurNode, "BwGroup", &pThis->pszBwGroup);4772 rc = pHlp->pfnCFGMQueryStringAlloc(pCurNode, "BwGroup", &pThis->pszBwGroup); 4771 4773 if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND) 4772 4774 { … … 4777 4779 else 4778 4780 rc = VINF_SUCCESS; 4779 rc = CFGMR3QueryBoolDef(pCurNode, "Discard", &fDiscard, false);4781 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "Discard", &fDiscard, false); 4780 4782 if (RT_FAILURE(rc)) 4781 4783 { … … 4790 4792 break; 4791 4793 } 4792 rc = CFGMR3QueryBoolDef(pCurNode, "InformAboutZeroBlocks", &fInformAboutZeroBlocks, false);4794 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "InformAboutZeroBlocks", &fInformAboutZeroBlocks, false); 4793 4795 if (RT_FAILURE(rc)) 4794 4796 { … … 4797 4799 break; 4798 4800 } 4799 rc = CFGMR3QueryBoolDef(pCurNode, "SkipConsistencyChecks", &fSkipConsistencyChecks, true);4801 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "SkipConsistencyChecks", &fSkipConsistencyChecks, true); 4800 4802 if (RT_FAILURE(rc)) 4801 4803 { … … 4806 4808 4807 4809 char *psz = NULL; 4808 rc = CFGMR3QueryStringAlloc(pCfg, "Type", &psz);4810 rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "Type", &psz); 4809 4811 if (RT_FAILURE(rc)) 4810 4812 return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_BLOCK_NO_TYPE, N_("Failed to obtain the sub type")); … … 4819 4821 MMR3HeapFree(psz); psz = NULL; 4820 4822 4821 rc = CFGMR3QueryStringAlloc(pCurNode, "CachePath", &pszCachePath);4823 rc = pHlp->pfnCFGMQueryStringAlloc(pCurNode, "CachePath", &pszCachePath); 4822 4824 if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND) 4823 4825 { … … 4831 4833 if (pszCachePath) 4832 4834 { 4833 rc = CFGMR3QueryStringAlloc(pCurNode, "CacheFormat", &pszCacheFormat);4835 rc = pHlp->pfnCFGMQueryStringAlloc(pCurNode, "CacheFormat", &pszCacheFormat); 4834 4836 if (RT_FAILURE(rc)) 4835 4837 { … … 4841 4843 4842 4844 /* Mountable */ 4843 rc = CFGMR3QueryBoolDef(pCfg, "Mountable", &pThis->fMountable, false);4845 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "Mountable", &pThis->fMountable, false); 4844 4846 if (RT_FAILURE(rc)) 4845 4847 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Mountable\" from the config")); 4846 4848 4847 4849 /* Locked */ 4848 rc = CFGMR3QueryBoolDef(pCfg, "Locked", &pThis->fLocked, false);4850 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "Locked", &pThis->fLocked, false); 4849 4851 if (RT_FAILURE(rc)) 4850 4852 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Locked\" from the config")); 4851 4853 4852 4854 /* BIOS visible */ 4853 rc = CFGMR3QueryBoolDef(pCfg, "BIOSVisible", &pThis->fBiosVisible, true);4855 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "BIOSVisible", &pThis->fBiosVisible, true); 4854 4856 if (RT_FAILURE(rc)) 4855 4857 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"BIOSVisible\" from the config")); 4856 4858 4857 4859 /* Cylinders */ 4858 rc = CFGMR3QueryU32Def(pCfg, "Cylinders", &pThis->LCHSGeometry.cCylinders, 0);4860 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "Cylinders", &pThis->LCHSGeometry.cCylinders, 0); 4859 4861 if (RT_FAILURE(rc)) 4860 4862 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Cylinders\" from the config")); 4861 4863 4862 4864 /* Heads */ 4863 rc = CFGMR3QueryU32Def(pCfg, "Heads", &pThis->LCHSGeometry.cHeads, 0);4865 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "Heads", &pThis->LCHSGeometry.cHeads, 0); 4864 4866 if (RT_FAILURE(rc)) 4865 4867 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Heads\" from the config")); 4866 4868 4867 4869 /* Sectors */ 4868 rc = CFGMR3QueryU32Def(pCfg, "Sectors", &pThis->LCHSGeometry.cSectors, 0);4870 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "Sectors", &pThis->LCHSGeometry.cSectors, 0); 4869 4871 if (RT_FAILURE(rc)) 4870 4872 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Sectors\" from the config")); 4871 4873 4872 4874 /* Uuid */ 4873 rc = CFGMR3QueryStringAlloc(pCfg, "Uuid", &psz);4875 rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "Uuid", &psz); 4874 4876 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 4875 4877 RTUuidClear(&pThis->Uuid); … … 4889 4891 4890 4892 #ifdef VBOX_PERIODIC_FLUSH 4891 rc = CFGMR3QueryU32Def(pCfg, "FlushInterval", &pThis->cbFlushInterval, 0);4893 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "FlushInterval", &pThis->cbFlushInterval, 0); 4892 4894 if (RT_FAILURE(rc)) 4893 4895 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"FlushInterval\" from the config")); … … 4895 4897 4896 4898 #ifdef VBOX_IGNORE_FLUSH 4897 rc = CFGMR3QueryBoolDef(pCfg, "IgnoreFlush", &pThis->fIgnoreFlush, true);4899 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "IgnoreFlush", &pThis->fIgnoreFlush, true); 4898 4900 if (RT_FAILURE(rc)) 4899 4901 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"IgnoreFlush\" from the config")); … … 4904 4906 LogRel(("DrvVD: Flushes will be passed to the disk\n")); 4905 4907 4906 rc = CFGMR3QueryBoolDef(pCfg, "IgnoreFlushAsync", &pThis->fIgnoreFlushAsync, false);4908 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "IgnoreFlushAsync", &pThis->fIgnoreFlushAsync, false); 4907 4909 if (RT_FAILURE(rc)) 4908 4910 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"IgnoreFlushAsync\" from the config")); … … 4914 4916 #endif /* VBOX_IGNORE_FLUSH */ 4915 4917 4916 rc = CFGMR3QueryBoolDef(pCurNode, "EmptyDrive", &fEmptyDrive, false);4918 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "EmptyDrive", &fEmptyDrive, false); 4917 4919 if (RT_FAILURE(rc)) 4918 4920 { … … 4922 4924 } 4923 4925 4924 rc = CFGMR3QueryU32Def(pCfg, "IoBufMax", &cbIoBufMax, 5 * _1M);4926 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IoBufMax", &cbIoBufMax, 5 * _1M); 4925 4927 if (RT_FAILURE(rc)) 4926 4928 return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"IoBufMax\" from the config")); 4927 4929 4928 rc = CFGMR3QueryBoolDef(pCfg, "NonRotationalMedium", &pThis->fNonRotational, false);4930 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "NonRotationalMedium", &pThis->fNonRotational, false); 4929 4931 if (RT_FAILURE(rc)) 4930 4932 return PDMDRV_SET_ERROR(pDrvIns, rc, … … 5014 5016 * Read the image configuration. 5015 5017 */ 5016 rc = CFGMR3QueryStringAlloc(pCurNode, "Path", &pszName);5018 rc = pHlp->pfnCFGMQueryStringAlloc(pCurNode, "Path", &pszName); 5017 5019 if (RT_FAILURE(rc)) 5018 5020 { … … 5022 5024 } 5023 5025 5024 rc = CFGMR3QueryStringAlloc(pCurNode, "Format", &pszFormat);5026 rc = pHlp->pfnCFGMQueryStringAlloc(pCurNode, "Format", &pszFormat); 5025 5027 if (RT_FAILURE(rc)) 5026 5028 { … … 5031 5033 5032 5034 bool fMergeSource; 5033 rc = CFGMR3QueryBoolDef(pCurNode, "MergeSource", &fMergeSource, false);5035 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "MergeSource", &fMergeSource, false); 5034 5036 if (RT_FAILURE(rc)) 5035 5037 { … … 5051 5053 5052 5054 bool fMergeTarget; 5053 rc = CFGMR3QueryBoolDef(pCurNode, "MergeTarget", &fMergeTarget, false);5055 rc = pHlp->pfnCFGMQueryBoolDef(pCurNode, "MergeTarget", &fMergeTarget, false); 5054 5056 if (RT_FAILURE(rc)) 5055 5057 { … … 5070 5072 } 5071 5073 5072 PCFGMNODE pCfgVDConfig = CFGMR3GetChild(pCurNode, "VDConfig");5074 PCFGMNODE pCfgVDConfig = pHlp->pfnCFGMGetChild(pCurNode, "VDConfig"); 5073 5075 pImage->VDIfConfig.pfnAreKeysValid = drvvdCfgAreKeysValid; 5074 5076 pImage->VDIfConfig.pfnQuerySize = drvvdCfgQuerySize; … … 5090 5092 { 5091 5093 if (pCfgVDConfig) 5092 pThis->pCfgCrypto = CFGMR3GetChild(pCfgVDConfig, "CRYPT");5094 pThis->pCfgCrypto = pHlp->pfnCFGMGetChild(pCfgVDConfig, "CRYPT"); 5093 5095 5094 5096 if (pThis->pCfgCrypto) … … 5248 5250 iLevel--; 5249 5251 iImageIdx++; 5250 pCurNode = CFGMR3GetParent(pCurNode);5252 pCurNode = pHlp->pfnCFGMGetParent(pCurNode); 5251 5253 } 5252 5254
Note:
See TracChangeset
for help on using the changeset viewer.