]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
5 years agogetopt: remove skip logic
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>
5 years agogetopt: indentation reduction
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>
5 years agoparse_arguments: work with utf8 bytes and reduce indentation
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>
5 years agosrc/catar/encoder.rs: write filenames
Dietmar Maurer [Fri, 28 Dec 2018 10:48:47 +0000 (11:48 +0100)]
src/catar/encoder.rs: write filenames

5 years agosrc/catar/encoder.rs: write file data
Dietmar Maurer [Fri, 28 Dec 2018 09:44:12 +0000 (10:44 +0100)]
src/catar/encoder.rs: write file data

5 years agosrc/catar/encoder.rs: write entry and symlink data
Dietmar Maurer [Fri, 28 Dec 2018 08:55:26 +0000 (09:55 +0100)]
src/catar/encoder.rs: write entry and symlink data

5 years agomake map_struct functions public
Dietmar Maurer [Fri, 28 Dec 2018 07:04:46 +0000 (08:04 +0100)]
make map_struct functions public

5 years agocatar/encoder.rs: improve error handling
Dietmar Maurer [Fri, 28 Dec 2018 06:45:15 +0000 (07:45 +0100)]
catar/encoder.rs: improve error handling

5 years agocleanups, avoid compiler warnings
Dietmar Maurer [Fri, 28 Dec 2018 06:14:12 +0000 (07:14 +0100)]
cleanups, avoid compiler warnings

5 years agocatar/encoder: detect symlink and regular files
Dietmar Maurer [Thu, 27 Dec 2018 13:24:31 +0000 (14:24 +0100)]
catar/encoder: detect symlink and regular files

5 years agocatar/encoder.rs: first try
Dietmar Maurer [Thu, 27 Dec 2018 12:15:10 +0000 (13:15 +0100)]
catar/encoder.rs: first try

5 years agotimer: setup_timeout_handler cannot fail
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>
5 years agobackup-client: allow to specify directories (prepare for catar backup)
Dietmar Maurer [Thu, 27 Dec 2018 09:11:11 +0000 (10:11 +0100)]
backup-client: allow to specify directories (prepare for catar backup)

5 years agostart implementing catar
Dietmar Maurer [Thu, 27 Dec 2018 08:22:23 +0000 (09:22 +0100)]
start implementing catar

5 years agonew helper map_struct and map_struct_mut
Dietmar Maurer [Thu, 27 Dec 2018 08:20:17 +0000 (09:20 +0100)]
new helper map_struct and map_struct_mut

5 years agocleanup: reduce compiler warnings
Dietmar Maurer [Tue, 25 Dec 2018 12:29:27 +0000 (13:29 +0100)]
cleanup: reduce compiler warnings

5 years agoremove outdated comment
Dietmar Maurer [Tue, 25 Dec 2018 12:24:50 +0000 (13:24 +0100)]
remove outdated comment

5 years agotouch_chunk: use libc::lutimensat
Dietmar Maurer [Tue, 25 Dec 2018 10:59:02 +0000 (11:59 +0100)]
touch_chunk: use libc::lutimensat

5 years agomove lookup_datastore() to backup/datastore.rs
Dietmar Maurer [Sat, 22 Dec 2018 16:37:25 +0000 (17:37 +0100)]
move lookup_datastore() to backup/datastore.rs

5 years agogather usage statistics during garbage collection
Dietmar Maurer [Sat, 22 Dec 2018 15:58:16 +0000 (16:58 +0100)]
gather usage statistics during garbage collection

5 years agoopen_file_locked: improve error message
Dietmar Maurer [Sat, 22 Dec 2018 14:59:55 +0000 (15:59 +0100)]
open_file_locked: improve error message

5 years agosweep_used_chunks: print percentage
Dietmar Maurer [Sat, 22 Dec 2018 14:39:05 +0000 (15:39 +0100)]
sweep_used_chunks: print percentage

5 years agouse openssl for faster hashing
Dietmar Maurer [Sat, 22 Dec 2018 13:31:59 +0000 (14:31 +0100)]
use openssl for faster hashing

5 years agochunk_store: reduce number of directories
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 ...

5 years agosrc/api3/datastore.rs: new file
Dietmar Maurer [Fri, 21 Dec 2018 12:38:41 +0000 (13:38 +0100)]
src/api3/datastore.rs: new file

5 years agouse return value (avoid compiler warning)
Dietmar Maurer [Fri, 21 Dec 2018 11:44:20 +0000 (12:44 +0100)]
use return value (avoid compiler warning)

