From 391c695c2f9070805e88f35f2c03e88df3a3ecdb Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 12 Jul 2010 09:59:31 +0200 Subject: [PATCH] Add bEventVssBeforeCloseRestore per James --- bacula/src/filed/fd_plugins.h | 5 +++-- bacula/src/filed/job.c | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bacula/src/filed/fd_plugins.h b/bacula/src/filed/fd_plugins.h index 059636e05d..65d9ce430b 100644 --- a/bacula/src/filed/fd_plugins.h +++ b/bacula/src/filed/fd_plugins.h @@ -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 { diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 13e09472f7..2fb991256f 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -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 -- 2.39.5