From: Fiona Ebner <f.ebner@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH v2 qemu-server 3/5] helpers: add helper for min package version comparison
Date: Wed, 19 Aug 2026 18:37:22 +0200 [thread overview]
Message-ID: <9680a64f-0a1f-4db0-8da4-3e9921ea27fd@proxmox.com> (raw)
In-Reply-To: <20260819144642.453513-4-c.ebner@proxmox.com>
Am 19.08.26 um 4:46 PM schrieb Christian Ebner:
> To be used for checking the minimum version of qemu-kvm package
> version, where the binary version check is not enough to detect
> versions having the pbs-restore `no-cache` flag.
>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
> changes:
> - new in version 2
>
> src/PVE/QemuServer/Helpers.pm | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
> index 658400f2..860c0a9c 100644
> --- a/src/PVE/QemuServer/Helpers.pm
> +++ b/src/PVE/QemuServer/Helpers.pm
> @@ -21,6 +21,7 @@ our @EXPORT_OK = qw(
> parse_number_sets
> windows_version
> get_host_arch
> + min_package_version
> );
>
> my $nodename = PVE::INotify::nodename();
> @@ -89,6 +90,19 @@ sub kvm_user_version {
> return $kvm_user_version->{$binary}->{$version_type};
> }
>
> +sub min_package_version {
I'd rather have the helper be binary_package_version_at_least() and take
the $binary instead of $verstr. It can call kvm_user_version itself.
Then there is less potential for somebody to pass along the wrong kind
of version.
> + my ($verstr, $major, $minor, $patch, $subver, $rel) = @_;
s/$patch/$micro/
No need for $subver, see the previous patch
> +
> + if ($verstr =~ m/^(\d+)\.(\d+)(?:\.(\d+))?(?:\.(\d+))?-(\d+)/) {
> + return 1
> + if version_cmp($1, $major, $2, $minor, $3 // 0, $patch, $4 // 0, $subver, $5, $rel) >=
> + 0;
Style nit: multi-line post-if
> + return 0;
> + }
> +
> + die "internal error: cannot check version of invalid string '$verstr'";
> +}
> +
> # Paths and directories
>
> # FIXME: MAJOR VERSION: use /run/qemu-server everywhere instead of mixing /run and /var/run and rely
next prev parent reply other threads:[~2026-08-19 16:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
2026-08-19 14:46 ` [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore Christian Ebner
2026-08-19 16:44 ` Fiona Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 2/5] helpers: optionally get package version for kvm_user_version() Christian Ebner
2026-08-19 16:37 ` Fiona Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 3/5] helpers: add helper for min package version comparison Christian Ebner
2026-08-19 16:37 ` Fiona Ebner [this message]
2026-08-19 14:46 ` [PATCH v2 qemu-server 4/5] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 5/5] vma restore: skip page cache " Christian Ebner
2026-08-19 16:44 ` [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Jonas Theisen
2026-08-20 9:06 ` Christian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9680a64f-0a1f-4db0-8da4-3e9921ea27fd@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=c.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.