5 years agofix mutability for chunk store
Dietmar Maurer [Fri, 21 Dec 2018 11:15:26 +0000 (12:15 +0100)]
fix mutability for chunk store

5 years agobackup-client: add optional chunk-size parameter
Dietmar Maurer [Fri, 21 Dec 2018 10:18:08 +0000 (11:18 +0100)]
backup-client: add optional chunk-size parameter

5 years agobackup-client: do not start garbage collection after backup
Dietmar Maurer [Fri, 21 Dec 2018 08:24:55 +0000 (09:24 +0100)]
backup-client: do not start garbage collection after backup

5 years agobackup-client: use 1M chunks, make chunk_size configurable
Dietmar Maurer [Fri, 21 Dec 2018 07:36:57 +0000 (08:36 +0100)]
backup-client: use 1M chunks, make chunk_size configurable

5 years agobackup-clinet: specify target file name
Dietmar Maurer [Thu, 20 Dec 2018 13:09:31 +0000 (14:09 +0100)]
backup-clinet: specify target file name

5 years agoadd test code to access static global state
Dietmar Maurer [Thu, 20 Dec 2018 13:03:42 +0000 (14:03 +0100)]
add test code to access static global state

5 years agouse proxmox-backup as package name
Dietmar Maurer [Thu, 20 Dec 2018 09:32:49 +0000 (10:32 +0100)]
use proxmox-backup as package name

5 years agofix tests
Dietmar Maurer [Wed, 19 Dec 2018 12:54:22 +0000 (13:54 +0100)]
fix tests

5 years agotry to improve error messages
Dietmar Maurer [Wed, 19 Dec 2018 12:40:26 +0000 (13:40 +0100)]
try to improve error messages

5 years agocleanups: avoid compiler warnings
Dietmar Maurer [Wed, 19 Dec 2018 11:49:23 +0000 (12:49 +0100)]
cleanups: avoid compiler warnings

5 years agocleanup - avoid too much indentation
Dietmar Maurer [Wed, 19 Dec 2018 11:40:26 +0000 (12:40 +0100)]
cleanup - avoid too much indentation

5 years agocleanup
Dietmar Maurer [Wed, 19 Dec 2018 11:30:37 +0000 (12:30 +0100)]
cleanup

5 years agoChunkStore::sweep_used_chunks - use openat to speedup directory walks
Dietmar Maurer [Wed, 19 Dec 2018 11:20:01 +0000 (12:20 +0100)]
ChunkStore::sweep_used_chunks - use openat to speedup directory walks

5 years agouse timers with a signal for file locking
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>
5 years agoadd tools::timer module
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>
5 years agoadd rust standard .gitignore file
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>
5 years agomove lock_file to tools.rs
Dietmar Maurer [Wed, 19 Dec 2018 09:02:24 +0000 (10:02 +0100)]
move lock_file to tools.rs

5 years agoimpl sweep_used_chunks, first try
Dietmar Maurer [Wed, 19 Dec 2018 08:51:33 +0000 (09:51 +0100)]
impl sweep_used_chunks, first try

5 years agomove sweep_used_chunks to chunk_store
Dietmar Maurer [Tue, 18 Dec 2018 10:18:55 +0000 (11:18 +0100)]
move sweep_used_chunks to chunk_store

5 years agostart impl garbage collection
Dietmar Maurer [Tue, 18 Dec 2018 10:06:03 +0000 (11:06 +0100)]
start impl garbage collection

5 years agostart implementing DataStore
Dietmar Maurer [Mon, 17 Dec 2018 12:00:39 +0000 (13:00 +0100)]
start implementing DataStore

5 years agostart implementing ImageIndexReader
Dietmar Maurer [Sun, 16 Dec 2018 13:44:44 +0000 (14:44 +0100)]
start implementing ImageIndexReader

5 years agoavoid compiler warnings
Dietmar Maurer [Sun, 16 Dec 2018 12:57:59 +0000 (13:57 +0100)]
avoid compiler warnings

5 years agofix chunk store file paths
Dietmar Maurer [Sun, 16 Dec 2018 12:52:16 +0000 (13:52 +0100)]
fix chunk store file paths

5 years agoimprove error messages
Dietmar Maurer [Sun, 16 Dec 2018 12:43:19 +0000 (13:43 +0100)]
improve error messages

5 years agoimage_index.rs: implement atomic write/rename
Dietmar Maurer [Sun, 16 Dec 2018 12:39:21 +0000 (13:39 +0100)]
image_index.rs: implement atomic write/rename

5 years agorebane ImageIndex to ImageIndexWriter
Dietmar Maurer [Sun, 16 Dec 2018 10:51:16 +0000 (11:51 +0100)]
rebane ImageIndex to ImageIndexWriter

5 years agouse u64 to store time
Dietmar Maurer [Sun, 16 Dec 2018 10:48:03 +0000 (11:48 +0100)]
use u64 to store time

5 years agoimage_index.rs: write header
Dietmar Maurer [Sat, 15 Dec 2018 16:05:49 +0000 (17:05 +0100)]
image_index.rs: write header

5 years agoimage_index.rs:write idx of chunks (use mmap)
Dietmar Maurer [Sat, 15 Dec 2018 13:51:05 +0000 (14:51 +0100)]
image_index.rs:write idx of chunks (use mmap)

5 years agobackup-client: add bash completion for datastore names
Dietmar Maurer [Sat, 15 Dec 2018 10:24:39 +0000 (11:24 +0100)]
backup-client: add bash completion for datastore names

5 years agoinstall backup-client binary
Dietmar Maurer [Sat, 15 Dec 2018 10:22:22 +0000 (11:22 +0100)]
install backup-client binary

5 years agoadd backup-client bash completion
Dietmar Maurer [Sat, 15 Dec 2018 10:19:04 +0000 (11:19 +0100)]
add backup-client bash completion

5 years agoremove debug println
Dietmar Maurer [Sat, 15 Dec 2018 10:16:27 +0000 (11:16 +0100)]
remove debug println

5 years agomove file_chunker to tools
Dietmar Maurer [Sat, 15 Dec 2018 10:14:41 +0000 (11:14 +0100)]
move file_chunker to tools

5 years agofile_chunker: use Read trait
Dietmar Maurer [Sat, 15 Dec 2018 10:08:49 +0000 (11:08 +0100)]
file_chunker: use Read trait

5 years agobackup-client: pass chunk_size as parameter to file_chunker
Dietmar Maurer [Sat, 15 Dec 2018 09:58:48 +0000 (10:58 +0100)]
backup-client: pass chunk_size as parameter to file_chunker

5 years agobackup-client: read file by chunks
root [Fri, 14 Dec 2018 12:39:41 +0000 (13:39 +0100)]
backup-client: read file by chunks

5 years agobin/backup-client.rs: nbew tool to play with chunk store
root [Fri, 14 Dec 2018 07:28:56 +0000 (08:28 +0100)]
bin/backup-client.rs: nbew tool to play with chunk store

5 years agoapi3/config/datastore.rs: create datastore files
root [Thu, 13 Dec 2018 13:41:14 +0000 (14:41 +0100)]
api3/config/datastore.rs: create datastore files

5 years agoimprove completion
Dietmar Maurer [Wed, 12 Dec 2018 12:00:58 +0000 (13:00 +0100)]
improve completion

5 years agocomplete_datastore_name: write more compact code
Dietmar Maurer [Wed, 12 Dec 2018 11:41:59 +0000 (12:41 +0100)]
complete_datastore_name: write more compact code

5 years agoimplement completion functions
Dietmar Maurer [Wed, 12 Dec 2018 11:18:28 +0000 (12:18 +0100)]
implement completion functions

5 years agosection_config.rs: remove debug output
Dietmar Maurer [Wed, 12 Dec 2018 11:18:49 +0000 (12:18 +0100)]
section_config.rs: remove debug output

5 years agoadd comment
Dietmar Maurer [Wed, 12 Dec 2018 10:23:04 +0000 (11:23 +0100)]
add comment

5 years agoadd comment to make intensions more clear
Dietmar Maurer [Wed, 12 Dec 2018 10:21:00 +0000 (11:21 +0100)]
add comment to make intensions more clear

5 years agocleanup parameter types
Dietmar Maurer [Wed, 12 Dec 2018 09:37:03 +0000 (10:37 +0100)]
cleanup parameter types

5 years agoimplement completion for enums
Dietmar Maurer [Wed, 12 Dec 2018 07:33:50 +0000 (08:33 +0100)]
implement completion for enums

5 years agoimprove completion
Dietmar Maurer [Wed, 12 Dec 2018 07:18:38 +0000 (08:18 +0100)]
improve completion

5 years agodo not use default completion
Dietmar Maurer [Wed, 12 Dec 2018 06:58:07 +0000 (07:58 +0100)]
do not use default completion

5 years agoimprove bash completion
Dietmar Maurer [Wed, 12 Dec 2018 06:51:43 +0000 (07:51 +0100)]
improve bash completion

