Changeset 63827 in vbox
- Timestamp:
- Sep 14, 2016 9:36:03 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/ISCSI.cpp
r63802 r63827 5081 5081 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5082 5082 5083 Assert (pImage);5084 NOREF(pImage);5083 AssertPtr(pImage); 5084 RT_NOREF1(pImage); 5085 5085 5086 5086 return 0; … … 5093 5093 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5094 5094 5095 Assert(pImage); 5096 5097 if (pImage) 5098 return pImage->cbSector; 5099 else 5100 return 0; 5095 AssertPtrReturn(pImage, 0); 5096 5097 return pImage->cbSector; 5101 5098 } 5102 5099 … … 5107 5104 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5108 5105 5109 Assert(pImage); 5110 5111 if (pImage) 5112 return pImage->cbSize; 5113 else 5114 return 0; 5106 AssertPtrReturn(pImage, 0); 5107 5108 return pImage->cbSize; 5115 5109 } 5116 5110 … … 5121 5115 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5122 5116 5123 Assert(pImage); 5124 NOREF(pImage); 5125 5126 if (pImage) 5127 return pImage->cbSize; 5128 else 5129 return 0; 5117 AssertPtrReturn(pImage, 0); 5118 5119 return pImage->cbSize; 5130 5120 } 5131 5121 … … 5136 5126 LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry)); 5137 5127 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5138 int rc; 5139 5140 Assert(pImage); 5141 5142 if (pImage) 5143 rc = VERR_VD_GEOMETRY_NOT_SET; 5144 else 5145 rc = VERR_VD_NOT_OPENED; 5146 5147 LogFlowFunc(("returns %Rrc (PCHS=%u/%u/%u)\n", rc, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors)); 5148 return rc; 5128 5129 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5130 5131 LogFlowFunc(("returns %Rrc (PCHS=%u/%u/%u)\n", VERR_VD_GEOMETRY_NOT_SET, 5132 pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors)); 5133 return VERR_VD_GEOMETRY_NOT_SET; 5149 5134 } 5150 5135 … … 5155 5140 LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors)); 5156 5141 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5142 5143 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5144 5157 5145 int rc; 5158 5159 Assert(pImage); 5160 5161 if (pImage) 5162 { 5163 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 5164 { 5165 rc = VERR_VD_IMAGE_READ_ONLY; 5166 goto out; 5167 } 5146 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 5147 rc = VERR_VD_IMAGE_READ_ONLY; 5148 else 5168 5149 rc = VERR_VD_GEOMETRY_NOT_SET; 5169 } 5170 else 5171 rc = VERR_VD_NOT_OPENED; 5172 5173 out: 5150 5174 5151 LogFlowFunc(("returns %Rrc\n", rc)); 5175 5152 return rc; … … 5182 5159 LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry)); 5183 5160 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5184 int rc; 5185 5186 Assert(pImage); 5187 5188 if (pImage) 5189 rc = VERR_VD_GEOMETRY_NOT_SET; 5190 else 5191 rc = VERR_VD_NOT_OPENED; 5192 5193 LogFlowFunc(("returns %Rrc (LCHS=%u/%u/%u)\n", rc, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors)); 5194 return rc; 5161 5162 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5163 5164 LogFlowFunc(("returns %Rrc (LCHS=%u/%u/%u)\n", VERR_VD_GEOMETRY_NOT_SET, 5165 pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors)); 5166 return VERR_VD_GEOMETRY_NOT_SET; 5195 5167 } 5196 5168 … … 5201 5173 LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors)); 5202 5174 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5175 5176 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5177 5203 5178 int rc; 5204 5205 Assert(pImage); 5206 5207 if (pImage) 5208 { 5209 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 5210 { 5211 rc = VERR_VD_IMAGE_READ_ONLY; 5212 goto out; 5213 } 5179 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 5180 rc = VERR_VD_IMAGE_READ_ONLY; 5181 else 5214 5182 rc = VERR_VD_GEOMETRY_NOT_SET; 5215 } 5216 else 5217 rc = VERR_VD_NOT_OPENED; 5218 5219 out: 5183 5220 5184 LogFlowFunc(("returns %Rrc\n", rc)); 5221 5185 return rc; … … 5227 5191 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); 5228 5192 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5229 unsigned uImageFlags; 5230 5231 Assert(pImage); 5232 NOREF(pImage); 5233 5234 uImageFlags = VD_IMAGE_FLAGS_FIXED; 5235 5236 LogFlowFunc(("returns %#x\n", uImageFlags)); 5237 return uImageFlags; 5193 5194 AssertPtrReturn(pImage, 0); 5195 5196 LogFlowFunc(("returns %#x\n", VD_IMAGE_FLAGS_FIXED)); 5197 return VD_IMAGE_FLAGS_FIXED; 5238 5198 } 5239 5199 … … 5243 5203 LogFlowFunc(("pBackendData=%#p\n", pBackendData)); 5244 5204 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5245 unsigned uOpenFlags; 5246 5247 Assert(pImage); 5248 5249 if (pImage) 5250 uOpenFlags = pImage->uOpenFlags; 5251 else 5252 uOpenFlags = 0; 5253 5254 LogFlowFunc(("returns %#x\n", uOpenFlags)); 5255 return uOpenFlags; 5205 5206 AssertPtrReturn(pImage, 0); 5207 5208 LogFlowFunc(("returns %#x\n", pImage->uOpenFlags)); 5209 return pImage->uOpenFlags; 5256 5210 } 5257 5211 … … 5295 5249 LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment)); 5296 5250 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5297 int rc; 5298 5299 Assert(pImage); 5300 5301 if (pImage) 5302 rc = VERR_NOT_SUPPORTED; 5303 else 5304 rc = VERR_VD_NOT_OPENED; 5305 5306 LogFlowFunc(("returns %Rrc comment='%s'\n", rc, pszComment)); 5307 return rc; 5251 5252 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5253 5254 LogFlowFunc(("returns %Rrc comment='%s'\n", VERR_NOT_SUPPORTED, pszComment)); 5255 return VERR_NOT_SUPPORTED; 5308 5256 } 5309 5257 … … 5314 5262 LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment)); 5315 5263 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5264 5265 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5266 5316 5267 int rc; 5317 5318 Assert(pImage); 5319 5320 if (pImage) 5321 { 5322 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5323 rc = VERR_NOT_SUPPORTED; 5324 else 5325 rc = VERR_VD_IMAGE_READ_ONLY; 5326 } 5268 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5269 rc = VERR_NOT_SUPPORTED; 5327 5270 else 5328 rc = VERR_VD_ NOT_OPENED;5271 rc = VERR_VD_IMAGE_READ_ONLY; 5329 5272 5330 5273 LogFlowFunc(("returns %Rrc\n", rc)); … … 5338 5281 LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid)); 5339 5282 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5340 int rc; 5341 5342 Assert(pImage); 5343 5344 if (pImage) 5345 rc = VERR_NOT_SUPPORTED; 5346 else 5347 rc = VERR_VD_NOT_OPENED; 5348 5349 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); 5350 return rc; 5283 5284 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5285 5286 LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid)); 5287 return VERR_NOT_SUPPORTED; 5351 5288 } 5352 5289 … … 5357 5294 LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid)); 5358 5295 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5296 5297 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5298 5359 5299 int rc; 5360 5361 LogFlowFunc(("%RTuuid\n", pUuid)); 5362 Assert(pImage); 5363 5364 if (pImage) 5365 { 5366 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5367 rc = VERR_NOT_SUPPORTED; 5368 else 5369 rc = VERR_VD_IMAGE_READ_ONLY; 5370 } 5300 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5301 rc = VERR_NOT_SUPPORTED; 5371 5302 else 5372 rc = VERR_VD_ NOT_OPENED;5303 rc = VERR_VD_IMAGE_READ_ONLY; 5373 5304 5374 5305 LogFlowFunc(("returns %Rrc\n", rc)); … … 5382 5313 LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid)); 5383 5314 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5384 int rc; 5385 5386 Assert(pImage); 5387 5388 if (pImage) 5389 rc = VERR_NOT_SUPPORTED; 5390 else 5391 rc = VERR_VD_NOT_OPENED; 5392 5393 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); 5394 return rc; 5315 5316 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5317 5318 LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid)); 5319 return VERR_NOT_SUPPORTED; 5395 5320 } 5396 5321 … … 5401 5326 LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid)); 5402 5327 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5328 5329 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5330 5403 5331 int rc; 5404 5405 LogFlowFunc(("%RTuuid\n", pUuid)); 5406 Assert(pImage); 5407 5408 if (pImage) 5409 { 5410 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5411 rc = VERR_NOT_SUPPORTED; 5412 else 5413 rc = VERR_VD_IMAGE_READ_ONLY; 5414 } 5332 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5333 rc = VERR_NOT_SUPPORTED; 5415 5334 else 5416 rc = VERR_VD_ NOT_OPENED;5335 rc = VERR_VD_IMAGE_READ_ONLY; 5417 5336 5418 5337 LogFlowFunc(("returns %Rrc\n", rc)); … … 5426 5345 LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid)); 5427 5346 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5428 int rc; 5429 5430 Assert(pImage); 5431 5432 if (pImage) 5433 rc = VERR_NOT_SUPPORTED; 5434 else 5435 rc = VERR_VD_NOT_OPENED; 5436 5437 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); 5438 return rc; 5347 5348 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5349 5350 LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid)); 5351 return VERR_NOT_SUPPORTED; 5439 5352 } 5440 5353 … … 5445 5358 LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid)); 5446 5359 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5360 5361 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5362 5447 5363 int rc; 5448 5449 LogFlowFunc(("%RTuuid\n", pUuid)); 5450 Assert(pImage); 5451 5452 if (pImage) 5453 { 5454 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5455 rc = VERR_NOT_SUPPORTED; 5456 else 5457 rc = VERR_VD_IMAGE_READ_ONLY; 5458 } 5364 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5365 rc = VERR_NOT_SUPPORTED; 5459 5366 else 5460 rc = VERR_VD_ NOT_OPENED;5367 rc = VERR_VD_IMAGE_READ_ONLY; 5461 5368 5462 5369 LogFlowFunc(("returns %Rrc\n", rc)); … … 5470 5377 LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid)); 5471 5378 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5472 int rc; 5473 5474 Assert(pImage); 5475 5476 if (pImage) 5477 rc = VERR_NOT_SUPPORTED; 5478 else 5479 rc = VERR_VD_NOT_OPENED; 5480 5481 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); 5482 return rc; 5379 5380 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5381 5382 LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid)); 5383 return VERR_NOT_SUPPORTED; 5483 5384 } 5484 5385 … … 5489 5390 LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid)); 5490 5391 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5392 5393 AssertPtrReturn(pImage, VERR_VD_NOT_OPENED); 5394 5491 5395 int rc; 5492 5493 LogFlowFunc(("%RTuuid\n", pUuid)); 5494 Assert(pImage); 5495 5496 if (pImage) 5497 { 5498 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5499 rc = VERR_NOT_SUPPORTED; 5500 else 5501 rc = VERR_VD_IMAGE_READ_ONLY; 5502 } 5396 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)) 5397 rc = VERR_NOT_SUPPORTED; 5503 5398 else 5504 rc = VERR_VD_ NOT_OPENED;5399 rc = VERR_VD_IMAGE_READ_ONLY; 5505 5400 5506 5401 LogFlowFunc(("returns %Rrc\n", rc)); … … 5513 5408 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData; 5514 5409 5515 Assert(pImage); 5516 if (pImage) 5517 { 5518 /** @todo put something useful here */ 5519 vdIfErrorMessage(pImage->pIfError, "Header: cVolume=%u\n", pImage->cVolume); 5520 } 5410 AssertPtrReturnVoid(pImage); 5411 /** @todo put something useful here */ 5412 vdIfErrorMessage(pImage->pIfError, "Header: cVolume=%u\n", pImage->cVolume); 5521 5413 } 5522 5414
Note:
See TracChangeset
for help on using the changeset viewer.