plugin: add machine version to qemu_blockdev_options() interface

Plugins can guard based on the machine version to be able to switch
drivers or options in a safe way without the risk of breaking older
versions.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner
2025-07-02 18:27:46 +02:00
committed by Fabian Grünbichler
parent 2d874037f3
commit 6c07619abd
6 changed files with 16 additions and 8 deletions

View File

@ -721,7 +721,7 @@ sub abs_filesystem_path {
# see the documentation for the plugin method
sub qemu_blockdev_options {
my ($cfg, $volid, $options) = @_;
my ($cfg, $volid, $machine_version, $options) = @_;
my ($storeid, $volname) = parse_volume_id($volid);
@ -733,7 +733,7 @@ sub qemu_blockdev_options {
die "cannot use volume of type '$vtype' as a QEMU blockdevice\n"
if $vtype ne 'images' && $vtype ne 'iso' && $vtype ne 'import';
return $plugin->qemu_blockdev_options($scfg, $storeid, $volname, $options);
return $plugin->qemu_blockdev_options($scfg, $storeid, $volname, $machine_version, $options);
}
# used as last resort to adapt volnames when migrating