]> git.sur5r.net Git - bacula/bacula/commitdiff
Allow plugins to add drives to vss snapshot
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 23 Nov 2010 21:27:42 +0000 (22:27 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Nov 2010 14:09:57 +0000 (15:09 +0100)
bacula/src/filed/fd_plugins.h
bacula/src/filed/job.c
bacula/src/findlib/find.c

index f851ca4e1b5b171c1d6214e1504ad94635b57587..acf3511302dbe400fb17a3e41527480d2c9d4d17 100644 (file)
@@ -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 {
index e81f608342c3203ca1079fa4f0d21b4e3cdb9e32..d5f4866db25b8d204535df8d85a3d4f8214dad75 100644 (file)
@@ -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)) {               
index 291fd050ecb2f111990d0ee6253885cd31f8f125..3c60f95219e9b06cecb8cba670ddb02f3581019e 100644 (file)
@@ -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;