]>
git.proxmox.com Git - proxmox-backup.git/log
Dietmar Maurer [Sun, 30 Dec 2018 14:33:43 +0000 (15:33 +0100)]
add some integreation tests for catar (compare with casync output)
Dietmar Maurer [Sun, 30 Dec 2018 13:09:59 +0000 (14:09 +0100)]
src/catar/encoder.rs: auto-resize file_copy_buffer, limit number of dirs
Dietmar Maurer [Sun, 30 Dec 2018 12:47:27 +0000 (13:47 +0100)]
improve catar docs
Dietmar Maurer [Sat, 29 Dec 2018 18:43:25 +0000 (19:43 +0100)]
add a comment about posible improvements
Dietmar Maurer [Sat, 29 Dec 2018 17:32:03 +0000 (18:32 +0100)]
src/catar/binary_search_tree.rs: add regression tests and fix one bug
Dietmar Maurer [Sat, 29 Dec 2018 16:38:50 +0000 (17:38 +0100)]
src/catar/binary_search_tree.rs: improve docu
Dietmar Maurer [Sat, 29 Dec 2018 16:26:32 +0000 (17:26 +0100)]
src/catar/encoder.rs: cleanup, factor out write_goodbye_table
Dietmar Maurer [Sat, 29 Dec 2018 16:00:48 +0000 (17:00 +0100)]
src/catar/encoder.rs: correctly sort goodby items
Dietmar Maurer [Fri, 28 Dec 2018 18:50:07 +0000 (19:50 +0100)]
use external crate siphasher
Because std::hash::SipHasher is deprecated.
Dietmar Maurer [Fri, 28 Dec 2018 14:02:02 +0000 (15:02 +0100)]
src/catar/encoder.rs: fix bug in file copy
Dietmar Maurer [Fri, 28 Dec 2018 13:51:43 +0000 (14:51 +0100)]
src/catar/encoder.rs: fix symlinks
Wolfgang Bumiller [Fri, 28 Dec 2018 13:25:05 +0000 (14:25 +0100)]
getopt: cleanup: add trailing commas
It is customary in rust to always use trailing commas. (also
suggested by rustfmt)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Fri, 28 Dec 2018 13:24:24 +0000 (14:24 +0100)]
getopt: cleanup: don't condense 'if' statements too much
In a language which enforces curly braces this looks weird
and rustfmt doesn't like it.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Fri, 28 Dec 2018 13:20:45 +0000 (14:20 +0100)]
getopt: whitespace cleanup
to make rustfmt happy
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Fri, 28 Dec 2018 13:26:05 +0000 (14:26 +0100)]
src/catar/encoder.rs: fix binary format, write goodby table
We still ned to sort the table (BST) ...
Wolfgang Bumiller [Fri, 28 Dec 2018 13:15:09 +0000 (14:15 +0100)]
getopt: condense nested match to reduce indentation
The `match value` statement is the only thing covering the
entire RawArgument::Option case. `rustfmt` suggests this
more condensed way of writing this case.
See the `git diff -w` of this patch:
|diff --git a/src/getopts.rs b/src/getopts.rs
|index
9755af2 ..
4db4579 100644
|--- a/src/getopts.rs
|+++ b/src/getopts.rs
|@@ -72,8 +72,7 @@ pub fn parse_arguments<T: AsRef<str>>(
| RawArgument::Separator => {
| break;
| }
|- RawArgument::Option { name, value } => {
|- match value {
|+ RawArgument::Option { name, value } => match value {
| None => {
| let mut want_bool = false;
| let mut can_default = false;
|@@ -125,7 +124,6 @@ pub fn parse_arguments<T: AsRef<str>>(
| data.push((name, v));
| }
| }
|- }
| RawArgument::Argument { value } => {
| rest.push(value);
| }
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Fri, 28 Dec 2018 13:04:16 +0000 (14:04 +0100)]
getopt: let parse_arguments() take a slice of AsRef<str>
We don't need the content to be owned strings, and we don't
need the list to be a Vec, since we only care about being
able to iterate through and copy out portions of the strings
we need, so take an &[T] where T: AsRef<str>.
This avoids .iter().map(to_string).collect() before calling
parse_arguments().
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Fri, 28 Dec 2018 12:59:44 +0000 (13:59 +0100)]
getopt: remove skip logic
The 'skip' variable was set to indicate that the "rest of
the args" is to be copied into the 'rest' vec. We can do
this directly and avoid the 'if' case in the loop
altogether.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Fri, 28 Dec 2018 12:54:18 +0000 (13:54 +0100)]
getopt: indentation reduction
See the `git diff -w` output:
|diff --git a/src/getopts.rs b/src/getopts.rs
|index
6548a01 ..
517cc37 100644
|--- a/src/getopts.rs
|+++ b/src/getopts.rs
|@@ -72,7 +72,10 @@ pub fn parse_arguments(
| while pos < args.len() {
| if skip {
| rest.push(args[pos].clone());
|- } else {
|+ pos += 1;
|+ continue;
|+ }
|+
| match parse_argument(&args[pos]) {
| RawArgument::Separator => {
| skip = true;
|@@ -135,7 +138,6 @@ pub fn parse_arguments(
| rest.push(value);
| }
| }
|- }
|
| pos += 1;
| }
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Fri, 28 Dec 2018 12:14:13 +0000 (13:14 +0100)]
parse_arguments: work with utf8 bytes and reduce indentation
We are only caring about '=' and '-' which are single-byte
codepoints, so there's no reason not to work on a byte
slice.
Also, some indentation reduction:
Transform
if (a) {
...
return A;
}
return B;
into
if (!a)
return B;
return A;
and
if (a)
if (b)
foo()
into
if (a && b)
return;
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Fri, 28 Dec 2018 10:48:47 +0000 (11:48 +0100)]
src/catar/encoder.rs: write filenames
Dietmar Maurer [Fri, 28 Dec 2018 09:44:12 +0000 (10:44 +0100)]
src/catar/encoder.rs: write file data
Dietmar Maurer [Fri, 28 Dec 2018 08:55:26 +0000 (09:55 +0100)]
src/catar/encoder.rs: write entry and symlink data
Dietmar Maurer [Fri, 28 Dec 2018 07:04:46 +0000 (08:04 +0100)]
make map_struct functions public
Dietmar Maurer [Fri, 28 Dec 2018 06:45:15 +0000 (07:45 +0100)]
catar/encoder.rs: improve error handling
Dietmar Maurer [Fri, 28 Dec 2018 06:14:12 +0000 (07:14 +0100)]
cleanups, avoid compiler warnings
Dietmar Maurer [Thu, 27 Dec 2018 13:24:31 +0000 (14:24 +0100)]
catar/encoder: detect symlink and regular files
Dietmar Maurer [Thu, 27 Dec 2018 12:15:10 +0000 (13:15 +0100)]
catar/encoder.rs: first try
Wolfgang Bumiller [Thu, 27 Dec 2018 09:36:05 +0000 (10:36 +0100)]
timer: setup_timeout_handler cannot fail
and if it does it panics anyway
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Thu, 27 Dec 2018 09:11:11 +0000 (10:11 +0100)]
backup-client: allow to specify directories (prepare for catar backup)
Dietmar Maurer [Thu, 27 Dec 2018 08:22:23 +0000 (09:22 +0100)]
start implementing catar
Dietmar Maurer [Thu, 27 Dec 2018 08:20:17 +0000 (09:20 +0100)]
new helper map_struct and map_struct_mut
Dietmar Maurer [Tue, 25 Dec 2018 12:29:27 +0000 (13:29 +0100)]
cleanup: reduce compiler warnings
Dietmar Maurer [Tue, 25 Dec 2018 12:24:50 +0000 (13:24 +0100)]
remove outdated comment
Dietmar Maurer [Tue, 25 Dec 2018 10:59:02 +0000 (11:59 +0100)]
touch_chunk: use libc::lutimensat
Dietmar Maurer [Sat, 22 Dec 2018 16:37:25 +0000 (17:37 +0100)]
move lookup_datastore() to backup/datastore.rs
Dietmar Maurer [Sat, 22 Dec 2018 15:58:16 +0000 (16:58 +0100)]
gather usage statistics during garbage collection
Dietmar Maurer [Sat, 22 Dec 2018 14:59:55 +0000 (15:59 +0100)]
open_file_locked: improve error message
Dietmar Maurer [Sat, 22 Dec 2018 14:39:05 +0000 (15:39 +0100)]
sweep_used_chunks: print percentage
Dietmar Maurer [Sat, 22 Dec 2018 13:31:59 +0000 (14:31 +0100)]
use openssl for faster hashing
Dietmar Maurer [Sat, 22 Dec 2018 13:04:05 +0000 (14:04 +0100)]
chunk_store: reduce number of directories
Else, scans everything takes too long ...
Dietmar Maurer [Fri, 21 Dec 2018 12:38:41 +0000 (13:38 +0100)]
src/api3/datastore.rs: new file
Dietmar Maurer [Fri, 21 Dec 2018 11:44:20 +0000 (12:44 +0100)]
use return value (avoid compiler warning)
Dietmar Maurer [Fri, 21 Dec 2018 11:15:26 +0000 (12:15 +0100)]
fix mutability for chunk store
Dietmar Maurer [Fri, 21 Dec 2018 10:18:08 +0000 (11:18 +0100)]
backup-client: add optional chunk-size parameter
Dietmar Maurer [Fri, 21 Dec 2018 08:24:55 +0000 (09:24 +0100)]
backup-client: do not start garbage collection after backup
Dietmar Maurer [Fri, 21 Dec 2018 07:36:57 +0000 (08:36 +0100)]
backup-client: use 1M chunks, make chunk_size configurable
Dietmar Maurer [Thu, 20 Dec 2018 13:09:31 +0000 (14:09 +0100)]
backup-clinet: specify target file name
Dietmar Maurer [Thu, 20 Dec 2018 13:03:42 +0000 (14:03 +0100)]
add test code to access static global state
Dietmar Maurer [Thu, 20 Dec 2018 09:32:49 +0000 (10:32 +0100)]
use proxmox-backup as package name
Dietmar Maurer [Wed, 19 Dec 2018 12:54:22 +0000 (13:54 +0100)]
fix tests
Dietmar Maurer [Wed, 19 Dec 2018 12:40:26 +0000 (13:40 +0100)]
try to improve error messages
Dietmar Maurer [Wed, 19 Dec 2018 11:49:23 +0000 (12:49 +0100)]
cleanups: avoid compiler warnings
Dietmar Maurer [Wed, 19 Dec 2018 11:40:26 +0000 (12:40 +0100)]
cleanup - avoid too much indentation
Dietmar Maurer [Wed, 19 Dec 2018 11:30:37 +0000 (12:30 +0100)]
cleanup
Dietmar Maurer [Wed, 19 Dec 2018 11:20:01 +0000 (12:20 +0100)]
ChunkStore::sweep_used_chunks - use openat to speedup directory walks
Wolfgang Bumiller [Wed, 19 Dec 2018 10:08:57 +0000 (11:08 +0100)]
use timers with a signal for file locking
* rename lock_file -> open_file_locked,
* add lock_file as a function working on already-opened
files
* change timeout types to std::time::Duration
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Wed, 19 Dec 2018 10:07:43 +0000 (11:07 +0100)]
add tools::timer module
This wraps POSIX timers via timer_create(2).
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Wed, 19 Dec 2018 10:06:40 +0000 (11:06 +0100)]
add rust standard .gitignore file
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Wed, 19 Dec 2018 09:02:24 +0000 (10:02 +0100)]
move lock_file to tools.rs
Dietmar Maurer [Wed, 19 Dec 2018 08:51:33 +0000 (09:51 +0100)]
impl sweep_used_chunks, first try
Dietmar Maurer [Tue, 18 Dec 2018 10:18:55 +0000 (11:18 +0100)]
move sweep_used_chunks to chunk_store
Dietmar Maurer [Tue, 18 Dec 2018 10:06:03 +0000 (11:06 +0100)]
start impl garbage collection
Dietmar Maurer [Mon, 17 Dec 2018 12:00:39 +0000 (13:00 +0100)]
start implementing DataStore
Dietmar Maurer [Sun, 16 Dec 2018 13:44:44 +0000 (14:44 +0100)]
start implementing ImageIndexReader
Dietmar Maurer [Sun, 16 Dec 2018 12:57:59 +0000 (13:57 +0100)]
avoid compiler warnings
Dietmar Maurer [Sun, 16 Dec 2018 12:52:16 +0000 (13:52 +0100)]
fix chunk store file paths
Dietmar Maurer [Sun, 16 Dec 2018 12:43:19 +0000 (13:43 +0100)]
improve error messages
Dietmar Maurer [Sun, 16 Dec 2018 12:39:21 +0000 (13:39 +0100)]
image_index.rs: implement atomic write/rename
Dietmar Maurer [Sun, 16 Dec 2018 10:51:16 +0000 (11:51 +0100)]
rebane ImageIndex to ImageIndexWriter
Dietmar Maurer [Sun, 16 Dec 2018 10:48:03 +0000 (11:48 +0100)]
use u64 to store time
Dietmar Maurer [Sat, 15 Dec 2018 16:05:49 +0000 (17:05 +0100)]
image_index.rs: write header
Dietmar Maurer [Sat, 15 Dec 2018 13:51:05 +0000 (14:51 +0100)]
image_index.rs:write idx of chunks (use mmap)
Dietmar Maurer [Sat, 15 Dec 2018 10:24:39 +0000 (11:24 +0100)]
backup-client: add bash completion for datastore names
Dietmar Maurer [Sat, 15 Dec 2018 10:22:22 +0000 (11:22 +0100)]
install backup-client binary
Dietmar Maurer [Sat, 15 Dec 2018 10:19:04 +0000 (11:19 +0100)]
add backup-client bash completion
Dietmar Maurer [Sat, 15 Dec 2018 10:16:27 +0000 (11:16 +0100)]
remove debug println
Dietmar Maurer [Sat, 15 Dec 2018 10:14:41 +0000 (11:14 +0100)]
move file_chunker to tools
Dietmar Maurer [Sat, 15 Dec 2018 10:08:49 +0000 (11:08 +0100)]
file_chunker: use Read trait
Dietmar Maurer [Sat, 15 Dec 2018 09:58:48 +0000 (10:58 +0100)]
backup-client: pass chunk_size as parameter to file_chunker
root [Fri, 14 Dec 2018 12:39:41 +0000 (13:39 +0100)]
backup-client: read file by chunks
root [Fri, 14 Dec 2018 07:28:56 +0000 (08:28 +0100)]
bin/backup-client.rs: nbew tool to play with chunk store
root [Thu, 13 Dec 2018 13:41:14 +0000 (14:41 +0100)]
api3/config/datastore.rs: create datastore files
Dietmar Maurer [Wed, 12 Dec 2018 12:00:58 +0000 (13:00 +0100)]
improve completion
Dietmar Maurer [Wed, 12 Dec 2018 11:41:59 +0000 (12:41 +0100)]
complete_datastore_name: write more compact code
Dietmar Maurer [Wed, 12 Dec 2018 11:18:28 +0000 (12:18 +0100)]
implement completion functions
Dietmar Maurer [Wed, 12 Dec 2018 11:18:49 +0000 (12:18 +0100)]
section_config.rs: remove debug output
Dietmar Maurer [Wed, 12 Dec 2018 10:23:04 +0000 (11:23 +0100)]
add comment
Dietmar Maurer [Wed, 12 Dec 2018 10:21:00 +0000 (11:21 +0100)]
add comment to make intensions more clear
Dietmar Maurer [Wed, 12 Dec 2018 09:37:03 +0000 (10:37 +0100)]
cleanup parameter types
Dietmar Maurer [Wed, 12 Dec 2018 07:33:50 +0000 (08:33 +0100)]
implement completion for enums
Dietmar Maurer [Wed, 12 Dec 2018 07:18:38 +0000 (08:18 +0100)]
improve completion
Dietmar Maurer [Wed, 12 Dec 2018 06:58:07 +0000 (07:58 +0100)]
do not use default completion
Dietmar Maurer [Wed, 12 Dec 2018 06:51:43 +0000 (07:51 +0100)]
improve bash completion
Dietmar Maurer [Tue, 11 Dec 2018 13:21:05 +0000 (14:21 +0100)]
impl bash completion: first try
Dietmar Maurer [Tue, 11 Dec 2018 11:54:10 +0000 (12:54 +0100)]
install bash completion scripts
Completion itself is not implemented.
Dietmar Maurer [Tue, 11 Dec 2018 10:31:36 +0000 (11:31 +0100)]
cli/command.rs: add new type CliCommandMap
Dietmar Maurer [Tue, 11 Dec 2018 10:12:13 +0000 (11:12 +0100)]
implement builder pattern for CliCommand
Dietmar Maurer [Mon, 10 Dec 2018 17:13:55 +0000 (18:13 +0100)]
cli/command.rs: implement prefix match
Dietmar Maurer [Mon, 10 Dec 2018 12:51:10 +0000 (13:51 +0100)]
impl From for CommandLineInterface