Commit Graph

152 Commits

Author SHA1 Message Date
Thomas Lamprecht
7d86d18cb1 bump version to 0.3.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-06 19:54:27 +02:00
Dietmar Maurer
2917839966 src/restore.rs: use OnceCell to avoid locking 2020-07-06 14:08:07 +02:00
Dietmar Maurer
b26a8db3f1 src/worker_task.rs: use OnceCell to avoid locking 2020-07-06 13:54:21 +02:00
Dietmar Maurer
ca590e8fb9 current-api.h: update to include changes from previous commit 2020-07-06 13:31:31 +02:00
Dietmar Maurer
11e42d4a5a add proxmox_backup_check_incremental() api 2020-07-06 13:01:05 +02:00
Dietmar Maurer
3be7064120 current-api.h: update to include changes from previous commit 2020-07-06 12:26:31 +02:00
Dietmar Maurer
6c7a5ca24a 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()
2020-07-06 11:38:58 +02:00
Dietmar Maurer
932df89793 add restore data reading API
For accessing existing backups in a VM.
2020-07-06 09:59:18 +02:00
Stefan Reiter
06c101f73f make Registry generic and add ImageAccessInfo
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-07-03 06:40:08 +02:00
Dietmar Maurer
6a125fbc6c bump version to 0.3.1-1 2020-07-02 12:07:45 +02:00
Dietmar Maurer
3b024418cc write_data: return 0 for reused chunks 2020-07-02 10:34:10 +02:00
Dietmar Maurer
0e78f924a9 bump version to 0.3.0-1 2020-07-02 07:43:48 +02:00
Dietmar Maurer
240b35a097 log abort error to stderr 2020-07-02 07:41:47 +02:00
Dietmar Maurer
465e5f75e1 cleanup: remove stale comments 2020-07-02 07:34:47 +02:00
Dietmar Maurer
9aaaafd7b0 make restore api thread safe 2020-07-02 07:28:50 +02:00
Dietmar Maurer
8c1d828c02 cleanup (use better name) 2020-07-02 07:13:29 +02:00
Dietmar Maurer
26d3718833 current-api.h: update docs 2020-07-02 07:12:51 +02:00
Dietmar Maurer
c9c4a5788b make backup C api thread safe
Protect everything with a Mutex, so it is now allowed to make parallel
calls from different threads.
2020-07-02 07:01:12 +02:00
Dietmar Maurer
12a00649f7 Revert "avoid mutexes"
This reverts commit 96afa3d02c.

Turns out we cannot guarantee correct locking at caller site ...
2020-07-01 17:01:36 +02:00
Dietmar Maurer
6b674b5d13 improve error message 2020-07-01 13:17:58 +02:00
Dietmar Maurer
18a32972e4 add_config: use Vec<u8> instead of DataPointer 2020-07-01 12:54:22 +02:00
Dietmar Maurer
96afa3d02c avoid mutexes 2020-07-01 11:16:33 +02:00
Dietmar Maurer
c318755f21 simpletest.c: fix error check 2020-07-01 10:44:10 +02:00
Dietmar Maurer
3e5db190ca avoid extra worker thread and command channel 2020-07-01 10:29:15 +02:00
Thomas Lamprecht
c4214b4ec2 bump version to 0.2.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-30 12:27:14 +02:00
Wolfgang Bumiller
1c56dc4822 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>
2020-06-30 10:51:40 +02:00
Wolfgang Bumiller
b6e17373fd 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>
2020-06-29 13:14:46 +02:00
Dietmar Maurer
93bc6c3be1 depend on proxmox-backup v0.5.0 2020-06-29 13:06:29 +02:00
Dietmar Maurer
2117056cc1 also upload _dbgsym_ .deb 2020-06-29 09:41:27 +02:00
Dietmar Maurer
49964c2cb6 bump version to 0.1.8-1 2020-06-29 09:36:25 +02:00
Dietmar Maurer
fabeaf9cf1 proxmox_backup_connect: return info about previous backup 2020-06-29 09:34:18 +02:00
Dietmar Maurer
598e872f87 use bool type for incremental flag 2020-06-29 09:02:15 +02:00
Dietmar Maurer
bac8a345dc simpletest.c: fix compile error 2020-06-26 11:55:17 +02:00
Dietmar Maurer
a78a6778b9 bump version to 0.1.7-1 2020-06-26 11:44:07 +02:00
Dietmar Maurer
d5f033634e simplify code 2020-06-26 11:37:02 +02:00
Stefan Reiter
cefb437a05 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>
2020-06-26 11:03:05 +02:00
Stefan Reiter
22c6bca881 make compatible with newest proxmox-backup crate
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-06-24 10:40:16 +02:00
Thomas Lamprecht
7516d705b9 bump version to 0.1.6-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-04 10:48:50 +02:00
Thomas Lamprecht
67cac4a365 update proxmox-backup crate to 0.2.3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-04 10:48:07 +02:00
Dominik Csapak
391ec76798 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>
2020-06-04 07:00:06 +02:00
Thomas Lamprecht
5e800b33e7 update proxmox-backup crate to 0.2.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-03 17:22:41 +02:00
Dietmar Maurer
eb03d47afd bump version to 0.1.5-1 2020-06-02 12:18:59 +02:00
Dietmar Maurer
d4db809a8a src/restore.rs: hold reference to the runtime 2020-06-02 12:16:47 +02:00
Dietmar Maurer
234bd5a47c avoid compiler warning 2020-06-02 07:42:38 +02:00
Thomas Lamprecht
18e663ce6f bump version to 0.1.4-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-30 18:42:42 +02:00
Thomas Lamprecht
564910b080 restore: reuse the clients download_fixed_index
it's the same code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-30 18:42:42 +02:00
Thomas Lamprecht
20f1402e6b Cargo.toml: update versions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-30 17:02:37 +02:00
Thomas Lamprecht
3e77a02983 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>
2020-05-30 17:01:38 +02:00
Dietmar Maurer
569a861e68 bump version to 0.1.3-1 2020-03-11 12:07:02 +01:00
Dietmar Maurer
fc9bf0e863 call C-callback if send command fail
And fix previous commit.
2020-03-11 11:11:14 +01:00