18.08.2013 Views

Virtual Disk API Programming Guide - Documentation - VMware

Virtual Disk API Programming Guide - Documentation - VMware

Virtual Disk API Programming Guide - Documentation - VMware

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Virtual</strong> <strong>Disk</strong> <strong>Programming</strong> <strong>Guide</strong><br />

<strong>Disk</strong> Volume Information<br />

The VixVolumeInfo structure encapsulates the following information:<br />

Type of the volume, VixVolumeType, one of the following:<br />

Basic partition.<br />

GPT – GUID Partition Table. However, VixMntapi does not support GPT partitions.<br />

Dynamic volume, including Logical <strong>Disk</strong> Manager (LDM).<br />

LVM – Logical Volume Manager disk storage.<br />

Whether the guest volume is mounted on the proxy.<br />

Path to the volume mount point on the proxy, or NULL if the volume is not mounted.<br />

On Windows, numGuestMountPoints is the number of times a basic volume is mapped to a drive letter,<br />

or 0 if the volume is not mounted. IDE and boot disk come first. Unimplemented on Linux.<br />

Mount points for the volume in the guest.<br />

Function Calls<br />

To obtain these functions, load the vixMntapi library separately from the vix<strong>Disk</strong>Lib library. On Windows,<br />

compile with the vixMntapi.lib library so your program can load the vixMntapi.dll runtime.<br />

These calls can be used to mount and read Windows virtual disks on Windows hosts (with at least one NTFS<br />

volume) or Linux virtual disks on Linux hosts. Cross‐mounting is restricted, though it is possible to mount a<br />

virtual disk with a mix of formats, if the mounted partition was formatted with Windows.<br />

IMPORTANT You should run only one vixMntapi program at a time on a virtual machine, to avoid conflict<br />

between registry hives. See “Multithreading Considerations” on page 41 for advice on worker threads.<br />

The remainder of this section lists the available function calls in the vixMntapi library. Under parameters, [in]<br />

indicates input parameters, and [out] indicates output parameters. All functions that return vixError return<br />

VIX_OK on success, otherwise a suitable VIX error code.<br />

VixMntapi_Init()<br />

Initializes the library. Similar to Vix<strong>Disk</strong>Lib_InitEx – see “Initialize <strong>Virtual</strong> <strong>Disk</strong> <strong>API</strong>” on page 35.<br />

VixError<br />

VixMntapi_Init(uint32 majorVersion,<br />

uint32 minorVersion,<br />

Vix<strong>Disk</strong>LibGenericLogFunc *log,<br />

Vix<strong>Disk</strong>LibGenericLogFunc *warn,<br />

Vix<strong>Disk</strong>LibGenericLogFunc *panic,<br />

const char *libDir,<br />

const char *configFile);<br />

Parameters:<br />

majorVersion [in] VixMntapi major version number, currently must be 1 (one).<br />

minorVersion [in] VixMntapi minor version number, currently must be 0 (zero).<br />

log [in] Callback function to write log messages.<br />

warn [in] Callback function to write warning messages.<br />

panic [in] Callback function to report fatal errors.<br />

libDir [in] and configFile [in] as for Vix<strong>Disk</strong>Lib_InitEx(), allowing you to tmpDirectory.<br />

VixMntapi_Exit()<br />

Cleans up the VixMntapi library.<br />

void VixMntapi_Exit();<br />

88 <strong>VMware</strong>, Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!