[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bacula-devel] Clone jobs and pool


Hi,

On Thursday 10 April 2008, Petar Bogdanovic wrote:
> On Thu, Apr 10, 2008 at 10:43:53AM +0200, Bastian Friedrich wrote:
> > By using the attached patch, one can use a "pool=%p" in the run statement
> > to do this. The patch uses the callback code that I have submitted a
> > while ago (in the thread "Accessing fileset in lib/util.c?"); this code
> > has been in the public svn for a while now.
> >
> > (...)
> >
> > Index: bacula-2.2-20080404svn/src/dird/job.c
> > ===================================================================
> > --- bacula-2.2-20080404svn/src/dird/job.c	(revision 6786)
> > +++ bacula-2.2-20080404svn/src/dird/job.c	(working copy)
> > @@ -1272,6 +1272,14 @@
> >     jcr->wstore = NULL;
> >  }
> >
> > +char *job_code_callback_clones(JCR *jcr, const char* param) {
> > +	if (param[0] == 'p') {
> > +		return jcr->pool->name();
> > +	} else {
> > +		return NULL;
> > +	}
> > +}
> > +
>
> Why not creating just one callback function with a more general name

The ammount of information that is available for all kinds of "edit_job_codes" 
calls are differing - this is the reason for the implementation of this 
callback in the first place.

Currently, there are two places where edit_job_codes is called with callbacks, 
in fact both inside the director (but in absolutely different parts). Feel 
free to check whether these two callbacks could be unified. The requirements 
in both places are distinct - YMMV.

> and doing a switch() on param[0] afterwards?

There's no need for a switch if there's only a single "if" :))

Thx for your feedback,
   Bastian

-- 
Collax GmbH . Burkheimer Straße 3 . 79111 Freiburg . Germany
p: +49 (0) 761-45684-24
f: +49 (0) 761-45684-10        www.collax.com

Geschäftsführer: William K. Hite / Boris Nalbach
AG München HRB 158898 . Ust.-IdNr: DE 814464942
\ Microsoft Windows... a virus with mouse support.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilotco.