]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/reserve.c
- Lots of documentation.
[bacula/bacula] / bacula / src / stored / reserve.c
index 132a3dab3f9d06497220280f9510925264bc6ddb..ebcb77c038f8a0cbd0dbeca2076b79c5a19aee0e 100644 (file)
@@ -202,7 +202,7 @@ void list_volumes(BSOCK *user)
 /* Create the Volume list */
 void create_volume_list()
 {
-   VOLRES *dummy;
+   VOLRES *dummy = NULL;
    if (vol_list == NULL) {
       vol_list = New(dlist(dummy, &dummy->link));
    }
@@ -223,15 +223,18 @@ void free_volume_list()
    vol_list = NULL;
 }
 
-bool is_volume_in_use(const char *VolumeName) 
+bool is_volume_in_use(DCR *dcr)
 {
-   VOLRES *vol = find_volume(VolumeName);
+   VOLRES *vol = find_volume(dcr->VolumeName);
    if (!vol) {
       return false;                   /* vol not in list */
    }
    if (!vol->dev) {                   /* vol not attached to device */
       return false;
    }
+   if (dcr->dev == vol->dev) {        /* same device OK */
+      return false;
+   }
    if (!vol->dev->is_busy()) {
       return false;
    }