]> git.sur5r.net Git - bacula/bacula/commitdiff
Add bEventVssBeforeCloseRestore per James
authorKern Sibbald <kern@sibbald.com>
Mon, 12 Jul 2010 07:59:31 +0000 (09:59 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 12 Nov 2010 08:19:56 +0000 (09:19 +0100)
bacula/src/filed/fd_plugins.h
bacula/src/filed/job.c

index 059636e05d6bb0cf40243c6d6ee19bcda30e5e5a..65d9ce430b89c388fc1aade5a5cb4920376dbae2 100644 (file)
@@ -195,13 +195,14 @@ typedef enum {
   bEventRestoreCommand                  = 10,
   bEventLevel                           = 11,
   bEventSince                           = 12,
-  bEventCancelCommand                   = 13, /* Executed by an other thread */
+  bEventCancelCommand                   = 13, /* Executed by another thread */
   bEventVssBackupAddComponents          = 14,
   bEventVssRestoreLoadComponentMetadata = 15,
   bEventVssRestoreSetComponentsSelected = 16,
   bEventRestoreObject                   = 17,
   bEventEndFileSet                      = 18,
-  bEventPluginCommand                   = 19  /* Sent during FileSet creation */
+  bEventPluginCommand                   = 19, /* Sent during FileSet creation */
+  bEventVssBeforeCloseRestore           = 20
 } bEventType;
 
 typedef struct s_bEvent {
index 13e09472f7200d9f3627b6a4473a18a95abdd259..2fb991256f7e7045afe7e7d836fab3e473236af8 100644 (file)
@@ -2154,11 +2154,12 @@ static int restore_cmd(JCR *jcr)
 #if defined(WIN32_VSS)
    /* STOP VSS ON WIN32 */
    /* tell vss to close the restore session */
-   Dmsg0(0, "About to call CloseRestore\n");
+   Dmsg0(100, "About to call CloseRestore\n");
    if (jcr->VSS) {
-      Dmsg0(0, "Really about to call CloseRestore\n");
+      generate_plugin_event(jcr, bEventVssBeforeCloseRestore);
+      Dmsg0(100, "Really about to call CloseRestore\n");
       if (g_pVSSClient->CloseRestore()) {
-         Dmsg0(0, "CloseRestore success\n");
+         Dmsg0(100, "CloseRestore success\n");
          /* inform user about writer states */
          for (int i=0; i<(int)g_pVSSClient->GetWriterCount(); i++) {
             int msg_type = M_INFO;
@@ -2170,7 +2171,7 @@ static int restore_cmd(JCR *jcr)
          }
       }
       else
-         Dmsg1(0, "CloseRestore fail - %08x\n", errno);
+         Dmsg1(100, "CloseRestore fail - %08x\n", errno);
       V(vss_mutex);
    }
 #endif