5 years agoimpl bash completion: first try
Dietmar Maurer [Tue, 11 Dec 2018 13:21:05 +0000 (14:21 +0100)]
impl bash completion: first try

5 years agoinstall bash completion scripts
Dietmar Maurer [Tue, 11 Dec 2018 11:54:10 +0000 (12:54 +0100)]
install bash completion scripts

Completion itself is not implemented.

5 years agocli/command.rs: add new type CliCommandMap
Dietmar Maurer [Tue, 11 Dec 2018 10:31:36 +0000 (11:31 +0100)]
cli/command.rs: add new type CliCommandMap

5 years agoimplement builder pattern for CliCommand
Dietmar Maurer [Tue, 11 Dec 2018 10:12:13 +0000 (11:12 +0100)]
implement builder pattern for CliCommand

5 years agocli/command.rs: implement prefix match
Dietmar Maurer [Mon, 10 Dec 2018 17:13:55 +0000 (18:13 +0100)]
cli/command.rs: implement prefix match

5 years agoimpl From for CommandLineInterface
Dietmar Maurer [Mon, 10 Dec 2018 12:51:10 +0000 (13:51 +0100)]
impl From for CommandLineInterface

5 years agorename CmdDef to CommandLineInterface
Dietmar Maurer [Mon, 10 Dec 2018 12:40:10 +0000 (13:40 +0100)]
rename CmdDef to CommandLineInterface

5 years agosrc/cli/command.rs: move code into separate file
Dietmar Maurer [Mon, 10 Dec 2018 12:36:52 +0000 (13:36 +0100)]
src/cli/command.rs: move code into separate file

5 years agotry to support nested cli command definitions
Dietmar Maurer [Mon, 10 Dec 2018 12:28:38 +0000 (13:28 +0100)]
try to support nested cli command definitions

5 years agoapi3/config/datastore.rs: implement delete
Dietmar Maurer [Sun, 9 Dec 2018 15:52:32 +0000 (16:52 +0100)]
api3/config/datastore.rs: implement delete

5 years agofile_set_contents: correctly use perm parameter
Dietmar Maurer [Sun, 9 Dec 2018 15:41:54 +0000 (16:41 +0100)]
file_set_contents: correctly use perm parameter

5 years agoimplement tools::file_set_contents
Dietmar Maurer [Sun, 9 Dec 2018 15:37:48 +0000 (16:37 +0100)]
implement tools::file_set_contents

5 years agoapi3/config/datastore.rs: impl create
Dietmar Maurer [Sun, 9 Dec 2018 11:51:31 +0000 (12:51 +0100)]
api3/config/datastore.rs: impl create

5 years agobin/pbs-datastore.rs: start implementing cli commands
Dietmar Maurer [Sun, 9 Dec 2018 10:59:32 +0000 (11:59 +0100)]
bin/pbs-datastore.rs: start implementing cli commands

5 years agorename entry to item
Dietmar Maurer [Sun, 9 Dec 2018 09:25:56 +0000 (10:25 +0100)]
rename entry to item

5 years agoapi3/config/datastore.rs: return real data
Dietmar Maurer [Sun, 9 Dec 2018 09:23:19 +0000 (10:23 +0100)]
api3/config/datastore.rs: return real data

5 years agoconfig/datastore.rs - open file for reading
Dietmar Maurer [Sun, 9 Dec 2018 09:22:39 +0000 (10:22 +0100)]
config/datastore.rs - open file for reading

5 years agocreate config dir
Dietmar Maurer [Sun, 9 Dec 2018 09:21:54 +0000 (10:21 +0100)]
create config dir

5 years agosimplify code
Dietmar Maurer [Sun, 9 Dec 2018 08:42:17 +0000 (09:42 +0100)]
simplify code

5 years agoremove some compiler warnings
Dietmar Maurer [Sat, 8 Dec 2018 13:55:54 +0000 (14:55 +0100)]
remove some compiler warnings

5 years agorename data_store to datastore
Dietmar Maurer [Sat, 8 Dec 2018 13:51:08 +0000 (14:51 +0100)]
rename data_store to datastore

5 years agocleanup api3 structure
Dietmar Maurer [Sat, 8 Dec 2018 13:44:55 +0000 (14:44 +0100)]
cleanup api3 structure

5 years agoadd data_store configuration
Dietmar Maurer [Sat, 8 Dec 2018 12:58:45 +0000 (13:58 +0100)]
add data_store configuration