From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E6AF863E2E for ; Wed, 28 Oct 2020 22:52:09 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D0CEA23694 for ; Wed, 28 Oct 2020 22:51:39 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 9494023684 for ; Wed, 28 Oct 2020 22:51:35 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 61D6345F65 for ; Wed, 28 Oct 2020 22:51:35 +0100 (CET) To: Proxmox VE development discussion , Stefan Reiter References: <20201022153420.16971-1-s.reiter@proxmox.com> <20201022153420.16971-4-s.reiter@proxmox.com> From: Thomas Lamprecht Message-ID: Date: Wed, 28 Oct 2020 22:51:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Thunderbird/83.0 MIME-Version: 1.0 In-Reply-To: <20201022153420.16971-4-s.reiter@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.130 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [commands.rs, lib.rs] Subject: [pve-devel] applied: [PATCH proxmox-backup-qemu 3/4] add state serializing and loading functions X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 21:52:10 -0000 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 > --- > > 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!