From: Kern Sibbald Date: Sun, 18 Jul 2004 18:57:50 +0000 (+0000) Subject: Implement new attached_dcrs code X-Git-Tag: Release-1.35.1~51 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=accc6e11cca5d6d4fd808a2b47de2b2218907bda;p=bacula%2Fbacula Implement new attached_dcrs code git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1483 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index e1fe5acfab..147137deae 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -214,7 +214,7 @@ default_path: dev->state &= ~ST_APPEND; /* clear any previous append mode */ dev->state |= ST_READ; /* set read mode */ - attach_jcr_to_device(dev, jcr); /* attach jcr to device */ +// attach_jcr_to_device(dev, jcr); /* attach jcr to device */ set_jcr_job_status(jcr, JS_Running); dir_send_job_status(jcr); Jmsg(jcr, M_INFO, 0, _("Ready to read from volume \"%s\" on device %s.\n"), @@ -344,7 +344,7 @@ DCR *acquire_device_for_append(JCR *jcr) if (jcr->NumVolumes == 0) { jcr->NumVolumes = 1; } - attach_jcr_to_device(dev, jcr); /* attach jcr to device */ +// attach_jcr_to_device(dev, jcr); /* attach jcr to device */ set_jcr_job_status(jcr, JS_Running); dir_send_job_status(jcr); goto ok_out; @@ -411,7 +411,7 @@ bool release_device(JCR *jcr) Jmsg2(jcr, M_ERROR, 0, _("BAD ERROR: release_device %s, Volume \"%s\" not in use.\n"), dev_name(dev), NPRT(jcr->VolumeName)); } - detach_jcr_from_device(dev, jcr); +// detach_jcr_from_device(dev, jcr); if (dev->prev && !dev_state(dev, ST_READ) && !dev->num_writers) { P(mutex); unlock_device(dev); diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 91b6a55466..0c8f24d440 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -326,7 +326,6 @@ bool write_block_to_device(DCR *dcr, DEV_BLOCK *block) DEVICE *dev = dcr->dev; JCR *jcr = dcr->jcr; - if (dcr->spooling) { stat = write_block_to_spool_file(dcr, block); return stat; @@ -503,12 +502,26 @@ bool write_block_to_dev(DCR *dcr, DEV_BLOCK *block) * Walk through all attached jcrs indicating the file has changed */ Dmsg1(100, "Walk attached jcrs. Volume=%s\n", dev->VolCatInfo.VolCatName); +#ifdef xxx for (JCR *mjcr=NULL; (mjcr=next_attached_jcr(dev, mjcr)); ) { if (mjcr->JobId == 0) { continue; /* ignore console */ } mjcr->dcr->NewFile = true; /* set reminder to do set_new_file_params */ } +#endif + /* + * Walk through all attached dcrs setting flag to call + * set_new_file_parameters() when that dcr is next used. + */ + DCR *mdcr; + foreach_dlist(mdcr, dev->attached_dcrs) { + if (mdcr->jcr->JobId == 0) { + continue; + } + mdcr->NewFile = true; /* set reminder to do set_new_file_params */ + } + /* Set new file/block parameters for current dcr */ set_new_file_parameters(dcr); } diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index cea25ce223..189ce81df5 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -1152,7 +1152,7 @@ static JCR *create_jcr(JOB_DBR *jr, DEV_RECORD *rec, uint32_t JobId) jobjcr->VolSessionId = rec->VolSessionId; jobjcr->VolSessionTime = rec->VolSessionTime; jobjcr->ClientId = jr->ClientId; - attach_jcr_to_device(dev, jobjcr); +// attach_jcr_to_device(dev, jobjcr); new_dcr(jobjcr, dev); return jobjcr; } diff --git a/bacula/src/win32/README.win32 b/bacula/src/win32/README.win32 index 520ab97c18..53601e5108 100644 --- a/bacula/src/win32/README.win32 +++ b/bacula/src/win32/README.win32 @@ -32,9 +32,16 @@ Win32 Bacula. It can be found in the Source Forge Bacula project release section. To build it: +- Make sure nmake is on your PATH. +- The build is done in an rxvt window under the latest version + of cygwin. +- You need the Platform SDK installed. +- You need Visual Studio installed. - You may have to build wx with VC++ (as was the case for me). After starting VC++, use File->Open Workspace then open wx/src/wxWindows.dsw then use + Project->Set Active Project + then Build->Build All or Build->build wxmsw.lib should work too. - cd bacula ./configure --enable-client-only