From: Eric Bollengier Date: Tue, 23 Nov 2010 21:27:42 +0000 (+0100) Subject: Allow plugins to add drives to vss snapshot X-Git-Tag: Release-5.2.1~884 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=57de5d673f2d3f169a73b60b7f5445e2a8cfa967;p=bacula%2Fbacula Allow plugins to add drives to vss snapshot --- diff --git a/bacula/src/filed/fd_plugins.h b/bacula/src/filed/fd_plugins.h index f851ca4e1b..acf3511302 100644 --- a/bacula/src/filed/fd_plugins.h +++ b/bacula/src/filed/fd_plugins.h @@ -204,7 +204,8 @@ typedef enum { bEventRestoreObject = 17, bEventEndFileSet = 18, bEventPluginCommand = 19, /* Sent during FileSet creation */ - bEventVssBeforeCloseRestore = 20 + bEventVssBeforeCloseRestore = 20, + bEventVssAddSnapshotLetters = 21 /* Can add drives to vss snap */ } bEventType; typedef struct s_bEvent { diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index e81f608342..d5f4866db2 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1818,7 +1818,9 @@ static int backup_cmd(JCR *jcr) if (g_pVSSClient->InitializeForBackup(jcr)) { generate_plugin_event(jcr, bEventVssBackupAddComponents); /* tell vss which drives to snapshot */ - char szWinDriveLetters[27]; + char szWinDriveLetters[27]; + *szWinDriveLetters=0; + generate_plugin_event(jcr, bEventVssSnapshotLetters, szWinDriveLetters); if (get_win32_driveletters(jcr->ff, szWinDriveLetters)) { Jmsg(jcr, M_INFO, 0, _("Generate VSS snapshots. Driver=\"%s\", Drive(s)=\"%s\"\n"), g_pVSSClient->GetDriverName(), szWinDriveLetters); if (!g_pVSSClient->CreateSnapshots(szWinDriveLetters)) { diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c index 291fd050ec..3c60f95219 100644 --- a/bacula/src/findlib/find.c +++ b/bacula/src/findlib/find.c @@ -121,10 +121,14 @@ get_win32_driveletters(FF_PKT *ff, char* szDrives) #if !defined(HAVE_WIN32) return 0; #endif + int nCount; + /* Can be already filled by plugin, so check that everything + * is on upper case. TODO: can check for dupplicate? + */ + for (nCount = 0; nCount < 27 && szDrives[nCount] ; nCount++) { + szDrives[nCount] = toupper(szDrives[nCount]); + } - szDrives[0] = 0; /* make empty */ - int nCount = 0; - findFILESET *fileset = ff->fileset; if (fileset) { int i;