From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <t.lamprecht@proxmox.com>
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))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 34DDF6B4B6
 for <pve-devel@lists.proxmox.com>; Tue, 16 Mar 2021 20:48:38 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 29A8E26F9E
 for <pve-devel@lists.proxmox.com>; Tue, 16 Mar 2021 20:48:38 +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))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 6A3F726F8D
 for <pve-devel@lists.proxmox.com>; Tue, 16 Mar 2021 20:48:36 +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 3630846434
 for <pve-devel@lists.proxmox.com>; Tue, 16 Mar 2021 20:48:36 +0100 (CET)
Message-ID: <6ad8627d-a5b2-4dba-a546-23add9fc127f@proxmox.com>
Date: Tue, 16 Mar 2021 20:48:34 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:87.0) Gecko/20100101
 Thunderbird/87.0
Content-Language: en-US
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Stefan Reiter <s.reiter@proxmox.com>
References: <20210316163023.24534-1-s.reiter@proxmox.com>
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
In-Reply-To: <20210316163023.24534-1-s.reiter@proxmox.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.047 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. [proxmox.com]
Subject: [pve-devel] applied: [PATCH pve-qemu 1/2] fix saving and loading
 dirty bitmaps in snapshots
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 16 Mar 2021 19:48:38 -0000

On 16.03.21 17:30, Stefan Reiter wrote:
> Saving dirty bitmaps from our savevm-async code didn't work, since we
> use a coroutine which holds the iothread mutex already (upstream savevm
> is sync, migration uses a thread). Release the mutex before calling the
> one function that (according to it's documentation) requires the lock to
> *not* be held: qemu_savevm_state_pending.
> 
> Additionally, loading dirty bitmaps requires a call to
> dirty_bitmap_mig_before_vm_start after "loadvm", which the upstream
> savevm does explicitly afterwards - do that too.
> 
> This is exposed via the query-proxmox-support property
> "pbs-dirty-bitmap-savevm".
> 
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
> 
> This fixes a bug reported in the forum[0] as well as enterprise support.
> 
> This patch contains the actual fix, i.e. what makes it not crash, but we can
> actually go one step further, and by adding the query-proxmox-support info we
> can avoid crashes even with older versions (see patch 2/2).
> 
> As a neat side-effect, this also allows us to fix dirty bitmaps for snapshots
> and hibernate/resume, so that's a plus :)
> 
> [0] https://forum.proxmox.com/threads/query-savevm.85719/
> 
>  ...async-for-background-state-snapshots.patch | 15 +++++++++++----
>  ...add-optional-buffer-size-to-QEMUFile.patch |  6 +++---
>  ...dd-query_proxmox_support-QMP-command.patch | 19 ++++++++++++-------
>  ...E-add-query-pbs-bitmap-info-QMP-call.patch | 17 ++++++++++-------
>  ...-transaction-to-synchronize-job-stat.patch |  2 +-
>  ...-block-on-finishing-and-cleanup-crea.patch |  4 ++--
>  ...igrate-dirty-bitmap-state-via-savevm.patch | 18 ++++++++++--------
>  ...routine-QMP-for-backup-cancel_backup.patch |  4 ++--
>  .../pve/0043-PBS-add-master-key-support.patch | 16 ++++++++--------
>  9 files changed, 59 insertions(+), 42 deletions(-)
> 
>

applied, thanks!