Changeset 7152 in vbox
- Timestamp:
- Feb 26, 2008 5:17:10 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VBoxHDD.cpp
r6291 r7152 162 162 LogFlow(("vdiFlush:\n")); 163 163 PVDIDISK pData = PDMIMEDIA_2_VDIDISK(pInterface); 164 vdiFlushImage(pData->pLast);164 VDIFlushImage(pData->pLast); 165 165 int rc = VINF_SUCCESS; 166 166 LogFlow(("vdiFlush: returns %Vrc\n", rc)); -
trunk/src/VBox/Devices/Storage/VDICore.cpp
r6987 r7152 935 935 * Flush the image file to disk. 936 936 */ 937 void vdiFlushImage(PVDIIMAGEDESC pImage)937 void VDIFlushImage(PVDIIMAGEDESC pImage) 938 938 { 939 939 if (!pImage->fReadOnly) … … 959 959 Assert(pImage->File != NIL_RTFILE); 960 960 961 vdiFlushImage(pImage);961 VDIFlushImage(pImage); 962 962 RTFileUnlock(pImage->File, 963 963 0, … … 3313 3313 3314 3314 /* Flush last image changes if was r/w mode. */ 3315 vdiFlushImage(pImage);3315 VDIFlushImage(pImage); 3316 3316 3317 3317 /* Change image locking. */ … … 3367 3367 if (VBOX_SUCCESS(rc)) 3368 3368 { 3369 vdiFlushImage(pImage);3369 VDIFlushImage(pImage); 3370 3370 rc = vdiChangeImageMode(pImage, true); 3371 3371 AssertReleaseRC(rc); … … 3373 3373 } 3374 3374 else 3375 vdiFlushImage(pImage);3375 VDIFlushImage(pImage); 3376 3376 3377 3377 return rc; … … 3613 3613 3614 3614 /* Flush last parent image changes if possible. */ 3615 vdiFlushImage(pDisk->pLast);3615 VDIFlushImage(pDisk->pLast); 3616 3616 3617 3617 int rc = vdiCreateImage(pszFilename, -
trunk/src/VBox/Devices/Storage/VDICore.h
r6374 r7152 22 22 * Header Files * 23 23 *******************************************************************************/ 24 #ifndef VBOX_VDICORE_VD 24 25 #include <VBox/VBoxHDD.h> 26 #else /* VBOX_VDICORE_VD */ 27 #include <VBox/VBoxHDD-new.h> 28 #endif /* VBOX_VDICORE_VD */ 25 29 #include <VBox/pdm.h> 26 30 #include <VBox/mm.h> … … 264 268 #define GET_MINOR_HEADER_VERSION(ph) (VDI_GET_VERSION_MINOR((ph)->uVersion)) 265 269 270 #ifdef VBOX_VDICORE_VD 271 /** @name VDI image types 272 * @{ */ 273 typedef enum VDIIMAGETYPE 274 { 275 /** Normal dynamically growing base image file. */ 276 VDI_IMAGE_TYPE_NORMAL = 1, 277 /** Preallocated base image file of a fixed size. */ 278 VDI_IMAGE_TYPE_FIXED, 279 /** Dynamically growing image file for undo/commit changes support. */ 280 VDI_IMAGE_TYPE_UNDO, 281 /** Dynamically growing image file for differencing support. */ 282 VDI_IMAGE_TYPE_DIFF, 283 284 /** First valid image type value. */ 285 VDI_IMAGE_TYPE_FIRST = VDI_IMAGE_TYPE_NORMAL, 286 /** Last valid image type value. */ 287 VDI_IMAGE_TYPE_LAST = VDI_IMAGE_TYPE_DIFF 288 } VDIIMAGETYPE; 289 /** Pointer to VDI image type. */ 290 typedef VDIIMAGETYPE *PVDIIMAGETYPE; 291 /** @} */ 292 #endif /* VBOX_VDICORE_VD */ 266 293 267 294 /******************************************************************************* … … 451 478 } 452 479 480 #ifndef VBOX_VDICORE_VD 453 481 /** 454 482 * Default image block size, may be changed by setBlockSize/getBlockSize. … … 457 485 */ 458 486 #define VDI_IMAGE_DEFAULT_BLOCK_SIZE _1M 459 487 #endif /* !VBOX_VDICORE_VD */ 488 489 #ifndef VBOX_VDICORE_VD 460 490 /** 461 491 * fModified bit flags. … … 464 494 #define VDI_IMAGE_MODIFIED_FIRST RT_BIT(1) 465 495 #define VDI_IMAGE_MODIFIED_DISABLE_UUID_UPDATE RT_BIT(2) 496 #endif /* !VBOX_VDICORE_VD */ 466 497 467 498 /** … … 470 501 typedef struct VDIIMAGEDESC 471 502 { 503 #ifndef VBOX_VDICORE_VD 472 504 /** Link to parent image descriptor, if any. */ 473 505 struct VDIIMAGEDESC *pPrev; 474 506 /** Link to child image descriptor, if any. */ 475 507 struct VDIIMAGEDESC *pNext; 508 #endif /* !VBOX_VDICORE_VD */ 476 509 /** File handle. */ 477 510 RTFILE File; 511 #ifndef VBOX_VDICORE_VD 478 512 /** True if the image is operating in readonly mode. */ 479 513 bool fReadOnly; 480 514 /** Image open flags, VDI_OPEN_FLAGS_*. */ 481 515 unsigned fOpen; 516 #else /* VBOX_VDICORE_VD */ 517 /** Image open flags, VD__OPEN_FLAGS_*. */ 518 unsigned uOpenFlags; 519 #endif /* VBOX_VDICORE_VD */ 482 520 /** Image pre-header. */ 483 521 VDIPREHEADER PreHeader; … … 486 524 /** Pointer to a block array. */ 487 525 PVDIIMAGEBLOCKPOINTER paBlocks; 526 #ifndef VBOX_VDICORE_VD 488 527 /** fFlags copy from image header, for speed optimization. */ 489 528 unsigned fFlags; 529 #else /* VBOX_VDICORE_VD */ 530 /** fFlags copy from image header, for speed optimization. */ 531 unsigned uImageFlags; 532 #endif /* VBOX_VDICORE_VD */ 490 533 /** Start offset of block array in image file, here for speed optimization. */ 491 534 unsigned offStartBlocks; … … 502 545 /** Image is modified flags (VDI_IMAGE_MODIFIED*). */ 503 546 unsigned fModified; 547 #ifndef VBOX_VDICORE_VD 504 548 /** Container filename. (UTF-8) 505 549 * @todo Make this variable length to save a bunch of bytes. (low prio) */ 506 550 char szFilename[RTPATH_MAX]; 551 #else /* !VBOX_VDICORE_VD */ 552 /** Container filename. (UTF-8) */ 553 const char *pszFilename; 554 /** Physical geometry of this image (never actually stored). */ 555 PDMMEDIAGEOMETRY PCHSGeometry; 556 /** Error callback. */ 557 PFNVDERROR pfnError; 558 /** Opaque data for error callback. */ 559 void *pvErrorUser; 560 #endif /* !VBOX_VDICORE_VD */ 507 561 } VDIIMAGEDESC, *PVDIIMAGEDESC; 508 562 563 #ifndef VBOX_VDICORE_VD 509 564 /** 510 565 * Default work buffer size, may be changed by setBufferSize() method. … … 513 568 */ 514 569 #define VDIDISK_DEFAULT_BUFFER_SIZE (VDI_IMAGE_DEFAULT_BLOCK_SIZE) 570 #endif /* !VBOX_VDICORE_VD */ 515 571 516 572 /** VDIDISK Signature. */ … … 562 618 __BEGIN_DECLS 563 619 620 #ifndef VBOX_VDICORE_VD 564 621 VBOXDDU_DECL(void) vdiInitVDIDisk(PVDIDISK pDisk); 565 VBOXDDU_DECL(void) vdiFlushImage(PVDIIMAGEDESC pImage);622 VBOXDDU_DECL(void) VDIFlushImage(PVDIIMAGEDESC pImage); 566 623 VBOXDDU_DECL(int) vdiChangeImageMode(PVDIIMAGEDESC pImage, bool fReadOnly); 624 #endif /* !VBOX_VDICORE_VD */ 567 625 568 626 __END_DECLS
Note:
See TracChangeset
for help on using the changeset viewer.