summaryrefslogtreecommitdiff
path: root/include/VBox/vd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/VBox/vd.h')
-rw-r--r--include/VBox/vd.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/include/VBox/vd.h b/include/VBox/vd.h
index 86589bbf..ba0768eb 100644
--- a/include/VBox/vd.h
+++ b/include/VBox/vd.h
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -151,14 +151,14 @@ typedef struct VBOXHDDRAWPARTDESC
} VBOXHDDRAWPARTDESC, *PVBOXHDDRAWPARTDESC;
/**
- * Auxiliary data structure for difference between GPT and MBR
- * disks.
+ * Auxiliary data structure for difference between GPT and MBR
+ * disks.
*/
-enum PARTITIONING_TYPE
+typedef enum VBOXHDDPARTTYPE
{
MBR,
GPT
-};
+} VBOXHDDPARTTYPE;
/**
* Auxiliary data structure for creating raw disks.
@@ -178,8 +178,8 @@ typedef struct VBOXHDDRAW
unsigned cPartDescs;
/** Pointer to the partition descriptor array. */
PVBOXHDDRAWPARTDESC pPartDescs;
- /**partitioning type of the disk */
- PARTITIONING_TYPE uPartitioningType;
+ /** Partitioning type of the disk */
+ VBOXHDDPARTTYPE uPartitioningType;
} VBOXHDDRAW, *PVBOXHDDRAW;
@@ -230,8 +230,14 @@ typedef struct VBOXHDDRAW
* sector at a time is the safest solution.
*/
#define VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS RT_BIT(9)
+/**
+ * Don't do unnecessary consistency checks when opening the image.
+ * Only valid when the image is opened in readonly because inconsistencies
+ * can lead to corrupted images in read-write mode.
+ */
+#define VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS RT_BIT(10)
/** Mask of valid flags. */
-#define VD_OPEN_FLAGS_MASK (VD_OPEN_FLAGS_NORMAL | VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_HONOR_ZEROES | VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_ASYNC_IO | VD_OPEN_FLAGS_SHAREABLE | VD_OPEN_FLAGS_SEQUENTIAL | VD_OPEN_FLAGS_DISCARD | VD_OPEN_FLAGS_IGNORE_FLUSH | VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS)
+#define VD_OPEN_FLAGS_MASK (VD_OPEN_FLAGS_NORMAL | VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_HONOR_ZEROES | VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_ASYNC_IO | VD_OPEN_FLAGS_SHAREABLE | VD_OPEN_FLAGS_SEQUENTIAL | VD_OPEN_FLAGS_DISCARD | VD_OPEN_FLAGS_IGNORE_FLUSH | VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS | VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS)
/** @}*/
/**
@@ -789,7 +795,9 @@ VBOXDDU_DECL(int) VDCompact(PVBOXHDD pDisk, unsigned nImage,
PVDINTERFACE pVDIfsOperation);
/**
- * Resizes the given disk image to the given size.
+ * Resizes the given disk image to the given size. It is OK if there are
+ * multiple images open in the container. In this case the last disk image
+ * will be resized.
*
* @return VBox status
* @return VERR_VD_IMAGE_READ_ONLY if image is not writable.
@@ -892,6 +900,16 @@ VBOXDDU_DECL(unsigned) VDGetCount(PVBOXHDD pDisk);
VBOXDDU_DECL(bool) VDIsReadOnly(PVBOXHDD pDisk);
/**
+ * Get sector size of an image in HDD container.
+ *
+ * @return Virtual disk sector size in bytes.
+ * @return 0 if image with specified number was not opened.
+ * @param pDisk Pointer to HDD container.
+ * @param nImage Image number, counts from 0. 0 is always base image of container.
+ */
+VBOXDDU_DECL(uint32_t) VDGetSectorSize(PVBOXHDD pDisk, unsigned nImage);
+
+/**
* Get total capacity of an image in HDD container.
*
* @return Virtual disk size in bytes.
@@ -1239,7 +1257,8 @@ VBOXDDU_DECL(int) VDRepair(PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
* @return VBox status code.
* @param pDisk Pointer to HDD container.
* @param fFlags Combination of the VD_VFSFILE_* flags.
- * @param phVfsFile Where to stoer the handle to the VFS file on success.
+ * @param phVfsFile Where to store the handle to the VFS file on
+ * success.
*/
VBOXDDU_DECL(int) VDCreateVfsFileFromDisk(PVBOXHDD pDisk, uint32_t fFlags,
PRTVFSFILE phVfsFile);