2 This patch fixes an error when reading (restore, migration, Vbackup) and
3 SD acquire.c must switch drives. The error message complained of a NULL
6 Apply this patch to version 2.4.2 with:
9 patch -p0 <2.4.2-null-vol.patch
10 ./configure <your-options>
16 Index: src/stored/acquire.c
17 ===================================================================
18 --- src/stored/acquire.c (revision 7500)
19 +++ src/stored/acquire.c (working copy)
24 - Jmsg3(jcr, M_INFO, 0, _("Changing device. Want Media Type=\"%s\" have=\"%s\"\n"
25 + Jmsg3(jcr, M_INFO, 0, _("Changing read device. Want Media Type=\"%s\" have=\"%s\"\n"
27 dcr->media_type, dev->device->media_type, dev->print_name());
28 - Dmsg3(50, "Changing device. Want Media Type=\"%s\" have=\"%s\"\n"
29 + Dmsg3(50, "Changing read device. Want Media Type=\"%s\" have=\"%s\"\n"
31 dcr->media_type, dev->device->media_type, dev->print_name());
34 dev = dcr->dev; /* get new device pointer */
35 dev->dblock(BST_DOING_ACQUIRE);
36 dcr->VolumeName[0] = 0;
37 - Jmsg(jcr, M_INFO, 0, _("Media Type change. New device %s chosen.\n"),
38 + Jmsg(jcr, M_INFO, 0, _("Media Type change. New read device %s chosen.\n"),
40 - Dmsg1(50, "Media Type change. New device %s chosen.\n", dev->print_name());
41 + Dmsg1(50, "Media Type change. New read device %s chosen.\n", dev->print_name());
43 bstrncpy(dcr->VolumeName, vol->VolumeName, sizeof(dcr->VolumeName));
44 bstrncpy(dcr->VolCatInfo.VolCatName, vol->VolumeName, sizeof(dcr->VolCatInfo.VolCatName));
46 dcr->clear_reserved();
48 if (dev->can_read()) {
49 + VOLUME_CAT_INFO *vol = &dev->VolCatInfo;
50 dev->clear_read(); /* clear read bit */
51 - Dmsg0(100, "dir_update_vol_info. Release0\n");
52 - dir_update_volume_info(dcr, false, false); /* send Volume info to Director */
55 + Dmsg2(000, "dir_update_vol_info. label=%d Vol=%s\n",
56 + dev->is_labeled(), vol->VolCatName);
57 + if (dev->is_labeled() && vol->VolCatName[0] != 0) {
58 + dir_update_volume_info(dcr, false, false); /* send Volume info to Director */
61 } else if (dev->num_writers > 0) {
63 * Note if WEOT is set, we are at the end of the tape