Quantcast
Channel: VMware Communities : Unanswered Discussions - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 872

How to dismount the volumes if the application crashes.

$
0
0

Hi,

 

I am opening a vmdk file and mounting the volumes by using the below code

 

    m_vixError = VixDiskLib_Open(
        m_vixDiskLibCon,
        fileName,
        VIXDISKLIB_FLAG_OPEN_UNBUFFERED,
        &m_vixDiskLibHandle);
  
    m_vixError = VixMntapi_OpenDiskSet(
        &m_vixDiskLibHandle,
        1,
        0,
        &m_vixDiskSetHandle);

 

    m_vixError = VixMntapi_GetVolumeHandles(
        m_vixDiskSetHandle,
        &m_numberOfVolumes,
        &m_vixVolumeHandle);

 

  
    for ( int i = 0; i < m_numberOfVolumes; i++ )
    {
        m_vixError = VixMntapi_MountVolume(m_vixVolumeHandle[i], FALSE);
    }

 

Doing some operation here.............


....... How to dismount the volumes and close the disk handles if the application CRASHEShere.......

 

Normally i'm using the below functions for unmounting the volumes and closing the disk handles

 

            VixMntapi_DismountVolume(m_vixVolumeHandle[i], TRUE);
            VixMntapi_FreeVolumeHandles(m_vixVolumeHandle);
            VixMntapi_CloseDiskSet(m_vixDiskSetHandle);
            VixDiskLib_Close(CVMDKFileRestore::vmdkVixDiskLibHandle.find(it->first)->second);

 

 

Thanks

Manickam


Viewing all articles
Browse latest Browse all 872

Trending Articles