Commit Graph

322 Commits

Author SHA1 Message Date
Stefan Reiter
f93eb14256 return version via rust fn instead of header define
Otherwise the string gets included in the QEMU binary, not the library.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-11-25 08:27:29 +01:00
Fabian Grünbichler
da4058c9cf fingerprint: rename variables
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-25 08:22:18 +01:00
Fabian Grünbichler
8b74ed31c7 encryption key tracking: use fingerprint
but accept old variant as well for now, to not invalidate bitmaps for
freshly migrated VMs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-25 08:22:18 +01:00
Dietmar Maurer
20ce68ffe7 depend on proxmox-backup v1.0.4 2020-11-25 08:22:18 +01:00
Dietmar Maurer
36d5c84ec4 bump version to 1.0.1-1 2020-11-24 09:09:24 +01:00
Dietmar Maurer
1e45883f00 depend on proxmox-backup v1.0.3 2020-11-24 09:07:02 +01:00
Fabian Grünbichler
435f6bd7a7 restore: improve error if key is missing
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-24 08:48:38 +01:00
Fabian Grünbichler
5325b94b39 adapt to proxmox-backup fingerprint changes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-24 08:48:08 +01:00
Fabian Grünbichler
98ecf27deb bump version to 1.0.0-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-11 15:22:39 +01:00
Stefan Reiter
2eb96573b8 include crate version and git rev in header file
...so we can get the library version a binary is currently running with.

Version information is retrieved from the build environment (set by
cargo/make) and appended using 'with_after_include' to appear within the
include guard.

The version string in current-api.h is inconsequential, so ignore it in
diff. This way we only have to re-commit that file whenever the *actual*
API changes, not the version.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>

modified to avoid spawning subcommands

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-11 15:22:35 +01:00
Fabian Grünbichler
dbb900ce4f update dependencies
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-11 14:27:36 +01:00
Fabian Grünbichler
296da58610 update to proxmox 0.6/proxmox-backup 0.9.4
and implement the switch to Authid, which means API token support for
free.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-10-30 15:17:53 +01:00
Thomas Lamprecht
d83cc3fe8d bump version to 0.7.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-28 22:12:47 +01:00
Thomas Lamprecht
ab388dc8f8 d/control: track some more build-dependencies
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-28 22:12:47 +01:00
Thomas Lamprecht
84641743c6 cargo: update proxmox dependencies to 0.9.0 and 0.5.0, respectively
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-28 22:10:14 +01:00
Stefan Reiter
c28f578e09 add state serializing and loading functions
For dirty-bitmap migration, QEMU also needs to move the static state of
the library to the target. proxmox_{import,export}_state provide a means
of accessing said data in a serialized fashion.

QEMU treats the state as some unknown quantity of bytes and the result
does not need to be human-readable, so we encode it with 'bincode',
which is based on serde.

Since the quantity is only known *after* serialization, we have to
allocate the buffer ourselves. This is handled by Box::leak-ing a Rust
allocated buffer and cleaning up via the explicit
proxmox_free_state_buf function.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-10-28 22:08:05 +01:00
Thomas Lamprecht
58437c69e4 cargo: update authors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-22 10:13:54 +02:00
Fabian Grünbichler
5a82749a29 invalidate bitmap when crypto key changes
by computing and remembering the ID digest of a static string, we can
detect when the passed in key has changed without keeping a copy of it
around inbetween backup jobs.

this is a follow-up/fixup for

104fae9111 fix #2866: invalidate bitmap on crypt_mode change

which implemented detection for crypt MODE changes.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-10-22 10:08:27 +02:00
Fabian Grünbichler
2a5e2623af update to proxmox-backup 0.9.1
and pass along any port set in the repository string

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-10-22 10:08:27 +02:00
Thomas Lamprecht
e410210409 update dependencies for proxmox and proxmox-backup
drop chrono depedency as proxmox-backup did

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-26 15:23:26 +02:00
Fabian Grünbichler
9de6d63356 update to new BackupDir constructor
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-09-11 16:15:06 +02:00
Thomas Lamprecht
304b75f554 bump version to 0.7.0-1
Supersedes bad 0.7.1-1 bump...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-10 10:48:38 +02:00
Thomas Lamprecht
935fe25beb bump version to 0.7.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-10 10:47:48 +02:00
Thomas Lamprecht
329596526f updated to BackupWriter::start signature change
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-10 10:47:11 +02:00
Thomas Lamprecht
6d9c765703 bump version to 0.7.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-10 10:37:21 +02:00
Thomas Lamprecht
0c9ad80b00 update proxmox* dependencies
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-10 10:35:03 +02:00
Thomas Lamprecht
a52765504d bump version to 0.6.4-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-19 16:44:30 +02:00
Wolfgang Bumiller
78552edbec deduplicate 'not connected' error cases
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-13 10:10:05 +02:00
Wolfgang Bumiller
bbb2d9774b clippy: allow mutex_atomic with condvar
clippy complains that a `Mutex<Bool>` could just as well be
an `AtomicBool`, but we also use a `Condvar`, so it cannot.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-13 10:07:08 +02:00
Wolfgang Bumiller
3ed30abe19 clippy: remove unnecessary mut
curiously this one is also not caught by rustc

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-13 10:03:46 +02:00
Wolfgang Bumiller
0e1ddb09b5 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>
2020-08-13 09:54:00 +02:00
Wolfgang Bumiller
a2841b1b2b clippy lints
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-13 09:50:55 +02:00
Wolfgang Bumiller
642925ba64 readability cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-13 09:31:03 +02:00
Fabian Grünbichler
104fae9111 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>
2020-08-13 09:12:20 +02:00
Fabian Grünbichler
252aad7c2c 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>
2020-08-13 09:12:17 +02:00
Fabian Grünbichler
5412257e61 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>
2020-08-13 09:12:08 +02:00
Fabian Grünbichler
40b4b92b4e bump version to 0.6.3-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-08-12 13:56:28 +02:00
Fabian Grünbichler
d9cca59bf1 build: fix make -j
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-08-12 09:58:36 +02:00
Wolfgang Bumiller
7e0070d5ff bump proxmox-backup to 0.8.10
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-12 09:35:57 +02:00
Wolfgang Bumiller
4474d57de5 Cargo.toml: sort dependencies
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-12 09:30:22 +02:00
Fabian Grünbichler
27258ee3f3 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>
2020-08-11 10:53:44 +02:00
Thomas Lamprecht
3b9fedd453 relay proxmox dependency to 0.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-24 11:57:25 +02:00
Thomas Lamprecht
ad42a986e6 bump version to 0.6.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-23 11:39:30 +02:00
Thomas Lamprecht
a11dd969ed update proxmox and proxmox-backup crates
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-23 11:35:26 +02:00
Stefan Reiter
a9e0937c2d 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>
2020-07-22 20:28:19 +02:00
Stefan Reiter
8e63f0386d 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>
2020-07-22 20:28:19 +02:00
Dietmar Maurer
edd88ae902 bump version to 0.6.1-1 2020-07-09 14:23:49 +02:00
Stefan Reiter
2d0a8bea2c 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>
2020-07-09 14:22:13 +02:00
Dietmar Maurer
58d1ab0bd4 bump version to 0.6.0-1 2020-07-09 12:21:03 +02:00
Dietmar Maurer
56e887fd17 produce correct manifest 2020-07-09 12:18:46 +02:00