]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/win32/filed/vss_generic.cpp
authorAlain Spineux <alain@baculasystems.com>
Wed, 5 Aug 2020 08:08:32 +0000 (10:08 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 1 Mar 2022 14:36:17 +0000 (15:36 +0100)
This commit is the result of the squash of the following main commits:

Author: Alain Spineux <alain@baculasystems.com>
Date:   Tue Aug 28 17:14:31 2018 +0200

    snapshot: maintain both paths instead of stripping and unstripping

    - snap_fname is the path inside the snapshot used for "system" operation
    - fname is the path from the FileSet used for display and for SD or DIR
      "computation"
    - when snapshot is not in used, both are equal

bacula/src/win32/filed/vss_generic.cpp

index c113a446ebf53c404476c8e0aa32d454f9ef6703..0cedb947f5a55306d00862e40a740a7d133e946f 100644 (file)
@@ -485,14 +485,15 @@ bool VSSClientGeneric::CreateSnapshots(alist *mount_points)
    for (int i=0; i < mount_points->size(); i++) {
       wchar_t *p = (wchar_t *)mount_points->get(i);
       // store uniquevolumname
-      if (SUCCEEDED(pVssObj->AddToSnapshotSet(p, GUID_NULL, &pid))) {
+      int hresult = pVssObj->AddToSnapshotSet(p, GUID_NULL, &pid);
+      if (SUCCEEDED(hresult)) {
          MTabEntry *elt = (MTabEntry*)m_VolumeList->entries->search(p, volume_cmp);
          ASSERT2(elt, "Should find the volume in the list");
          Jmsg(m_jcr, M_INFO, 0, "    Snapshot mount point: %ls\n", elt->first());
          Dmsg1(50, "AddToSnapshot OK for Vol: %ls\n", p);
       } else {
          //Dmsg1(50, "AddToSnapshot() failed for Vol: %ls\n", (LPWSTR)volume.c_str());
-         //Dmsg1(50, "AddToSnapshot() failed for path: %s\n", p);
+         Dmsg2(50, "AddToSnapshot() failed for path: %ls hresult=0x%x\n", p, hresult);
       }
    }