qemu-server/PVE/QemuServer
Stefan Reiter ac0077cc33 Use 'QEMU version' -> '+pve-version' mapping for machine types
The previously introduced approach can fail for pinned versions when a
new QEMU release is introduced. The saner approach is to use a mapping
that gives one pve-version for each QEMU release.

Fortunately, the old system has not been bumped yet, so we can still
change it without too much effort.

QEMU versions without a mapping are assumed to be pve0, 4.1 is mapped to
pve1 since thats what we had as our default previously.

Pinned machine versions (i.e. pc-i440fx-4.1) are always assumed to be
pve0, for specific pve-versions they'd have to be pinned as well (i.e.
pc-i440fx-4.1+pve1).

The new logic also makes the pve-version dynamic, and starts VMs with
the lowest possible 'feature-level', i.e. if a feature is only available
with 4.1+pve2, but the VM isn't using it, we still start it with
4.1+pve0.

We die if we don't support a version that is requested from us. This
allows us to use the pve-version as live-migration blocks (i.e. bumping
the version and then live-migrating a VM which uses the new feature (so
is running with the bumped version) to an outdated node will present the
user with a helpful error message and fail instead of silently modifying
the config and only failing *after* the migration).

$version_guard is introduced in config_to_command to use for features
that need to check pve-version, it automatically handles selecting the
newest necessary pve-version for the VM.

Tests have to be adjusted, since all of them now resolve to pve0 instead
of pve1. EXPECT_ERROR matching is changed to use 'eq' instead of regex
to allow special characters in error messages.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-02-12 10:32:57 +01:00
..
Agent.pm refactor: create QemuServer::Monitor for high-level QMP access 2019-11-20 16:29:23 +01:00
Cloudinit.pm cloudinit: fix vm start hanging with disk on ZFS 2019-10-18 21:40:34 +02:00
CPUConfig.pm Add CPUConfig file and migrate some helpers 2020-01-22 15:47:32 +01:00
Helpers.pm add new helper to calculate timeout based on vm config 2020-01-15 17:36:16 +01:00
ImportDisk.pm qm importdisk: tell user to what VM disk we actually imported 2019-10-29 19:11:21 +01:00
Machine.pm Use 'QEMU version' -> '+pve-version' mapping for machine types 2020-02-12 10:32:57 +01:00
Makefile Add CPUConfig file and migrate some helpers 2020-01-22 15:47:32 +01:00
Memory.pm refactor: create QemuServer::Monitor for high-level QMP access 2019-11-20 16:29:23 +01:00
Monitor.pm mon_cmd: add explicit return 2019-11-30 17:24:55 +01:00
OVF.pm Initial support for importing OVF virtual machines 2017-09-25 13:31:55 +02:00
PCI.pm fix #2566: increase scsi limit to 31 2020-01-31 20:26:26 +01:00
USB.pm usb: Add USB3 capabilities to Spice USB devices 2019-09-21 13:22:17 +02:00