diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
|---|---|---|
| committer | <> | 2014-05-08 15:03:54 +0000 |
| commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
| tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Devices/Storage/DrvHostFloppy.cpp | |
| parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
| download | VirtualBox-master.tar.gz | |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Devices/Storage/DrvHostFloppy.cpp')
| -rw-r--r-- | src/VBox/Devices/Storage/DrvHostFloppy.cpp | 37 |
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)) { |
