]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
bscan: initialize the volume type using the device type
authorAlain Spineux <alain@baculasystems.com>
Mon, 28 Nov 2022 09:20:23 +0000 (10:20 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
- bscan was initializing this value to ZERO and this was working as
  expected because we include ZERO in our SQL query, like in :
  AND VolType IN (0,%d)", mr->VolType)
- I have tested this with File (1) and Dedup (15) devices

bacula/src/stored/bscan.c

index ba68c6339b972838283bfd8800752ebfafdb8f92..5ee839bada9fbed78acd696c9fdb9eec13660614 100644 (file)
@@ -506,6 +506,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
          bstrncpy(mr.VolumeName, dev->VolHdr.VolumeName, sizeof(mr.VolumeName));
          mr.PoolId = pr.PoolId;
          mr.VolEncrypted = !!(dev->VolHdr.blkh_options & BLKHOPT_ENCRYPT_VOL);
+         mr.VolType = dev->dev_type;
          num_media++;
          if (db_get_media_record(bjcr, db, &mr)) {
             if (verbose) {