[pve-devel] applied: [PATCH proxmox-backup-qemu 3/4] add state serializing and loading functions

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Oct 28 22:51:34 CET 2020


On 22.10.20 17:34, Stefan Reiter wrote:
> 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 at proxmox.com>
> ---
> 
> I'm not sure we use 'bincode' anywhere else, but it is packaged for debian
> already and seemed like a good fit. Alternatively, we could of course use our
> already existing dependency on serde_json and just serialize to a JSON string.
> 
>  Cargo.toml      |  1 +
>  current-api.h   | 20 ++++++++++++++++++++
>  src/commands.rs | 19 +++++++++++++++++++
>  src/lib.rs      | 34 ++++++++++++++++++++++++++++++++++
>  4 files changed, 74 insertions(+)
> 
>

applied, thanks!





More information about the pve-devel mailing list