if (vol->dcr == dcr && (vol->dev == NULL ||
strcmp(vol->vol_name, vol->dev->VolHdr.VolumeName) != 0)) {
vol_list->remove(vol);
- Dmsg1(100, "free_unused_olume %s\n", vol->vol_name);
+ Dmsg1(100, "free_unused_volume %s\n", vol->vol_name);
free(vol->vol_name);
free(vol);
break;
/*
* List Volumes -- this should be moved to status.c
*/
-void list_volumes(BSOCK *user)
+void list_volumes(void sendit(const char *msg, int len, void *sarg), void *arg)
{
VOLRES *vol;
+ char *msg;
+ int len;
+
+ msg = (char *)get_pool_memory(PM_MESSAGE);
+
P(vol_list_lock);
for (vol=(VOLRES *)vol_list->first(); vol; vol=(VOLRES *)vol_list->next(vol)) {
if (vol->dev) {
- bnet_fsend(user, "%s on device %s\n", vol->vol_name, vol->dev->print_name());
+ len = Mmsg(msg, "%s on device %s\n", vol->vol_name, vol->dev->print_name());
+ sendit(msg, len, arg);
} else {
- bnet_fsend(user, "%s\n", vol->vol_name);
+ len = Mmsg(msg, "%s\n", vol->vol_name);
+ sendit(msg, len, arg);
}
}
V(vol_list_lock);
+
+ free_pool_memory(msg);
}
/* Create the Volume list */
/* Check for prefer mounted volumes */
if (rctx.PreferMountedVols && !dev->VolHdr.VolumeName[0] && dev->is_tape()) {
- Mmsg(jcr->errmsg, _("3606 JobId=%u wants mounted, but drive %s has no Volume.\n"),
+ Mmsg(jcr->errmsg, _("3606 JobId=%u prefers mounted drives, but drive %s has no Volume.\n"),
jcr->JobId, dev->print_name());
queue_reserve_message(jcr);
Dmsg1(110, "failed: want mounted -- no vol JobId=%u\n", jcr->JobId);
return 1;
} else {
/* Drive Pool not suitable for us */
- Mmsg(jcr->errmsg, _("3609 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n"),
+ Mmsg(jcr->errmsg, _("3609 JobId=%u wants Pool=\"%s\" but has Pool=\"%s\" on drive %s.\n"),
jcr->JobId, dcr->pool_name, dev->pool_name, dev->print_name());
queue_reserve_message(jcr);
Dmsg2(110, "failed: busy num_writers>0, can_append, pool=%s wanted=%s\n",
/*
* Send any reservation messages queued for this jcr
*/
-void send_drive_reserve_messages(JCR *jcr, BSOCK *user)
+void send_drive_reserve_messages(JCR *jcr, void sendit(const char *msg, int len, void *sarg), void *arg)
{
int i;
alist *msgs;
for (i=msgs->size()-1; i >= 0; i--) {
msg = (char *)msgs->get(i);
if (msg) {
- bnet_fsend(user, " %s", msg);
+ sendit(" ", 3, arg);
+ sendit(msg, strlen(msg), arg);
} else {
break;
}