+ ua->info_msg(_("All Volume defaults updated from \"%s\" Pool record.\n"),
+ pr.Name);
+ }
+}
+
+static void update_all_vols(UAContext *ua)
+{
+ int i, num_pools;
+ uint32_t *ids;
+ POOL_DBR pr;
+ MEDIA_DBR mr;
+
+ memset(&pr, 0, sizeof(pr));
+ memset(&mr, 0, sizeof(mr));
+
+ if (!db_get_pool_ids(ua->jcr, ua->db, &num_pools, &ids)) {
+ ua->error_msg(_("Error obtaining pool ids. ERR=%s\n"), db_strerror(ua->db));
+ return;
+ }
+
+ for (i=0; i<num_pools; i++) {
+ pr.PoolId = ids[i];
+ if (!db_get_pool_record(ua->jcr, ua->db, &pr)) { /* ***FIXME*** use acl? */
+ ua->warning_msg(_("Updating all pools, but skipped PoolId=%d. ERR=%s\n"), db_strerror(ua->db));
+ continue;
+ }
+
+ set_pool_dbr_defaults_in_media_dbr(&mr, &pr);
+ mr.PoolId = pr.PoolId;
+
+ if (!db_update_media_defaults(ua->jcr, ua->db, &mr)) {
+ ua->error_msg(_("Error updating Volume records: ERR=%s"), db_strerror(ua->db));
+ } else {
+ ua->info_msg(_("All Volume defaults updated from \"%s\" Pool record.\n"),
+ pr.Name);
+ }