Imported Upstream version 3.3.3
[debian/amanda] / server-src / driverio.c
index ddaaeda2f634843dc0ab58123aad61467dc199b0..8e41646bdc61a827295a86664d97e8d1c7288340 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
  * Copyright (c) 1991-1998 University of Maryland at College Park
+ * Copyright (c) 2007-2012 Zmanda, Inc.  All Rights Reserved.
  * All Rights Reserved.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -428,6 +429,12 @@ taper_cmd(
                            " ", datestamp,
                            "\n", NULL);
        break;
+    case CLOSE_VOLUME:
+       dp = (disk_t *) ptr;
+       cmdline = g_strjoin(NULL, cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
+                           "\n", NULL);
+       break;
     case FILE_WRITE:
        dp = (disk_t *) ptr;
         qname = quote_string(dp->name);
@@ -568,6 +575,7 @@ dumper_cmd(
     char *cmdline = NULL;
     char number[NUM_STR_SIZE];
     char numberport[NUM_STR_SIZE];
+    char maxwarnings[NUM_STR_SIZE];
     char *o, *oo;
     char *device;
     char *features;
@@ -594,6 +602,7 @@ dumper_cmd(
            char *qclient_username;
            char *qclient_port;
            char *qssh_keys;
+           char *d_prop;
 
            if (dp->application != NULL) {
                application = lookup_application(dp->application);
@@ -604,9 +613,15 @@ dumper_cmd(
            qname = quote_string(dp->name);
            g_snprintf(number, SIZEOF(number), "%d", sched(dp)->level);
            g_snprintf(numberport, SIZEOF(numberport), "%d", dumper->output_port);
+           g_snprintf(maxwarnings, SIZEOF(maxwarnings), "%d", dp->max_warnings);
            features = am_feature_to_string(dp->host->features);
            if (am_has_feature(dp->host->features, fe_req_xml)) {
                o = xml_optionstr(dp, 1);
+
+               d_prop = xml_dumptype_properties(dp);
+               vstrextend(&o, d_prop, NULL);
+               amfree(d_prop);
+
                if (application) {
                    char *xml_app;
                    xml_app = xml_application(dp, application,
@@ -652,6 +667,7 @@ dumper_cmd(
                            " ", dp->auth,
                            " ", data_path_to_string(dp->data_path),
                            " ", dp->dataport_list,
+                           " ", maxwarnings,
                            " |", o,
                            "\n", NULL);
            amfree(qplugin);
@@ -988,7 +1004,11 @@ update_info_dumper(
     infp->size = origsize;
     infp->csize = dumpsize;
     infp->secs = dumptime;
-    infp->date = get_time_from_timestamp(sched(dp)->datestamp);
+    if (sched(dp)->timestamp == 0) {
+       infp->date = 0;
+    } else {
+       infp->date = get_time_from_timestamp(sched(dp)->datestamp);
+    }
 
     if(level == 0) perfp = &info.full;
     else perfp = &info.incr;
@@ -1023,7 +1043,11 @@ update_info_dumper(
        info.history[0].level = level;
        info.history[0].size  = origsize;
        info.history[0].csize = dumpsize;
-       info.history[0].date  = get_time_from_timestamp(sched(dp)->datestamp);
+       if (sched(dp)->timestamp == 0) {
+           info.history[0].date = 0;
+       } else {
+           info.history[0].date = get_time_from_timestamp(sched(dp)->datestamp);
+       }
        info.history[0].secs  = dumptime;
     }