From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2BF891FF15C for ; Fri, 31 Oct 2025 11:37:20 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1245EEBB8; Fri, 31 Oct 2025 11:37:26 +0100 (CET) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Fri, 31 Oct 2025 11:36:13 +0100 Message-ID: <20251031103709.60233-7-f.weber@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251031103709.60233-1-f.weber@proxmox.com> References: <20251031103709.60233-1-f.weber@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761907024604 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.013 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server 1/1] fix #5779: vm start: pass storage hints when activating guest volumes 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Currently supported hints are - 'guest-is-windows' to denote a Windows guest, - 'plugin-may-deactivate-volume' which denotes that the plugin may deactivate and re-activate a volume to apply a hint. Currently the only consumer of hints is the RBD plugin. In case a Windows VM guest volume is mapped using KRBD, certain VM workloads may cause degraded performance and e.g. "libceph: [...] bad crc/signature" messages in the host journal. A workaround is to pass the rxbounce option when mapping the volume [1]. If 'guest-is-windows' is set to 1, the RBD plugin will map the guest volume with the rxbounce option. [1] https://docs.ceph.com/en/squid/man/8/rbd/#kernel-rbd-krbd-options Signed-off-by: Friedrich Weber --- src/PVE/QemuServer.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index cf195ccc..17ddd39b 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -5363,6 +5363,21 @@ my sub remove_left_over_vmstate_opts { PVE::QemuConfig->write_config($vmid, $conf) if $found; } +sub generate_storage_hints { + my ($conf, $plugin_may_deactivate_volume) = @_; + + my $hints = {}; + + if (PVE::Storage::Plugin::is_hint_supported('guest-is-windows')) { + $hints->{'guest-is-windows'} = int(!!windows_version($conf->{ostype})); + } + if (PVE::Storage::Plugin::is_hint_supported('plugin-may-deactivate-volume')) { + $hints->{'plugin-may-deactivate-volume'} = $plugin_may_deactivate_volume || 0; + } + + return $hints; +} + # see vm_start_nolock for parameters, additionally: # migrate_opts: # storagemap = parsed storage map for allocating NBD disks @@ -5530,7 +5545,9 @@ sub vm_start_nolock { my $pci_reserve_list = []; eval { # With -blockdev, it is necessary to activate the volumes before generating the command line - PVE::Storage::activate_volumes($storecfg, $vollist); + # Plugins can safely deactivate already-active volumes here if needed + my $storage_hints = generate_storage_hints($conf, 1); + PVE::Storage::activate_volumes($storecfg, $vollist, undef, $storage_hints); # Note that for certain cases like templates, the configuration is minimized, so need to ensure # the rest of the function here uses the same configuration that was used to build the command -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel