Changeset 2907 for box/trunk/bin


Ignore:
Timestamp:
09/04/2011 21:12:55 (14 months ago)
Author:
chris
Message:

Actually try to back up from the VSS snapshot volume.

Clean up VSS resources at end of backup.

Location:
box/trunk/bin/bbackupd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupd/BackupDaemon.cpp

    r2906 r2907  
    982982 
    983983                // Sync the directory 
     984                std::string locationPath = (*i)->mPath; 
     985#ifdef ENABLE_VSS 
     986                if((*i)->mIsSnapshotCreated) 
     987                { 
     988                        locationPath = (*i)->mSnapshotPath; 
     989                } 
     990#endif 
     991 
    984992                (*i)->mpDirectoryRecord->SyncDirectory( 
    985993                        params, 
    986994                        BackupProtocolClientListDirectory::RootDirectory, 
    987                         (*i)->mPath, std::string("/") + (*i)->mName); 
     995                        locationPath, std::string("/") + (*i)->mName); 
    988996 
    989997                // Unset exclude lists (just in case) 
     
    9981006        // Close any open connection 
    9991007        clientContext.CloseAnyOpenConnection(); 
    1000          
     1008 
     1009#ifdef ENABLE_VSS 
     1010        CleanupVssBackupComponents(); 
     1011#endif 
     1012 
    10011013        // Get the new store marker 
    10021014        mClientStoreMarker = clientContext.GetClientStoreMarker(); 
     
    11341146 
    11351147                BOX_ERROR("VSS: Failed to initialize for backup: " << message); 
    1136                 goto CreateVssBackupComponents_cleanup_mpVssBackupComponents; 
     1148                return; 
    11371149        } 
    11381150 
     
    11471159                BOX_ERROR("VSS: Failed to set context to VSS_CTX_BACKUP: " << 
    11481160                        GetMsgForHresult(result)); 
    1149                 goto CreateVssBackupComponents_cleanup_mpVssBackupComponents; 
     1161                return; 
    11501162        } 
    11511163 
     
    11591171                BOX_ERROR("VSS: Failed to set backup state: " << 
    11601172                        GetMsgForHresult(result)); 
    1161                 goto CreateVssBackupComponents_cleanup_mpVssBackupComponents; 
     1173                return; 
    11621174        } 
    11631175 
     
    11881200                        BOX_ERROR("Failed to get VSS metadata from writer " << iWriter << 
    11891201                                ": " << GetMsgForHresult(result)); 
    1190                         goto CreateVssBackupComponents_cleanup_WriterMetadata; 
     1202                        continue; 
    11911203                } 
    11921204 
     
    12001212                                GetMsgForHresult(result)); 
    12011213                        pMetadata->Release(); 
    1202                         goto CreateVssBackupComponents_cleanup_mpVssBackupComponents; 
     1214                        continue; 
    12031215                } 
    12041216 
     
    15831595                        GetMsgForHresult(result)); 
    15841596        } 
    1585  
    1586 CreateVssBackupComponents_cleanup_mpVssBackupComponents: 
     1597} 
     1598 
     1599void BackupDaemon::CleanupVssBackupComponents() 
     1600{ 
     1601        if(mpVssBackupComponents == NULL) 
     1602        { 
     1603                return; 
     1604        } 
     1605 
     1606        CallAndWaitForAsync(&IVssBackupComponents::BackupComplete, 
     1607                "BackupComplete()"); 
     1608 
    15871609        mpVssBackupComponents->Release(); 
    15881610        mpVssBackupComponents = NULL; 
    1589         return; 
    15901611} 
    15911612#endif 
  • box/trunk/bin/bbackupd/BackupDaemon.h

    r2906 r2907  
    544544        bool CallAndWaitForAsync(AsyncMethod method, 
    545545                const std::string& description); 
     546        void CleanupVssBackupComponents(); 
    546547#endif 
    547548}; 
Note: See TracChangeset for help on using the changeset viewer.