]> git.proxmox.com Git - qemu-server.git/commit
refactor: split qemu_machine_feature_enabled
authorStefan Reiter <s.reiter@proxmox.com>
Tue, 19 Nov 2019 11:23:49 +0000 (12:23 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Nov 2019 17:32:35 +0000 (18:32 +0100)
commit2ea5fb7ecf61349345a93a95f665dbe4a8cc493d
treef0ce53969bc1668960ef0c846e70b3eb645d97bd
parent3392d6cacf9725a778d4a29d0c7ca08e4b5c2d5d
refactor: split qemu_machine_feature_enabled

...into:

* PVE::QemuServer::Helpers::min_version: check a major.minor version
  string with a given major/minor version (this is equivalent to calling
  the old qemu_machine_feature_enabled with only $kvmver)
* PVE::QemuServer::Machine::extract_version: get major.minor version
  string from arbitrary machine type (e.g. pc-q35-4.0, ...)
* PVE::QemuServer::Machine::machine_version: helper to call
  extract_version automatically before min_version

Includes a cfg2cmd test case with pinned machine version.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm
PVE/QemuServer/Helpers.pm
PVE/QemuServer/Machine.pm
test/cfg2cmd/pinned-version.conf [new file with mode: 0644]
test/cfg2cmd/pinned-version.conf.cmd [new file with mode: 0644]