Changeset 15592 in vbox for trunk/src/VBox/Devices/Storage/DrvVD.cpp
- Timestamp:
- Dec 16, 2008 2:48:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r15366 r15592 841 841 "ReadOnly\0HonorZeroWrites\0" 842 842 "HostIPStack\0"); 843 844 rc = CFGMR3QueryBool(pCfgHandle, "HostIPStack", &fHostIP); 843 } 844 else 845 { 846 /* All other image configurations only contain image name and 847 * the format information. */ 848 fValid = CFGMR3AreValuesValid(pCurNode, "Format\0Path\0"); 849 } 850 if (!fValid) 851 { 852 rc = PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES, 853 RT_SRC_POS, N_("DrvVD: Configuration error: keys incorrect at level %d"), iLevel); 854 break; 855 } 856 857 if (pCurNode == pCfgHandle) 858 { 859 rc = CFGMR3QueryBool(pCurNode, "HostIPStack", &fHostIP); 845 860 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 846 861 { … … 854 869 break; 855 870 } 856 } 857 else 858 { 859 /* All other image configurations only contain image name and 860 * the format information. */ 861 fValid = CFGMR3AreValuesValid(pCurNode, "Format\0Path\0"); 862 } 863 if (!fValid) 864 { 865 rc = PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES, 866 RT_SRC_POS, N_("DrvVD: Configuration error: keys incorrect at level %d"), iLevel); 867 break; 871 872 rc = CFGMR3QueryBool(pCurNode, "HonorZeroWrites", &fHonorZeroWrites); 873 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 874 { 875 fHonorZeroWrites = false; 876 rc = VINF_SUCCESS; 877 } 878 else if (RT_FAILURE(rc)) 879 { 880 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 881 N_("DrvVD: Configuration error: Querying \"HonorZeroWrites\" as boolean failed")); 882 break; 883 } 884 885 rc = CFGMR3QueryBool(pCurNode, "ReadOnly", &fReadOnly); 886 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 887 { 888 fReadOnly = false; 889 rc = VINF_SUCCESS; 890 } 891 else if (RT_FAILURE(rc)) 892 { 893 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 894 N_("DrvVD: Configuration error: Querying \"ReadOnly\" as boolean failed")); 895 break; 896 } 868 897 } 869 898 … … 945 974 } 946 975 947 rc = CFGMR3QueryStringAlloc(pC fgHandle, "Format", &pszFormat);976 rc = CFGMR3QueryStringAlloc(pCurNode, "Format", &pszFormat); 948 977 if (RT_FAILURE(rc)) 949 978 { … … 951 980 N_("DrvVD: Configuration error: Querying \"Format\" as string failed")); 952 981 break; 953 }954 955 if (iLevel == 0)956 {957 rc = CFGMR3QueryBool(pCurNode, "ReadOnly", &fReadOnly);958 if (rc == VERR_CFGM_VALUE_NOT_FOUND)959 fReadOnly = false;960 else if (RT_FAILURE(rc))961 {962 rc = PDMDRV_SET_ERROR(pDrvIns, rc,963 N_("DrvVD: Configuration error: Querying \"ReadOnly\" as boolean failed"));964 break;965 }966 967 rc = CFGMR3QueryBool(pCfgHandle, "HonorZeroWrites", &fHonorZeroWrites);968 if (rc == VERR_CFGM_VALUE_NOT_FOUND)969 fHonorZeroWrites = false;970 else if (RT_FAILURE(rc))971 {972 rc = PDMDRV_SET_ERROR(pDrvIns, rc,973 N_("DrvVD: Configuration error: Querying \"HonorZeroWrites\" as boolean failed"));974 break;975 }976 }977 else978 {979 fReadOnly = true;980 fHonorZeroWrites = false;981 982 } 982 983 … … 990 991 */ 991 992 unsigned uOpenFlags; 992 if (fReadOnly )993 if (fReadOnly || iLevel != 0) 993 994 uOpenFlags = VD_OPEN_FLAGS_READONLY; 994 995 else
Note:
See TracChangeset
for help on using the changeset viewer.