[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bacula-devel] Pre-alpha version of Bacula plugins working
Just to let you know that I have received your patch and will be looking at it
carefully in the near future ... I have been a bit overloaded lately
(switched back from development to bugs and getting version 2.2.9 out), but I
appreciate your contribution :-)
On Wednesday 12 March 2008 17:44:41 Bastian Friedrich wrote:
> On Tuesday 11 March 2008, you wrote:
> > On Tuesday 11 March 2008 10.39:52 Bastian Friedrich wrote:
> > > Hi,
> > >
> > > On Friday 22 February 2008, Bastian Friedrich wrote:
> > > > I'm sure you already have that on your radar; nonetheless, I'd like
> > > > to mention that (if I understood things right...) currently plugins
> > > > -- and the reader/writer executables in the bpipe plugin -- do not
> > > > have access to the target directory specification during restore
> > > > ("where"; the same holds true for the "replace" setting).
> > >
> > > thanks for your additional work on the plugin interface on that topic.
> > >
> > > I have supplemented your basic work in the bpipe plugin to allow two
> > > codes, %w and %r, to reference the "where" and "replace" flags. See
> > > attached patch.
> > Your patch looks interesting and worth applying. However, unless I
> > misunderstood it, you have created a global pointer CreateRP that points
> > to a packet, so the code is going to run into problems for the following
> > reasons:
> > 1. the restore packet that is passed should be considered volitale (if I
> > am not mistaken it is a stack variable, so it gets clobbered on return to
> > the function), so if you want information in it, you must copy it and not
> > retain a pointer to it.
> > 2. CreateRP is a global within bpipe-fd, and that will just not work
> > because there can be multiple threads running through it at the same
> > time. To make it work correctly, you must move the CreateRP into the
> > bpipe context packet, which is "local" to any particular instance of
> > bpipe, and thus will be used only by one thread. At the same time, you
> > need to copy the data you want as mentioned above rather than keeping a
> > pointer to it.
> thx a lot for your comments. You are of course right with both of your
> points. I'm attaching an improved version that should fix both problems by
> creating two variables in the plugin context and storing the "where" and
> "replace" attributes there.
> However, I was having a little difficulty understanding how/where to
> allocate/deallocate the proper buffer for the "where" string; due to this,
> I'm using a statically sized buffer inside the context. Hope this is OK?
> Best regards,
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
Bacula-devel mailing list
This mailing list archive is a service of Copilotco.