- Timestamp:
- Nov 11, 2009 2:54:01 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 54718
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r23950 r24583 903 903 fValid = CFGMR3AreValuesValid(pCurNode, 904 904 "Format\0Path\0" 905 "ReadOnly\0 HonorZeroWrites\0"905 "ReadOnly\0TempReadOnly\0HonorZeroWrites\0" 906 906 "HostIPStack\0"); 907 907 } … … 921 921 if (pCurNode == pCfgHandle) 922 922 { 923 rc = CFGMR3QueryBool(pCurNode, "HostIPStack", &fHostIP); 924 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 925 { 926 fHostIP = true; 927 rc = VINF_SUCCESS; 928 } 929 else if (RT_FAILURE(rc)) 923 rc = CFGMR3QueryBoolDef(pCurNode, "HostIPStack", &fHostIP, true); 924 if (RT_FAILURE(rc)) 930 925 { 931 926 rc = PDMDRV_SET_ERROR(pDrvIns, rc, … … 934 929 } 935 930 936 rc = CFGMR3QueryBool(pCurNode, "HonorZeroWrites", &fHonorZeroWrites); 937 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 938 { 939 fHonorZeroWrites = false; 940 rc = VINF_SUCCESS; 941 } 942 else if (RT_FAILURE(rc)) 931 rc = CFGMR3QueryBoolDef(pCurNode, "HonorZeroWrites", &fHonorZeroWrites, false); 932 if (RT_FAILURE(rc)) 943 933 { 944 934 rc = PDMDRV_SET_ERROR(pDrvIns, rc, … … 947 937 } 948 938 949 rc = CFGMR3QueryBool(pCurNode, "ReadOnly", &fReadOnly); 950 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 951 { 952 fReadOnly = false; 953 rc = VINF_SUCCESS; 954 } 955 else if (RT_FAILURE(rc)) 939 rc = CFGMR3QueryBoolDef(pCurNode, "ReadOnly", &fReadOnly, false); 940 if (RT_FAILURE(rc)) 956 941 { 957 942 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 958 943 N_("DrvVD: Configuration error: Querying \"ReadOnly\" as boolean failed")); 944 break; 945 } 946 947 rc = CFGMR3QueryBoolDef(pCurNode, "TempReadOnly", &pThis->fTempReadOnly, false); 948 if (RT_FAILURE(rc)) 949 { 950 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 951 N_("DrvVD: Configuration error: Querying \"TempReadOnly\" as boolean failed")); 952 break; 953 } 954 if (fReadOnly && pThis->fTempReadOnly) 955 { 956 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 957 N_("DrvVD: Configuration error: Both \"ReadOnly\" and \"TempReadOnly\" are set")); 959 958 break; 960 959 } … … 1058 1057 */ 1059 1058 unsigned uOpenFlags; 1060 if (fReadOnly || iLevel != 0)1059 if (fReadOnly || pThis->fTempReadOnly || iLevel != 0) 1061 1060 uOpenFlags = VD_OPEN_FLAGS_READONLY; 1062 1061 else … … 1067 1066 uOpenFlags |= VD_OPEN_FLAGS_ASYNC_IO; 1068 1067 1069 /* Try to open backend in asy c I/O mode first. */1068 /* Try to open backend in async I/O mode first. */ 1070 1069 rc = VDOpen(pThis->pDisk, pszFormat, pszName, uOpenFlags, pImage->pVDIfsImage); 1071 1070 if (rc == VERR_NOT_SUPPORTED) … … 1084 1083 if ( VDIsReadOnly(pThis->pDisk) 1085 1084 && !fReadOnly 1085 && !pThis->fTempReadOnly 1086 1086 && iLevel == 0) 1087 1087 { 1088 1088 rc = PDMDrvHlpVMSetError(pDrvIns, VERR_VD_IMAGE_READ_ONLY, RT_SRC_POS, 1089 N_("Failed to open image '%s' for writing due to wrong "1090 "permissions"),pszName);1089 N_("Failed to open image '%s' for writing due to wrong permissions"), 1090 pszName); 1091 1091 break; 1092 1092 } … … 1182 1182 * @param pDrvIns The driver instance data. 1183 1183 */ 1184 static DECLCALLBACK(void) drvvdResume (PPDMDRVINS pDrvIns)1184 static DECLCALLBACK(void) drvvdResumeOrPowerOn(PPDMDRVINS pDrvIns) 1185 1185 { 1186 1186 LogFlow(("%s:\n", __FUNCTION__)); … … 1211 1211 AssertRC(rc); 1212 1212 } 1213 1213 1214 1214 1215 /** … … 1238 1239 NULL, 1239 1240 /* pfnPowerOn */ 1240 NULL,1241 drvvdResumeOrPowerOn, 1241 1242 /* pfnReset */ 1242 1243 NULL, … … 1244 1245 drvvdSuspend, 1245 1246 /* pfnResume */ 1246 drvvdResume ,1247 drvvdResumeOrPowerOn, 1247 1248 /* pfnAttach */ 1248 1249 NULL, -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r24579 r24583 1057 1057 { 1058 1058 rc = CFGMR3InsertInteger(pCfg, "ReadOnly", 1); RC_CHECK(); 1059 } 1060 /* Start without exclusive write access to the images. */ 1061 /** @todo Live Migration: I don't quite like this, we risk screwing up when 1062 * we're resuming the VM if some 3rd dude have any of the VDIs open 1063 * with write sharing denied. However, if the two VMs are sharing a 1064 * image it really is necessary.... 1065 * 1066 * So, on the "lock-media" command, the target teleporter should also 1067 * make DrvVD undo TempReadOnly. It gets interesting if we fail after 1068 * that. Grumble. */ 1069 else if (pConsole->mMachineState == MachineState_TeleportingIn) 1070 { 1071 rc = CFGMR3InsertInteger(pCfg, "TempReadOnly", 1); RC_CHECK(); 1059 1072 } 1060 1073
Note:
See TracChangeset
for help on using the changeset viewer.