void update_vol_pool(UAContext *ua, char *val, MEDIA_DBR *mr, POOL_DBR *opr)
{
POOL_DBR pr;
- POOLMEM *query;
+ POOL_MEM query(PM_MESSAGE);
char ed1[50], ed2[50];
memset(&pr, 0, sizeof(pr));
mr->PoolId = pr.PoolId; /* set new PoolId */
/*
*/
- query = get_pool_memory(PM_MESSAGE);
db_lock(ua->db);
Mmsg(query, "UPDATE Media SET PoolId=%s WHERE MediaId=%s",
- edit_int64(mr->PoolId, ed1),
- edit_int64(mr->MediaId, ed2));
- if (!db_sql_query(ua->db, query, NULL, NULL)) {
+ edit_int64(mr->PoolId, ed1), edit_int64(mr->MediaId, ed2));
+ if (!db_sql_query(ua->db, query.c_str(), NULL, NULL)) {
ua->error_msg("%s", db_strerror(ua->db));
} else {
ua->info_msg(_("New Pool is: %s\n"), pr.Name);
}
}
db_unlock(ua->db);
- free_pool_memory(query);
}
/* Modify the RecyclePool of a Volume */
void update_vol_recyclepool(UAContext *ua, char *val, MEDIA_DBR *mr)
{
POOL_DBR pr;
- POOLMEM *query;
+ POOL_MEM query(PM_MESSAGE);
char ed1[50], ed2[50];
memset(&pr, 0, sizeof(pr));
/* pool = select_pool_resource(ua); */
mr->RecyclePoolId = pr.PoolId; /* get the PoolId */
- query = get_pool_memory(PM_MESSAGE);
db_lock(ua->db);
Mmsg(query, "UPDATE Media SET RecyclePoolId=%s WHERE MediaId=%s",
- edit_int64(mr->RecyclePoolId, ed1),
- edit_int64(mr->MediaId, ed2));
- if (!db_sql_query(ua->db, query, NULL, NULL)) {
+ edit_int64(mr->RecyclePoolId, ed1), edit_int64(mr->MediaId, ed2));
+ if (!db_sql_query(ua->db, query.c_str(), NULL, NULL)) {
ua->error_msg("%s", db_strerror(ua->db));
} else {
ua->info_msg(_("New RecyclePool is: %s\n"), pr.Name);
}
db_unlock(ua->db);
- free_pool_memory(query);
}
/*
changer = get_pool_memory(PM_FNAME);
if (slot <= 0) {
- Jmsg(jcr, M_INFO, 0, _("Invalid slot=%d defined in catalog. Manual load my be required.\n"), slot);
+ Jmsg(jcr, M_INFO, 0, _("Invalid slot=%d defined in catalog for Volume \"%s\" "
+ "on %s. Manual load my be required.\n"), slot, dcr->VolCatInfo.VolCatName,
+ dev->print_name());
rtn_stat = 0;
} else if (!dcr->device->changer_name) {
- Jmsg(jcr, M_INFO, 0, _("No \"Changer Device\" manual load of Volume may be required.\n"));
+ Jmsg(jcr, M_INFO, 0, _("No \"Changer Device\" for %s. Manual load of Volume may be required.\n"),
+ dev->print_name());
rtn_stat = 0;
} else if (!dcr->device->changer_command) {
- Jmsg(jcr, M_INFO, 0, _("No \"Changer Command\" manual load of Volume may be requird.\n"));
+ Jmsg(jcr, M_INFO, 0, _("No \"Changer Command\" for %s. Manual load of Volume may be requird.\n"),
+ dev->print_name());
rtn_stat = 0;
} else {
/* Attempt to load the Volume */