On 07/09/14 21:13, Maximilian Fillinger wrote:
Thanks for your feedback!

I like the idea. I would have liked to read an explanation for the
selected solution though, or a brief description of it.

I'll add a description below for the benefit of other readers.

I think adding a check to make sure there is a nonzero duid [...]
is reasonable.

Right, I'll add that.

I think -U should imply -u, since there is no use for it without it.

I'm not sure. Whether or not -u is given, dump searches /etc/dumpdates
for the date of the latest lower-level dump. With my patch, if you
want dump to search by duid, you need to give it the -U flag. So, as
it is now, -U should not imply -u. On the other hand, it might make

right.

sense to always search for both duid and device-filename (preferring the
duid when both are present).

I think it defeats the purpose. You could end up looking at a line from a former dump fitting by device name but still referring to another disk.




Description of the diff:
In main.c, when the flag -U is given, we set duidflag = 1. Then, the
program proceeds normally to determine what is to be dumped. We end up
with disk being the device file name. We then read the disklabel from
disk using ioctl DIOCGDINFO. We then do duid = asprintf(...) to print
the duid from the disklabel, followed by a '.' and a partition letter
(last character in disk).

In itime.c, the function getdumptime() reads off the date of the latest
lower-level dump. The patch modifies it so that it searches for duid
instead of disk if duidflag is set. Similarly, putdumptime() is modified
to update /etc/dumpdates with duid instead of disk.

In include/protocols/dumprestore.h, I had to change the format strings
DUMPOUTFMT and DUMPINFMT. These are used for writing and reading
/etc/dumpdates, and when we allow duids in that file, the first field
has to be wider.

a bit more than I aimed at, but nice. ;)

oh, diff with -uNp helps too, for a bit more context.


Reply via email to