Changeset 2910 for box/trunk/bin


Ignore:
Timestamp:
14/04/2011 07:19:25 (14 months ago)
Author:
chris
Message:

Only initialise COM once, at bbackupd startup.

Reduce verbosity of some VSS messages.

Fix erroneous errro message when VSS iterator reaches end.

File:
1 edited

Legend:

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

    r2907 r2910  
    390390        } 
    391391 
     392#ifdef ENABLE_VSS 
     393        HRESULT result = CoInitialize(NULL); 
     394        if(result != S_OK) 
     395        { 
     396                BOX_ERROR("VSS: Failed to initialize COM: " <<  
     397                        GetMsgForHresult(result)); 
     398                return 1; 
     399        } 
     400#endif 
     401 
    392402        int returnCode; 
    393403 
     
    9901000#endif 
    9911001 
    992                 (*i)->mpDirectoryRecord->SyncDirectory( 
    993                         params, 
     1002                (*i)->mpDirectoryRecord->SyncDirectory(params, 
    9941003                        BackupProtocolClientListDirectory::RootDirectory, 
    9951004                        locationPath, std::string("/") + (*i)->mName); 
     
    11161125        std::map<char, VSS_ID> volumesIncluded; 
    11171126 
    1118         HRESULT result = CoInitialize(NULL); 
    1119         if(result != S_OK) 
    1120         { 
    1121                 BOX_ERROR("VSS: Failed to initialize COM: " <<  
    1122                         GetMsgForHresult(result)); 
    1123                 return; 
    1124         } 
    1125  
    1126         result = ::CreateVssBackupComponents(&mpVssBackupComponents); 
     1127        HRESULT result = ::CreateVssBackupComponents(&mpVssBackupComponents); 
    11271128        if(result != S_OK) 
    11281129        { 
     
    12381239                        } 
    12391240 
    1240                         BOX_INFO("VSS: writer " << iWriter << " component " <<  
     1241                        BOX_TRACE("VSS: writer " << iWriter << " component " <<  
    12411242                                iComponent << " info:"); 
    12421243                        switch(pComponentInfo->type) 
     
    12491250                        } 
    12501251 
    1251                         BOX_INFO("VSS: logical path: " <<  
     1252                        BOX_TRACE("VSS: logical path: " <<  
    12521253                                BstrToString(pComponentInfo->bstrLogicalPath)); 
    1253                         BOX_INFO("VSS: component name: " <<  
     1254                        BOX_TRACE("VSS: component name: " <<  
    12541255                                BstrToString(pComponentInfo->bstrComponentName)); 
    1255                         BOX_INFO("VSS: caption: " <<  
     1256                        BOX_TRACE("VSS: caption: " <<  
    12561257                                BstrToString(pComponentInfo->bstrCaption)); 
    1257                         BOX_INFO("VSS: restore metadata: " <<  
     1258                        BOX_TRACE("VSS: restore metadata: " <<  
    12581259                                pComponentInfo->bRestoreMetadata); 
    1259                         BOX_INFO("VSS: notify on complete: " <<  
     1260                        BOX_TRACE("VSS: notify on complete: " <<  
    12601261                                pComponentInfo->bRestoreMetadata); 
    1261                         BOX_INFO("VSS: selectable: " <<  
     1262                        BOX_TRACE("VSS: selectable: " <<  
    12621263                                pComponentInfo->bSelectable); 
    1263                         BOX_INFO("VSS: selectable for restore: " <<  
     1264                        BOX_TRACE("VSS: selectable for restore: " <<  
    12641265                                pComponentInfo->bSelectableForRestore); 
    1265                         BOX_INFO("VSS: component flags: " <<  
     1266                        BOX_TRACE("VSS: component flags: " <<  
    12661267                                BOX_FORMAT_HEX32(pComponentInfo->dwComponentFlags)); 
    1267                         BOX_INFO("VSS: file count: " <<  
     1268                        BOX_TRACE("VSS: file count: " <<  
    12681269                                pComponentInfo->cFileCount); 
    1269                         BOX_INFO("VSS: databases: " <<  
     1270                        BOX_TRACE("VSS: databases: " <<  
    12701271                                pComponentInfo->cDatabases); 
    1271                         BOX_INFO("VSS: log files: " <<  
     1272                        BOX_TRACE("VSS: log files: " <<  
    12721273                                pComponentInfo->cLogFiles); 
    1273                         BOX_INFO("VSS: dependencies: " <<  
     1274                        BOX_TRACE("VSS: dependencies: " <<  
    12741275                                pComponentInfo->cDependencies); 
    12751276 
     
    14331434                } 
    14341435 
    1435                 BOX_INFO("VSS: Writer " << iWriter << " (" << 
     1436                BOX_TRACE("VSS: Writer " << iWriter << " (" << 
    14361437                        writerName << ") is in state " << stateName); 
    14371438        } 
     
    15041505                result = pEnum->Next(1, &rgelt, &count); 
    15051506 
    1506                 if(result != S_OK && result != S_FALSE) 
     1507                if(result == S_FALSE) 
     1508                { 
     1509                        // end of list, break out of the loop 
     1510                        break; 
     1511                } 
     1512                else if(result != S_OK) 
    15071513                { 
    15081514                        BOX_ERROR("VSS: Failed to enumerate snapshot: " <<  
Note: See TracChangeset for help on using the changeset viewer.