]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/msgchan.c
Minor tweaks to Migration
[bacula/bacula] / bacula / src / dird / msgchan.c
index 5e0124975bb48fe6318190608388cddc09a07329..c19b505282a3240bdc864040cba5dd19c0860544 100644 (file)
@@ -69,7 +69,13 @@ bool connect_to_storage_daemon(JCR *jcr, int retry_interval,
    if (jcr->store_bsock) {
       return true;                    /* already connected */
    }
-   store = (STORE *)jcr->storage->first();
+
+   /* If there is a write storage use it */
+   if (jcr->wstorage) {
+      store = (STORE *)jcr->wstorage->first();
+   } else {
+      store = (STORE *)jcr->rstorage->first();
+   }
 
    /*
     *  Open message channel with the Storage daemon