]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/msgchan.c
ebl Modify disk-changer to check if slot contains something before
[bacula/bacula] / bacula / src / dird / msgchan.c
index bca443577f536ad30bec94bf3a2a2e20af19a08e..c1d5280ea25bef72b7e3d03e0f40763bb0e7ae6b 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -51,7 +51,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 /* Commands sent to Storage daemon */
 static char jobcmd[]     = "JobId=%s job=%s job_name=%s client_name=%s "
    "type=%d level=%d FileSet=%s NoAttr=%d SpoolAttr=%d FileSetMD5=%s "
-   "SpoolData=%d SpoolSize=%s WritePartAfterJob=%d PreferMountedVols=%d\n";
+   "SpoolData=%d WritePartAfterJob=%d PreferMountedVols=%d SpoolSize=%s\n";
 static char use_storage[] = "use storage=%s media_type=%s pool_name=%s "
    "pool_type=%s append=%d copy=%d stripe=%d\n";
 static char use_device[] = "use device=%s\n";
@@ -187,8 +187,8 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore)
              jcr->JobType, jcr->JobLevel,
              fileset_name.c_str(), !jcr->pool->catalog_files,
              jcr->job->SpoolAttributes, jcr->fileset->MD5, jcr->spool_data, 
-             edit_int64(jcr->spool_size, ed2), jcr->write_part_after_job,
-             jcr->job->PreferMountedVolumes);
+             jcr->write_part_after_job, jcr->job->PreferMountedVolumes,
+             edit_int64(jcr->spool_size, ed2));
    Dmsg1(100, ">stored: %s\n", sd->msg);
    if (bget_dirmsg(sd) > 0) {
        Dmsg1(100, "<stored: %s", sd->msg);
@@ -218,8 +218,8 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore)
     */
    /* Do read side of storage daemon */
    if (ok && rstore) {
-      /* For the moment, only migrate has rpool */
-      if (jcr->JobType == JT_MIGRATE) {
+      /* For the moment, only migrate and copy have rpool */
+      if (jcr->JobType == JT_MIGRATE || jcr->JobType == JT_COPY) {
          pm_strcpy(pool_type, jcr->rpool->pool_type);
          pm_strcpy(pool_name, jcr->rpool->name());
       } else {
@@ -364,6 +364,7 @@ extern "C" void *msg_thread(void *arg)
    int stat;
 
    pthread_detach(pthread_self());
+   set_jcr_in_tsd(jcr);
    jcr->SD_msg_chan = pthread_self();
    pthread_cleanup_push(msg_thread_cleanup, arg);
    sd = jcr->store_bsock;