]> git.sur5r.net Git - bacula/bacula/commitdiff
first attempt at making bacula set the backup level in VSS
authorJames Harper <james.harper@bendigoit.com.au>
Thu, 6 May 2010 12:46:48 +0000 (14:46 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:53:48 +0000 (16:53 +0200)
bacula/src/win32/filed/vss_generic.cpp

index 8707f7f3d2ab931b1743809626317141e98dd3f7..1e21ff883d66546395a5c5d625390e3b7256b692 100644 (file)
@@ -38,6 +38,7 @@
 #ifdef WIN32_VSS
 
 #include "bacula.h"
+#include "jcr.h"
 
 #undef setlocale
 
@@ -233,6 +234,7 @@ VSSClientGeneric::~VSSClientGeneric()
 bool VSSClientGeneric::Initialize(DWORD dwContext, bool bDuringRestore, bool (*VssInitCallback)(JCR *, int))
 {
    CComPtr<IVssAsync>  pAsync1;
+   VSS_BACKUP_TYPE backup_type;
 
    if (!(p_CreateVssBackupComponents && p_VssFreeSnapshotProperties)) {
       Dmsg2(0, "VSSClientGeneric::Initialize: p_CreateVssBackupComponents = 0x%08X, p_VssFreeSnapshotProperties = 0x%08X\n", p_CreateVssBackupComponents, p_VssFreeSnapshotProperties);
@@ -312,7 +314,23 @@ bool VSSClientGeneric::Initialize(DWORD dwContext, bool bDuringRestore, bool (*V
       }
  
       // 2. SetBackupState
-      hr = ((IVssBackupComponents*) m_pVssObject)->SetBackupState(true, true, VSS_BT_FULL, false);
+      switch (m_jcr->getJobLevel())
+      {
+      case L_FULL:
+         backup_type = VSS_BT_FULL;
+         break;
+      case L_DIFFERENTIAL:
+         backup_type = VSS_BT_DIFFERENTIAL;
+         break;
+      case L_INCREMENTAL:
+         backup_type = VSS_BT_INCREMENTAL;
+         break;
+      default:
+         Dmsg1(0, "VSSClientGeneric::Initialize: unknown backup level %d\n", m_jcr->getJobLevel());
+         backup_type = VSS_BT_FULL;
+         break;
+      }
+      hr = ((IVssBackupComponents*) m_pVssObject)->SetBackupState(true, true, backup_type, false);
       if (FAILED(hr)) {
          Dmsg1(0, "VSSClientGeneric::Initialize: IVssBackupComponents->SetBackupState returned 0x%08X\n", hr);
          errno = b_errno_win32;