]>
git.proxmox.com Git - proxmox-backup-qemu.git/log
Wolfgang Bumiller [Thu, 13 Aug 2020 08:03:46 +0000 (10:03 +0200)]
clippy: remove unnecessary mut
curiously this one is also not caught by rustc
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Thu, 13 Aug 2020 07:53:58 +0000 (09:53 +0200)]
clippy: this case I disagree with
clippy suggests a way-too-long
for (i, index) in index.iter_mut().enumerate().take(index_count) {
*index = ...
}
which is just massive in comparison, and not at all more
readable...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Thu, 13 Aug 2020 07:50:55 +0000 (09:50 +0200)]
clippy lints
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Thu, 13 Aug 2020 07:31:03 +0000 (09:31 +0200)]
readability cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fabian Grünbichler [Fri, 24 Jul 2020 09:53:35 +0000 (11:53 +0200)]
fix #2866: invalidate bitmap on crypt_mode change
signed and plain backups share chunks, so bitmap reusal is okay for
those combinations. switching from encrypted to not encrypted or
vice-versa could have pretty fatal consequences - either referencing
plain-text chunks in 'encrypted' backups, or referencing encrypted
chunks in 'unencrypted' backups without still having the corresponding
keys..
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fabian Grünbichler [Fri, 24 Jul 2020 09:53:34 +0000 (11:53 +0200)]
add archive_name helper
since we're about to introduce a third duplicate of this line..
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fabian Grünbichler [Fri, 24 Jul 2020 09:53:33 +0000 (11:53 +0200)]
refactor incremental checks
in preparation for adding more checks to check_incremental
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fabian Grünbichler [Wed, 12 Aug 2020 11:56:28 +0000 (13:56 +0200)]
bump version to 0.6.3-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Fabian Grünbichler [Wed, 12 Aug 2020 07:58:36 +0000 (09:58 +0200)]
build: fix make -j
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Wolfgang Bumiller [Wed, 12 Aug 2020 07:32:57 +0000 (09:32 +0200)]
bump proxmox-backup to 0.8.10
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Wed, 12 Aug 2020 07:30:22 +0000 (09:30 +0200)]
Cargo.toml: sort dependencies
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fabian Grünbichler [Mon, 10 Aug 2020 11:25:04 +0000 (13:25 +0200)]
adapt to chunk reader changes
for verification of chunk crypt mode <=> index crypt mode match
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Thomas Lamprecht [Fri, 24 Jul 2020 09:57:25 +0000 (11:57 +0200)]
relay proxmox dependency to 0.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 23 Jul 2020 09:39:30 +0000 (11:39 +0200)]
bump version to 0.6.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 23 Jul 2020 09:35:26 +0000 (11:35 +0200)]
update proxmox and proxmox-backup crates
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stefan Reiter [Wed, 22 Jul 2020 13:56:25 +0000 (15:56 +0200)]
read_image_at: iterate until buffer is filled
QEMU will always assume EOF when less bytes than requested are returned
by a block drivers 'read' interface, so we need to fill the buffer up to
'size' if possible.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Stefan Reiter [Wed, 22 Jul 2020 13:56:24 +0000 (15:56 +0200)]
use AsyncIndexReader for read_image_at
Replaces the removed BufferedFixedReader and makes the API fully async
(not block_in_place or block_on which could break with many requests at
once).
A tokio::sync::Mutex needs to be used for exclusive access, since a
regular one would not work with async/await calls.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Dietmar Maurer [Thu, 9 Jul 2020 12:23:49 +0000 (14:23 +0200)]
bump version to 0.6.1-1
Stefan Reiter [Thu, 9 Jul 2020 12:12:42 +0000 (14:12 +0200)]
ignore missing or bad previous index
This is not a fatal condition, it just means that we cannot do
incremental backups client-side. This can happen if a new disk was added
the a VM since the last backup for example.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Dietmar Maurer [Thu, 9 Jul 2020 10:21:03 +0000 (12:21 +0200)]
bump version to 0.6.0-1
Dietmar Maurer [Thu, 9 Jul 2020 10:18:46 +0000 (12:18 +0200)]
produce correct manifest
Dietmar Maurer [Thu, 9 Jul 2020 08:43:24 +0000 (10:43 +0200)]
add compress and encrypt paramaters
This breaks binary API again!
Dietmar Maurer [Wed, 8 Jul 2020 06:07:52 +0000 (08:07 +0200)]
bump version to 0.5.1-1
Dietmar Maurer [Wed, 8 Jul 2020 06:05:44 +0000 (08:05 +0200)]
cleanup: also improve code resuse and parameter checks for restore
Dietmar Maurer [Wed, 8 Jul 2020 05:52:07 +0000 (07:52 +0200)]
bump version to 0.5.0-1
Dietmar Maurer [Wed, 8 Jul 2020 05:37:22 +0000 (07:37 +0200)]
check for null parameters
Dietmar Maurer [Wed, 8 Jul 2020 04:54:47 +0000 (06:54 +0200)]
cleanup: allways call _async functions instead of duplicating code
Dietmar Maurer [Wed, 8 Jul 2020 04:37:53 +0000 (06:37 +0200)]
proxmox_backup_check_incremental: check if device_name is NULL
Dietmar Maurer [Wed, 8 Jul 2020 04:35:34 +0000 (06:35 +0200)]
proxmox_backup_abort: check for reason == NULL
Dietmar Maurer [Tue, 7 Jul 2020 09:00:15 +0000 (11:00 +0200)]
bump version to 0.4.0-1
Dietmar Maurer [Tue, 7 Jul 2020 08:43:38 +0000 (10:43 +0200)]
use new get_runtime_with_builder
Dietmar Maurer [Tue, 7 Jul 2020 07:49:41 +0000 (09:49 +0200)]
bump version to 0.3.3-1
Dietmar Maurer [Tue, 7 Jul 2020 07:45:17 +0000 (09:45 +0200)]
src/commands.rs: avoid useless digest conversions
Dietmar Maurer [Tue, 7 Jul 2020 07:41:46 +0000 (09:41 +0200)]
src/commands.rs: avoid useless lock
Dietmar Maurer [Tue, 7 Jul 2020 07:37:26 +0000 (09:37 +0200)]
src/registry.rs: split out Registry code
Dietmar Maurer [Tue, 7 Jul 2020 07:01:43 +0000 (09:01 +0200)]
rename worker_task.rs -> backup.rs
Dietmar Maurer [Tue, 7 Jul 2020 06:59:22 +0000 (08:59 +0200)]
rename ProxmoxRestore into RestoreTask
Dietmar Maurer [Tue, 7 Jul 2020 06:21:40 +0000 (08:21 +0200)]
remove pub attribute where not required
Dietmar Maurer [Tue, 7 Jul 2020 06:13:14 +0000 (08:13 +0200)]
src/restore.rs: implement with_runtime
Dietmar Maurer [Tue, 7 Jul 2020 05:49:53 +0000 (07:49 +0200)]
src/restore.rs: share remote chunk reader
Dietmar Maurer [Tue, 7 Jul 2020 04:54:34 +0000 (06:54 +0200)]
src/restore.rs: use backup_type from setup
Thomas Lamprecht [Mon, 6 Jul 2020 17:54:27 +0000 (19:54 +0200)]
bump version to 0.3.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dietmar Maurer [Mon, 6 Jul 2020 12:08:07 +0000 (14:08 +0200)]
src/restore.rs: use OnceCell to avoid locking
Dietmar Maurer [Mon, 6 Jul 2020 11:54:21 +0000 (13:54 +0200)]
src/worker_task.rs: use OnceCell to avoid locking
Dietmar Maurer [Mon, 6 Jul 2020 11:31:31 +0000 (13:31 +0200)]
current-api.h: update to include changes from previous commit
Dietmar Maurer [Mon, 6 Jul 2020 10:51:17 +0000 (12:51 +0200)]
add proxmox_backup_check_incremental() api
Dietmar Maurer [Mon, 6 Jul 2020 10:26:31 +0000 (12:26 +0200)]
current-api.h: update to include changes from previous commit
Dietmar Maurer [Mon, 6 Jul 2020 09:38:58 +0000 (11:38 +0200)]
proxmox_restore_new: use snapshot string (again) instead of (type, Id, time).
And provide a new helper to create such strings: proxmox_backup_snapshot_string()
Dietmar Maurer [Mon, 6 Jul 2020 06:05:21 +0000 (08:05 +0200)]
add restore data reading API
For accessing existing backups in a VM.
Stefan Reiter [Thu, 2 Jul 2020 13:42:11 +0000 (15:42 +0200)]
make Registry generic and add ImageAccessInfo
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Dietmar Maurer [Thu, 2 Jul 2020 10:06:55 +0000 (12:06 +0200)]
bump version to 0.3.1-1
Dietmar Maurer [Thu, 2 Jul 2020 08:34:10 +0000 (10:34 +0200)]
write_data: return 0 for reused chunks
Dietmar Maurer [Thu, 2 Jul 2020 05:43:48 +0000 (07:43 +0200)]
bump version to 0.3.0-1
Dietmar Maurer [Thu, 2 Jul 2020 05:41:47 +0000 (07:41 +0200)]
log abort error to stderr
Dietmar Maurer [Thu, 2 Jul 2020 05:34:47 +0000 (07:34 +0200)]
cleanup: remove stale comments
Dietmar Maurer [Thu, 2 Jul 2020 05:28:50 +0000 (07:28 +0200)]
make restore api thread safe
Dietmar Maurer [Thu, 2 Jul 2020 05:13:29 +0000 (07:13 +0200)]
cleanup (use better name)
Dietmar Maurer [Thu, 2 Jul 2020 05:12:51 +0000 (07:12 +0200)]
current-api.h: update docs
Dietmar Maurer [Thu, 2 Jul 2020 05:01:12 +0000 (07:01 +0200)]
make backup C api thread safe
Protect everything with a Mutex, so it is now allowed to make parallel
calls from different threads.
Dietmar Maurer [Wed, 1 Jul 2020 14:58:38 +0000 (16:58 +0200)]
Revert "avoid mutexes"
This reverts commit
96afa3d02c06e30f5fa9a0edd5ed203ac05ad7b8 .
Turns out we cannot guarantee correct locking at caller site ...
Dietmar Maurer [Wed, 1 Jul 2020 11:17:58 +0000 (13:17 +0200)]
improve error message
Dietmar Maurer [Wed, 1 Jul 2020 09:34:52 +0000 (11:34 +0200)]
add_config: use Vec<u8> instead of DataPointer
Dietmar Maurer [Wed, 1 Jul 2020 09:16:33 +0000 (11:16 +0200)]
avoid mutexes
Dietmar Maurer [Wed, 1 Jul 2020 08:44:10 +0000 (10:44 +0200)]
simpletest.c: fix error check
Dietmar Maurer [Wed, 1 Jul 2020 08:26:08 +0000 (10:26 +0200)]
avoid extra worker thread and command channel
Thomas Lamprecht [Tue, 30 Jun 2020 10:27:14 +0000 (12:27 +0200)]
bump version to 0.2.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Wolfgang Bumiller [Tue, 30 Jun 2020 08:03:25 +0000 (10:03 +0200)]
add tools module
with:
* utf8_c_string(ptr) -> Result<Option<String>>
* utf8_c_string_lossy(ptr) -> Option<String>
* unsafe utf8_c_string_lossy_non_null(ptr) -> String
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Mon, 29 Jun 2020 11:12:10 +0000 (13:12 +0200)]
add api check
commit the current generated proxmox-backup-qemu.h as
'current-api.h' and run `diff -up` between the two in build
steps, so any changes to the C api are caught at build time.
cbindgen seems to be using a BTreeMap for the data, so it
should always come out sorted, so this should be a
stable-enough check.
Link: https://github.com/eqrion/cbindgen/issues/12
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Mon, 29 Jun 2020 11:06:29 +0000 (13:06 +0200)]
depend on proxmox-backup v0.5.0
Dietmar Maurer [Mon, 29 Jun 2020 07:41:27 +0000 (09:41 +0200)]
also upload _dbgsym_ .deb
Dietmar Maurer [Mon, 29 Jun 2020 07:36:25 +0000 (09:36 +0200)]
bump version to 0.1.8-1
Dietmar Maurer [Mon, 29 Jun 2020 07:34:18 +0000 (09:34 +0200)]
proxmox_backup_connect: return info about previous backup
Dietmar Maurer [Mon, 29 Jun 2020 07:02:15 +0000 (09:02 +0200)]
use bool type for incremental flag
Dietmar Maurer [Fri, 26 Jun 2020 09:55:17 +0000 (11:55 +0200)]
simpletest.c: fix compile error
Dietmar Maurer [Fri, 26 Jun 2020 09:44:07 +0000 (11:44 +0200)]
bump version to 0.1.7-1
Dietmar Maurer [Fri, 26 Jun 2020 09:37:02 +0000 (11:37 +0200)]
simplify code
Stefan Reiter [Thu, 25 Jun 2020 10:23:32 +0000 (12:23 +0200)]
add incremental backup support
Tell the server we're doing an incremental backup if QEMU notifies us
with "is_incremental" in register_image. We do this by using the
'reuse-csum' parameter when registering each archive's index, thus
switching the server to incremental mode (where it only expects changed
chunks and verifies the previous backup's checksum).
We use the newly changed API download_previous_fixed_index() to replace
known_chunks generation and also give us the verified index file to
calculate the new checksum with. The manifest for verfication is
downloaded during "Connect".
To initialize the session cache for checksums, lazy_static is used.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Stefan Reiter [Tue, 23 Jun 2020 12:43:11 +0000 (14:43 +0200)]
make compatible with newest proxmox-backup crate
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Thomas Lamprecht [Thu, 4 Jun 2020 08:48:50 +0000 (10:48 +0200)]
bump version to 0.1.6-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 4 Jun 2020 08:48:07 +0000 (10:48 +0200)]
update proxmox-backup crate to 0.2.3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Wed, 3 Jun 2020 12:00:13 +0000 (14:00 +0200)]
fix backing up images that are not multiples of 'chunk_size'
by removing the client side checks
since the backup server has to check those things anyway, there is
little benefit of checking it here, but poses a risk that there
are two diverging checks for the client and server
especially the next to last check (end_offset > device_size) was
wrong, since we do not actually check the size of the actual chunk
(which would be 'size'), but the generic set chunk size (defaults to 4M)
which is obviously wrong (the last chunk is probably smaller)
since it is not needed anymore, we can omit to get the 'device_size'
fixes an issue where we could not backup an image which was not
4M aligned (or smaller than 4M altogether)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Thomas Lamprecht [Wed, 3 Jun 2020 15:22:36 +0000 (17:22 +0200)]
update proxmox-backup crate to 0.2.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dietmar Maurer [Tue, 2 Jun 2020 10:18:59 +0000 (12:18 +0200)]
bump version to 0.1.5-1
Dietmar Maurer [Tue, 2 Jun 2020 10:16:47 +0000 (12:16 +0200)]
src/restore.rs: hold reference to the runtime
Dietmar Maurer [Tue, 2 Jun 2020 05:42:38 +0000 (07:42 +0200)]
avoid compiler warning
Thomas Lamprecht [Sat, 30 May 2020 15:02:46 +0000 (17:02 +0200)]
bump version to 0.1.4-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Sat, 30 May 2020 16:42:17 +0000 (18:42 +0200)]
restore: reuse the clients download_fixed_index
it's the same code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Sat, 30 May 2020 15:02:37 +0000 (17:02 +0200)]
Cargo.toml: update versions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Sat, 30 May 2020 15:01:36 +0000 (17:01 +0200)]
switch from failure to anyhow
Similarly to how we did in proxmox-backup in mid april
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dietmar Maurer [Wed, 11 Mar 2020 11:07:02 +0000 (12:07 +0100)]
bump version to 0.1.3-1
Dietmar Maurer [Wed, 11 Mar 2020 10:11:14 +0000 (11:11 +0100)]
call C-callback if send command fail
And fix previous commit.
Dietmar Maurer [Wed, 11 Mar 2020 09:33:15 +0000 (10:33 +0100)]
cleanup: use macro raise_error_int
Dietmar Maurer [Wed, 11 Mar 2020 09:24:23 +0000 (10:24 +0100)]
correctly convert error messages to CString
Dietmar Maurer [Wed, 11 Mar 2020 08:35:26 +0000 (09:35 +0100)]
remove debug statements
And print unrecoverable errors to stderr.
Dietmar Maurer [Tue, 10 Mar 2020 10:22:58 +0000 (11:22 +0100)]
bump version to 0.1.2-1
Dietmar Maurer [Tue, 10 Mar 2020 10:21:16 +0000 (11:21 +0100)]
build.rs: .with_include_guard("PROXMOX_BACKUP_QEMU_H")
Dietmar Maurer [Tue, 3 Mar 2020 07:04:07 +0000 (08:04 +0100)]
Makefile: upload to pve instead of pbs product
Dietmar Maurer [Tue, 3 Mar 2020 06:55:59 +0000 (07:55 +0100)]
Makefile: add upload target
Dietmar Maurer [Tue, 3 Mar 2020 06:47:07 +0000 (07:47 +0100)]
depend on specific proxmox-backup git version
Dietmar Maurer [Wed, 19 Feb 2020 12:13:14 +0000 (13:13 +0100)]
fix compile errors