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 <[email protected]> --- 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 [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
