]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_cmds.c
Minor runscript tweaks
[bacula/bacula] / bacula / src / dird / ua_cmds.c
index 5acc952c34a14dbc6b1c4459dafc78f893dfa7ba..4c402fece0a803f4a892cd03a2898596dc42e378 100644 (file)
@@ -1424,10 +1424,10 @@ static void do_mount_cmd(UAContext *ua, const char *command)
    Dmsg2(120, "%s: %s\n", command, ua->UA_sock->msg);
 
    store.store = get_storage_resource(ua, true/*arg is storage*/);
-   pm_strcpy(store.store_source, _("unknown source"));
    if (!store.store) {
       return;
    }
+   pm_strcpy(store.store_source, _("unknown source"));
    set_wstorage(jcr, &store);
    drive = get_storage_drive(ua, store.store);
    if (strcmp(command, "mount") == 0) {
@@ -1695,12 +1695,32 @@ int qhelp_cmd(UAContext *ua, const char *cmd)
    return 1;
 }
 
+#if 1 
 static int version_cmd(UAContext *ua, const char *cmd)
 {
    ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE,
             HOST_OS, DISTNAME, DISTVER);
    return 1;
 }
+#else
+/*
+ *  Test code -- turned on only for debug testing 
+ */
+static int version_cmd(UAContext *ua, const char *cmd)
+{
+   dbid_list ids;
+   POOL_MEM query(PM_MESSAGE);
+   open_db(ua);
+   Mmsg(query, "select MediaId from Media,Pool where Pool.PoolId=Media.PoolId and Pool.Name='Full'");
+   db_get_query_dbids(ua->jcr, ua->db, query, ids);
+   ua->send_msg("num_ids=%d max_ids=%d tot_ids=%d\n", ids.num_ids, ids.max_ids, ids.tot_ids);
+   for (int i=0; i < ids.num_ids; i++) {
+      ua->send_msg("id=%d\n", ids.DBId[i]);
+   }
+   close_db(ua);
+   return 1;
+}
+#endif
 
 /* 
  * This call explicitly checks for a catalog=xxx and