summaryrefslogtreecommitdiff
path: root/src/VBox/Devices/Storage/DrvHostFloppy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Devices/Storage/DrvHostFloppy.cpp')
-rw-r--r--src/VBox/Devices/Storage/DrvHostFloppy.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/VBox/Devices/Storage/DrvHostFloppy.cpp b/src/VBox/Devices/Storage/DrvHostFloppy.cpp
index a65185b6..ba53e807 100644
--- a/src/VBox/Devices/Storage/DrvHostFloppy.cpp
+++ b/src/VBox/Devices/Storage/DrvHostFloppy.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -91,7 +91,7 @@ static DECLCALLBACK(int) drvHostFloppyGetMediaSize(PDRVHOSTBASE pThis, uint64_t
dwLastError = GetLastError();
rc = RTErrConvertFromWin32(dwLastError);
- Log(("DrvHostFloppy: IOCTL_DISK_GET_DRIVE_GEOMETRY(%s) failed, LastError=%d rc=%Rrc\n",
+ Log(("DrvHostFloppy: IOCTL_DISK_GET_DRIVE_GEOMETRY(%s) failed, LastError=%d rc=%Rrc\n",
pThis->pszDevice, dwLastError, rc));
return rc;
}
@@ -184,32 +184,37 @@ static DECLCALLBACK(int) drvHostFloppyConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pC
LogFlow(("drvHostFloppyConstruct: iInstance=%d\n", pDrvIns->iInstance));
/*
- * Validate configuration.
- */
- if (!CFGMR3AreValuesValid(pCfg, "Path\0ReadOnly\0Interval\0Locked\0BIOSVisible\0"))
- return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
-
- /*
* Init instance data.
*/
int rc = DRVHostBaseInitData(pDrvIns, pCfg, PDMBLOCKTYPE_FLOPPY_1_44);
if (RT_SUCCESS(rc))
{
/*
- * Override stuff.
+ * Validate configuration.
*/
+ if (CFGMR3AreValuesValid(pCfg, "Path\0ReadOnly\0Interval\0Locked\0BIOSVisible\0"))
+ {
+ /*
+ * Override stuff.
+ */
#ifdef RT_OS_WINDOWS
- pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize;
+ pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize;
#endif
#ifdef RT_OS_LINUX
- pThis->Base.pfnPoll = drvHostFloppyPoll;
- pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize;
+ pThis->Base.pfnPoll = drvHostFloppyPoll;
+ pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize;
#endif
- /*
- * 2nd init part.
- */
- rc = DRVHostBaseInitFinish(&pThis->Base);
+ /*
+ * 2nd init part.
+ */
+ rc = DRVHostBaseInitFinish(&pThis->Base);
+ }
+ else
+ {
+ pThis->Base.fAttachFailError = true;
+ rc = VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
+ }
}
if (RT_FAILURE(rc))
{