* [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two
@ 2025-06-23 15:44 Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 01/15] fix #5985: qmp client: increase timeout for {device, netdev, object}_{add, del} commands Fiona Ebner
` (16 more replies)
0 siblings, 17 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Set default timeouts for blockdev QMP commands (picked up the series
from [0] and rebased).
Factor out more code into dedicated modules, most notably for qemu-img
and OVMF.
Add helper to generate blockdev commandline for EFI disks based on
Alexandre's patch, carrying along the necessary workarounds.
New version of final patch to switch to -blockdev, should not be
applied yet, support for all operations is still missing, that will
follow in a separate series.
[0]: https://lore.proxmox.com/pve-devel/20241212100247.20926-1-f.ebner@proxmox.com/
Fiona Ebner (15):
fix #5985: qmp client: increase timeout for
{device,netdev,object}_{add,del} commands
qmp client: add default timeouts for more blockdev commands
helpers: add missing includes
helpers: fix perlcritic warning about variables named $a and $b
move helper for iscsi initiator name to helpers module and improve
name
introduce QemuImage module
introduce OVMF module
blockdev: re-use cache setting from child node
blockdev: add workaround for issue #3229
blockdev: add support for 'size' option
ovmf: add support for using blockdev
cfg2cmd: ovmf: support print_ovmf_commandline() returning machine
flags
print drive device: don't reference any drive for 'none' starting with
machine version 10.0
blockdev: add support for NBD paths
command line: switch to blockdev starting with machine version 10.0
src/PVE/API2/Qemu.pm | 13 +-
src/PVE/QMPClient.pm | 12 +
src/PVE/QemuMigrate.pm | 3 +-
src/PVE/QemuServer.pm | 491 ++++++------------
src/PVE/QemuServer/Blockdev.pm | 48 +-
src/PVE/QemuServer/Helpers.pm | 27 +-
src/PVE/QemuServer/ImportDisk.pm | 6 +-
src/PVE/QemuServer/Makefile | 2 +
src/PVE/QemuServer/OVMF.pm | 251 +++++++++
src/PVE/QemuServer/QemuImage.pm | 123 +++++
src/test/MigrationTest/Shared.pm | 4 +
src/test/cfg2cmd/aio.conf.cmd | 42 +-
src/test/cfg2cmd/bootorder-empty.conf.cmd | 13 +-
src/test/cfg2cmd/bootorder-legacy.conf.cmd | 13 +-
src/test/cfg2cmd/bootorder.conf.cmd | 13 +-
...putype-icelake-client-deprecation.conf.cmd | 7 +-
src/test/cfg2cmd/efi-raw-template.conf.cmd | 7 +-
src/test/cfg2cmd/efi-raw.conf.cmd | 7 +-
.../cfg2cmd/efi-secboot-and-tpm-q35.conf.cmd | 7 +-
src/test/cfg2cmd/efi-secboot-and-tpm.conf.cmd | 7 +-
src/test/cfg2cmd/efidisk-on-rbd.conf.cmd | 7 +-
src/test/cfg2cmd/ide.conf.cmd | 15 +-
src/test/cfg2cmd/q35-ide.conf.cmd | 15 +-
.../q35-linux-hostpci-mapping.conf.cmd | 7 +-
.../q35-linux-hostpci-multifunction.conf.cmd | 7 +-
.../q35-linux-hostpci-template.conf.cmd | 10 +-
...q35-linux-hostpci-x-pci-overrides.conf.cmd | 7 +-
src/test/cfg2cmd/q35-linux-hostpci.conf.cmd | 7 +-
src/test/cfg2cmd/q35-simple.conf.cmd | 7 +-
src/test/cfg2cmd/seabios_serial.conf.cmd | 7 +-
src/test/cfg2cmd/sev-es.conf.cmd | 7 +-
src/test/cfg2cmd/sev-std.conf.cmd | 7 +-
src/test/cfg2cmd/simple-btrfs.conf.cmd | 16 +-
src/test/cfg2cmd/simple-cifs.conf.cmd | 16 +-
.../cfg2cmd/simple-disk-passthrough.conf.cmd | 9 +-
src/test/cfg2cmd/simple-lvm.conf.cmd | 12 +-
src/test/cfg2cmd/simple-lvmthin.conf.cmd | 12 +-
src/test/cfg2cmd/simple-rbd.conf.cmd | 28 +-
src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 7 +-
.../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 16 +-
src/test/cfg2cmd/simple1-template.conf.cmd | 10 +-
src/test/cfg2cmd/simple1.conf.cmd | 7 +-
src/test/run_config2command_tests.pl | 24 +-
src/test/run_qemu_img_convert_tests.pl | 19 +-
44 files changed, 878 insertions(+), 497 deletions(-)
create mode 100644 src/PVE/QemuServer/OVMF.pm
create mode 100644 src/PVE/QemuServer/QemuImage.pm
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 01/15] fix #5985: qmp client: increase timeout for {device, netdev, object}_{add, del} commands
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 02/15] qmp client: add default timeouts for more blockdev commands Fiona Ebner
` (15 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
In the bug report, the user mentioned that 7 seconds was enough. For
the HMP 'drive_add' command, the used timeout is 1 minute and for the
'drive_del' command, the used timeout is 10 minutes, because IO might
need to be finished. While something similar might be true for certain
objects/devices, there were no issues reported with the *_del
operations using the default timeout until now and the callers can
still use a higher timeout if they know the specific device/object
requires it.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QMPClient.pm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/PVE/QMPClient.pm b/src/PVE/QMPClient.pm
index f2d177b6..dec5276d 100644
--- a/src/PVE/QMPClient.pm
+++ b/src/PVE/QMPClient.pm
@@ -118,6 +118,15 @@ sub cmd {
# the variance for Windows guests can be big. And there might be hook scripts
# that are executed upon thaw, so use 3 minutes to be on the safe side.
$timeout = 3 * 60;
+ } elsif (
+ $cmd->{execute} eq 'device_add'
+ || $cmd->{execute} eq 'device_del'
+ || $cmd->{execute} eq 'netdev_add'
+ || $cmd->{execute} eq 'netdev_del'
+ || $cmd->{execute} eq 'object-add'
+ || $cmd->{execute} eq 'object-del'
+ ) {
+ $timeout = 60;
} elsif (
$cmd->{execute} eq 'backup-cancel'
|| $cmd->{execute} eq 'blockdev-snapshot-delete-internal-sync'
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 02/15] qmp client: add default timeouts for more blockdev commands
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 01/15] fix #5985: qmp client: increase timeout for {device, netdev, object}_{add, del} commands Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 03/15] helpers: add missing includes Fiona Ebner
` (14 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
For the HMP 'drive_add' command, the used timeout is 1 minute and for the
'drive_del' command, the used timeout is 10 minutes, because IO might
need to be finished. Use the same for 'blockdev-add' respectively
'blockdev-del'.
For 'drive-mirror', 10 minutes is used, so use the same for
'blockdev-mirror'.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QMPClient.pm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QMPClient.pm b/src/PVE/QMPClient.pm
index dec5276d..87d61144 100644
--- a/src/PVE/QMPClient.pm
+++ b/src/PVE/QMPClient.pm
@@ -119,7 +119,8 @@ sub cmd {
# that are executed upon thaw, so use 3 minutes to be on the safe side.
$timeout = 3 * 60;
} elsif (
- $cmd->{execute} eq 'device_add'
+ $cmd->{execute} eq 'blockdev-add'
+ || $cmd->{execute} eq 'device_add'
|| $cmd->{execute} eq 'device_del'
|| $cmd->{execute} eq 'netdev_add'
|| $cmd->{execute} eq 'netdev_del'
@@ -129,6 +130,8 @@ sub cmd {
$timeout = 60;
} elsif (
$cmd->{execute} eq 'backup-cancel'
+ || $cmd->{execute} eq 'blockdev-del'
+ || $cmd->{execute} eq 'blockdev-mirror'
|| $cmd->{execute} eq 'blockdev-snapshot-delete-internal-sync'
|| $cmd->{execute} eq 'blockdev-snapshot-internal-sync'
|| $cmd->{execute} eq 'block-job-cancel'
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 03/15] helpers: add missing includes
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 01/15] fix #5985: qmp client: increase timeout for {device, netdev, object}_{add, del} commands Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 02/15] qmp client: add default timeouts for more blockdev commands Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 04/15] helpers: fix perlcritic warning about variables named $a and $b Fiona Ebner
` (13 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/Helpers.pm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index a9b2cb90..81cc9022 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -4,8 +4,10 @@ use strict;
use warnings;
use File::stat;
+use IO::File;
use JSON;
+use PVE::Cluster;
use PVE::INotify;
use PVE::ProcFSTools;
use PVE::Tools qw(get_host_arch);
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 04/15] helpers: fix perlcritic warning about variables named $a and $b
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (2 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 03/15] helpers: add missing includes Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 05/15] move helper for iscsi initiator name to helpers module and improve name Fiona Ebner
` (12 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
> Using $a or $b outside sort() at line 193, column 13. $a and $b are
> special package variables for use in sort() and related functions.
> Declaring them as lexicals like "my $a" may break sort(). Use
> different variable names. (Severity: 4)
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/Helpers.pm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index 81cc9022..9ec989f7 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -190,12 +190,12 @@ sub version_cmp {
}
for (my $i = 0; $i < $size; $i += 2) {
- my ($a, $b) = splice(@versions, 0, 2);
- $a //= 0;
- $b //= 0;
+ my ($left, $right) = splice(@versions, 0, 2);
+ $left //= 0;
+ $right //= 0;
- return 1 if $a > $b;
- return -1 if $a < $b;
+ return 1 if $left > $right;
+ return -1 if $left < $right;
}
return 0;
}
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 05/15] move helper for iscsi initiator name to helpers module and improve name
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (3 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 04/15] helpers: fix perlcritic warning about variables named $a and $b Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-24 9:48 ` Fabian Grünbichler
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 06/15] introduce QemuImage module Fiona Ebner
` (11 subsequent siblings)
16 siblings, 1 reply; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 21 ++++-----------------
src/PVE/QemuServer/Helpers.pm | 15 +++++++++++++++
src/test/run_config2command_tests.pl | 2 +-
src/test/run_qemu_img_convert_tests.pl | 2 +-
4 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 71376edc..b67fe832 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -51,7 +51,8 @@ use PVE::Tools
use PVE::QMPClient;
use PVE::QemuConfig;
use PVE::QemuConfig::NoWrite;
-use PVE::QemuServer::Helpers qw(config_aware_timeout min_version kvm_user_version windows_version);
+use PVE::QemuServer::Helpers
+ qw(config_aware_timeout get_iscsi_initiator_name min_version kvm_user_version windows_version);
use PVE::QemuServer::Cloudinit;
use PVE::QemuServer::CGroup;
use PVE::QemuServer::CPUConfig
@@ -1506,20 +1507,6 @@ sub print_drivedevice_full {
return $device;
}
-sub get_initiator_name {
- my $initiator;
-
- my $fh = IO::File->new('/etc/iscsi/initiatorname.iscsi') || return;
- while (defined(my $line = <$fh>)) {
- next if $line !~ m/^\s*InitiatorName\s*=\s*([\.\-:\w]+)/;
- $initiator = $1;
- last;
- }
- $fh->close();
-
- return $initiator;
-}
-
sub print_drive_commandline_full {
my ($storecfg, $vmid, $drive, $live_restore_name) = @_;
@@ -4010,7 +3997,7 @@ sub config_to_command {
my $scsihw = defined($conf->{scsihw}) ? $conf->{scsihw} : $defaults->{scsihw};
# Add iscsi initiator name if available
- if (my $initiator = get_initiator_name()) {
+ if (my $initiator = get_iscsi_initiator_name()) {
push @$devices, '-iscsi', "initiator-name=$initiator";
}
@@ -8357,7 +8344,7 @@ sub convert_iscsi_path {
my $target = $2;
my $lun = $3;
- my $initiator_name = get_initiator_name();
+ my $initiator_name = get_iscsi_initiator_name();
return "file.driver=iscsi,file.transport=tcp,file.initiator-name=$initiator_name,"
. "file.portal=$portal,file.target=$target,file.lun=$lun,driver=raw";
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index 9ec989f7..3e444839 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -16,6 +16,7 @@ use base 'Exporter';
our @EXPORT_OK = qw(
min_version
config_aware_timeout
+ get_iscsi_initiator_name
kvm_user_version
parse_number_sets
windows_version
@@ -296,4 +297,18 @@ sub needs_extraction {
return $vtype eq 'import' && $fmt =~ m/^ova\+(.*)$/;
}
+sub get_iscsi_initiator_name {
+ my $initiator;
+
+ my $fh = IO::File->new('/etc/iscsi/initiatorname.iscsi') || return;
+ while (defined(my $line = <$fh>)) {
+ next if $line !~ m/^\s*InitiatorName\s*=\s*([\.\-:\w]+)/;
+ $initiator = $1;
+ last;
+ }
+ $fh->close();
+
+ return $initiator;
+}
+
1;
diff --git a/src/test/run_config2command_tests.pl b/src/test/run_config2command_tests.pl
index 9f4ecabf..52fedd7b 100755
--- a/src/test/run_config2command_tests.pl
+++ b/src/test/run_config2command_tests.pl
@@ -248,7 +248,7 @@ $qemu_server_module->mock(
get_host_arch => sub() {
return $current_test->{host_arch} // 'x86_64';
},
- get_initiator_name => sub {
+ get_iscsi_initiator_name => sub {
return 'iqn.1993-08.org.debian:01:aabbccddeeff';
},
cleanup_pci_devices => {
diff --git a/src/test/run_qemu_img_convert_tests.pl b/src/test/run_qemu_img_convert_tests.pl
index 55144994..86eb53be 100755
--- a/src/test/run_qemu_img_convert_tests.pl
+++ b/src/test/run_qemu_img_convert_tests.pl
@@ -504,7 +504,7 @@ $qemu_server_module->mock(
run_command => sub {
$command = shift;
},
- get_initiator_name => sub {
+ get_iscsi_initiator_name => sub {
return "foobar";
},
);
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 06/15] introduce QemuImage module
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (4 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 05/15] move helper for iscsi initiator name to helpers module and improve name Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-25 12:54 ` Daniel Kral
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 07/15] introduce OVMF module Fiona Ebner
` (10 subsequent siblings)
16 siblings, 1 reply; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 122 ++----------------------
src/PVE/QemuServer/ImportDisk.pm | 6 +-
src/PVE/QemuServer/Makefile | 1 +
src/PVE/QemuServer/QemuImage.pm | 123 +++++++++++++++++++++++++
src/test/run_qemu_img_convert_tests.pl | 19 ++--
5 files changed, 148 insertions(+), 123 deletions(-)
create mode 100644 src/PVE/QemuServer/QemuImage.pm
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index b67fe832..63b4d469 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -72,6 +72,7 @@ use PVE::QemuServer::Memory qw(get_current_memory);
use PVE::QemuServer::MetaInfo;
use PVE::QemuServer::Monitor qw(mon_cmd);
use PVE::QemuServer::PCI qw(print_pci_addr print_pcie_addr print_pcie_root_port parse_hostpci);
+use PVE::QemuServer::QemuImage;
use PVE::QemuServer::QMPHelpers qw(qemu_deviceadd qemu_devicedel qemu_objectadd qemu_objectdel);
use PVE::QemuServer::RNG qw(parse_rng print_rng_device_commandline print_rng_object_commandline);
use PVE::QemuServer::StateFile;
@@ -7684,7 +7685,12 @@ sub restore_external_archive {
'is-zero-initialized' => $sparseinit,
'source-path-format' => $source_format,
};
- qemu_img_convert($source_path, $d->{volid}, $d->{size}, $convert_opts);
+ PVE::QemuServer::QemuImage::convert(
+ $source_path,
+ $d->{volid},
+ $d->{size},
+ $convert_opts,
+ );
};
my $err = $@;
eval { $backup_provider->restore_vm_volume_cleanup($volname, $d->{devname}, {}); };
@@ -8336,116 +8342,6 @@ sub template_create : prototype($$;$) {
);
}
-sub convert_iscsi_path {
- my ($path) = @_;
-
- if ($path =~ m|^iscsi://([^/]+)/([^/]+)/(.+)$|) {
- my $portal = $1;
- my $target = $2;
- my $lun = $3;
-
- my $initiator_name = get_iscsi_initiator_name();
-
- return "file.driver=iscsi,file.transport=tcp,file.initiator-name=$initiator_name,"
- . "file.portal=$portal,file.target=$target,file.lun=$lun,driver=raw";
- }
-
- die "cannot convert iscsi path '$path', unknown format\n";
-}
-
-# The possible options are:
-# bwlimit - The bandwidth limit in KiB/s.
-# is-zero-initialized - If the destination image is zero-initialized.
-# snapname - Use this snapshot of the source image.
-# source-path-format - Indicate the format of the source when the source is a path. For PVE-managed
-# volumes, the format from the storage layer is always used.
-sub qemu_img_convert {
- my ($src_volid, $dst_volid, $size, $opts) = @_;
-
- my ($bwlimit, $snapname) = $opts->@{qw(bwlimit snapname)};
-
- my $storecfg = PVE::Storage::config();
- my ($src_storeid) = PVE::Storage::parse_volume_id($src_volid, 1);
- my ($dst_storeid) = PVE::Storage::parse_volume_id($dst_volid, 1);
-
- die "destination '$dst_volid' is not a valid volid form qemu-img convert\n" if !$dst_storeid;
-
- my $cachemode;
- my $src_path;
- my $src_is_iscsi = 0;
- my $src_format;
-
- if ($src_storeid) {
- PVE::Storage::activate_volumes($storecfg, [$src_volid], $snapname);
- my $src_scfg = PVE::Storage::storage_config($storecfg, $src_storeid);
- $src_format = checked_volume_format($storecfg, $src_volid);
- $src_path = PVE::Storage::path($storecfg, $src_volid, $snapname);
- $src_is_iscsi = ($src_path =~ m|^iscsi://|);
- $cachemode = 'none' if $src_scfg->{type} eq 'zfspool';
- } elsif (-f $src_volid || -b $src_volid) {
- $src_path = $src_volid;
- if ($opts->{'source-path-format'}) {
- $src_format = $opts->{'source-path-format'};
- } elsif ($src_path =~ m/\.($PVE::QemuServer::Drive::QEMU_FORMAT_RE)$/) {
- $src_format = $1;
- }
- }
-
- die "source '$src_volid' is not a valid volid nor path for qemu-img convert\n" if !$src_path;
-
- my $dst_scfg = PVE::Storage::storage_config($storecfg, $dst_storeid);
- my $dst_format = checked_volume_format($storecfg, $dst_volid);
- my $dst_path = PVE::Storage::path($storecfg, $dst_volid);
- my $dst_is_iscsi = ($dst_path =~ m|^iscsi://|);
-
- my $cmd = [];
- push @$cmd, '/usr/bin/qemu-img', 'convert', '-p', '-n';
- push @$cmd, '-l', "snapshot.name=$snapname"
- if $snapname && $src_format && $src_format eq "qcow2";
- push @$cmd, '-t', 'none' if $dst_scfg->{type} eq 'zfspool';
- push @$cmd, '-T', $cachemode if defined($cachemode);
- push @$cmd, '-r', "${bwlimit}K" if defined($bwlimit);
-
- if ($src_is_iscsi) {
- push @$cmd, '--image-opts';
- $src_path = convert_iscsi_path($src_path);
- } elsif ($src_format) {
- push @$cmd, '-f', $src_format;
- }
-
- if ($dst_is_iscsi) {
- push @$cmd, '--target-image-opts';
- $dst_path = convert_iscsi_path($dst_path);
- } else {
- push @$cmd, '-O', $dst_format;
- }
-
- push @$cmd, $src_path;
-
- if (!$dst_is_iscsi && $opts->{'is-zero-initialized'}) {
- push @$cmd, "zeroinit:$dst_path";
- } else {
- push @$cmd, $dst_path;
- }
-
- my $parser = sub {
- my $line = shift;
- if ($line =~ m/\((\S+)\/100\%\)/) {
- my $percent = $1;
- my $transferred = int($size * $percent / 100);
- my $total_h = render_bytes($size, 1);
- my $transferred_h = render_bytes($transferred, 1);
-
- print "transferred $transferred_h of $total_h ($percent%)\n";
- }
-
- };
-
- eval { run_command($cmd, timeout => undef, outfunc => $parser); };
- my $err = $@;
- die "copy failed: $err" if $err;
-}
-
sub qemu_drive_mirror {
my (
$vmid,
@@ -8913,7 +8809,7 @@ sub clone_disk {
'is-zero-initialized' => $sparseinit,
snapname => $snapname,
};
- qemu_img_convert($drive->{file}, $newvolid, $size, $opts);
+ PVE::QemuServer::QemuImage::convert($drive->{file}, $newvolid, $size, $opts);
}
}
}
@@ -8998,7 +8894,7 @@ sub create_efidisk($$$$$$$$) {
my $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $fmt, undef, $vars_size);
PVE::Storage::activate_volumes($storecfg, [$volid]);
- qemu_img_convert($ovmf_vars, $volid, $vars_size_b);
+ PVE::QemuServer::QemuImage::convert($ovmf_vars, $volid, $vars_size_b);
my $size = PVE::Storage::volume_size_info($storecfg, $volid, 3);
return ($volid, $size / 1024);
diff --git a/src/PVE/QemuServer/ImportDisk.pm b/src/PVE/QemuServer/ImportDisk.pm
index 8ecd5521..01289fc5 100755
--- a/src/PVE/QemuServer/ImportDisk.pm
+++ b/src/PVE/QemuServer/ImportDisk.pm
@@ -4,9 +4,11 @@ use strict;
use warnings;
use PVE::Storage;
-use PVE::QemuServer;
use PVE::Tools qw(run_command extract_param);
+use PVE::QemuServer;
+use PVE::QemuServer::QemuImage;
+
# imports an external disk image to an existing VM
# and creates by default a drive entry unused[n] pointing to the created volume
# $params->{drive_name} may be used to specify ide0, scsi1, etc ...
@@ -82,7 +84,7 @@ sub do_import {
local $SIG{PIPE} = sub { die "interrupted by signal $!\n"; };
PVE::Storage::activate_volumes($storecfg, [$dst_volid]);
- PVE::QemuServer::qemu_img_convert(
+ PVE::QemuImage::convert(
$src_path,
$dst_volid,
$src_size,
diff --git a/src/PVE/QemuServer/Makefile b/src/PVE/QemuServer/Makefile
index 7d3830de..a34ec83b 100644
--- a/src/PVE/QemuServer/Makefile
+++ b/src/PVE/QemuServer/Makefile
@@ -15,6 +15,7 @@ SOURCES=Agent.pm \
MetaInfo.pm \
Monitor.pm \
PCI.pm \
+ QemuImage.pm \
QMPHelpers.pm \
RNG.pm \
StateFile.pm \
diff --git a/src/PVE/QemuServer/QemuImage.pm b/src/PVE/QemuServer/QemuImage.pm
new file mode 100644
index 00000000..38f7d52b
--- /dev/null
+++ b/src/PVE/QemuServer/QemuImage.pm
@@ -0,0 +1,123 @@
+package PVE::QemuServer::QemuImage;
+
+use strict;
+use warnings;
+
+use PVE::Format qw(render_bytes);
+use PVE::Storage;
+use PVE::Tools;
+
+use PVE::QemuServer::Drive qw(checked_volume_format);
+use PVE::QemuServer::Helpers;
+
+sub convert_iscsi_path {
+ my ($path) = @_;
+
+ if ($path =~ m|^iscsi://([^/]+)/([^/]+)/(.+)$|) {
+ my $portal = $1;
+ my $target = $2;
+ my $lun = $3;
+
+ my $initiator_name = PVE::QemuServer::Helpers::get_iscsi_initiator_name();
+
+ return "file.driver=iscsi,file.transport=tcp,file.initiator-name=$initiator_name,"
+ . "file.portal=$portal,file.target=$target,file.lun=$lun,driver=raw";
+ }
+
+ die "cannot convert iscsi path '$path', unknown format\n";
+}
+
+# The possible options are:
+# bwlimit - The bandwidth limit in KiB/s.
+# is-zero-initialized - If the destination image is zero-initialized.
+# snapname - Use this snapshot of the source image.
+# source-path-format - Indicate the format of the source when the source is a path. For PVE-managed
+# volumes, the format from the storage layer is always used.
+sub convert {
+ my ($src_volid, $dst_volid, $size, $opts) = @_;
+
+ my ($bwlimit, $snapname) = $opts->@{qw(bwlimit snapname)};
+
+ my $storecfg = PVE::Storage::config();
+ my ($src_storeid) = PVE::Storage::parse_volume_id($src_volid, 1);
+ my ($dst_storeid) = PVE::Storage::parse_volume_id($dst_volid, 1);
+
+ die "destination '$dst_volid' is not a valid volid form qemu-img convert\n" if !$dst_storeid;
+
+ my $cachemode;
+ my $src_path;
+ my $src_is_iscsi = 0;
+ my $src_format;
+
+ if ($src_storeid) {
+ PVE::Storage::activate_volumes($storecfg, [$src_volid], $snapname);
+ my $src_scfg = PVE::Storage::storage_config($storecfg, $src_storeid);
+ $src_format = checked_volume_format($storecfg, $src_volid);
+ $src_path = PVE::Storage::path($storecfg, $src_volid, $snapname);
+ $src_is_iscsi = ($src_path =~ m|^iscsi://|);
+ $cachemode = 'none' if $src_scfg->{type} eq 'zfspool';
+ } elsif (-f $src_volid || -b $src_volid) {
+ $src_path = $src_volid;
+ if ($opts->{'source-path-format'}) {
+ $src_format = $opts->{'source-path-format'};
+ } elsif ($src_path =~ m/\.($PVE::QemuServer::Drive::QEMU_FORMAT_RE)$/) {
+ $src_format = $1;
+ }
+ }
+
+ die "source '$src_volid' is not a valid volid nor path for qemu-img convert\n" if !$src_path;
+
+ my $dst_scfg = PVE::Storage::storage_config($storecfg, $dst_storeid);
+ my $dst_format = checked_volume_format($storecfg, $dst_volid);
+ my $dst_path = PVE::Storage::path($storecfg, $dst_volid);
+ my $dst_is_iscsi = ($dst_path =~ m|^iscsi://|);
+
+ my $cmd = [];
+ push @$cmd, '/usr/bin/qemu-img', 'convert', '-p', '-n';
+ push @$cmd, '-l', "snapshot.name=$snapname"
+ if $snapname && $src_format && $src_format eq "qcow2";
+ push @$cmd, '-t', 'none' if $dst_scfg->{type} eq 'zfspool';
+ push @$cmd, '-T', $cachemode if defined($cachemode);
+ push @$cmd, '-r', "${bwlimit}K" if defined($bwlimit);
+
+ if ($src_is_iscsi) {
+ push @$cmd, '--image-opts';
+ $src_path = convert_iscsi_path($src_path);
+ } elsif ($src_format) {
+ push @$cmd, '-f', $src_format;
+ }
+
+ if ($dst_is_iscsi) {
+ push @$cmd, '--target-image-opts';
+ $dst_path = convert_iscsi_path($dst_path);
+ } else {
+ push @$cmd, '-O', $dst_format;
+ }
+
+ push @$cmd, $src_path;
+
+ if (!$dst_is_iscsi && $opts->{'is-zero-initialized'}) {
+ push @$cmd, "zeroinit:$dst_path";
+ } else {
+ push @$cmd, $dst_path;
+ }
+
+ my $parser = sub {
+ my $line = shift;
+ if ($line =~ m/\((\S+)\/100\%\)/) {
+ my $percent = $1;
+ my $transferred = int($size * $percent / 100);
+ my $total_h = render_bytes($size, 1);
+ my $transferred_h = render_bytes($transferred, 1);
+
+ print "transferred $transferred_h of $total_h ($percent%)\n";
+ }
+
+ };
+
+ eval { PVE::Tools::run_command($cmd, timeout => undef, outfunc => $parser); };
+ my $err = $@;
+ die "copy failed: $err" if $err;
+}
+
+1;
diff --git a/src/test/run_qemu_img_convert_tests.pl b/src/test/run_qemu_img_convert_tests.pl
index 86eb53be..b5a457c3 100755
--- a/src/test/run_qemu_img_convert_tests.pl
+++ b/src/test/run_qemu_img_convert_tests.pl
@@ -8,7 +8,7 @@ use lib qw(..);
use Test::More;
use Test::MockModule;
-use PVE::QemuServer;
+use PVE::QemuServer::QemuImage;
my $vmid = 8006;
my $storage_config = {
@@ -498,21 +498,24 @@ $zfsplugin_module->mock(
},
);
-# we use the exported run_command so we have to mock it there
-my $qemu_server_module = Test::MockModule->new("PVE::QemuServer");
-$qemu_server_module->mock(
- run_command => sub {
- $command = shift;
- },
+my $qemu_server_helpers_module = Test::MockModule->new("PVE::QemuServer::Helpers");
+$qemu_server_helpers_module->mock(
get_iscsi_initiator_name => sub {
return "foobar";
},
);
+my $tools_module = Test::MockModule->new("PVE::Tools");
+$tools_module->mock(
+ run_command => sub {
+ $command = shift;
+ },
+);
+
foreach my $test (@$tests) {
my $name = $test->{name};
my $expected = $test->{expected};
- eval { PVE::QemuServer::qemu_img_convert(@{ $test->{parameters} }) };
+ eval { PVE::QemuServer::QemuImage::convert(@{ $test->{parameters} }) };
if (my $err = $@) {
is($err, $expected, $name);
} elsif (defined($command)) {
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 07/15] introduce OVMF module
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (5 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 06/15] introduce QemuImage module Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-24 10:23 ` Fabian Grünbichler
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 08/15] blockdev: re-use cache setting from child node Fiona Ebner
` (9 subsequent siblings)
16 siblings, 1 reply; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/API2/Qemu.pm | 13 ++-
src/PVE/QemuMigrate.pm | 3 +-
src/PVE/QemuServer.pm | 168 +---------------------------
src/PVE/QemuServer/Makefile | 1 +
src/PVE/QemuServer/OVMF.pm | 186 +++++++++++++++++++++++++++++++
src/test/MigrationTest/Shared.pm | 4 +
6 files changed, 207 insertions(+), 168 deletions(-)
create mode 100644 src/PVE/QemuServer/OVMF.pm
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index ce6f362d..44322db6 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -36,6 +36,7 @@ use PVE::QemuServer::Monitor qw(mon_cmd);
use PVE::QemuServer::Machine;
use PVE::QemuServer::Memory qw(get_current_memory);
use PVE::QemuServer::MetaInfo;
+use PVE::QemuServer::OVMF;
use PVE::QemuServer::PCI;
use PVE::QemuServer::QMPHelpers;
use PVE::QemuServer::RNG;
@@ -540,8 +541,10 @@ my sub create_disks : prototype($$$$$$$$$$$) {
format => $disk->{format},
};
- $dest_info->{efisize} = PVE::QemuServer::get_efivars_size($conf, $disk)
- if $ds eq 'efidisk0';
+ if ($ds eq 'efidisk0') {
+ $dest_info->{efisize} =
+ PVE::QemuServer::OVMF::get_efivars_size($conf, $disk);
+ }
eval {
($dst_volid, $size) =
@@ -612,7 +615,7 @@ my sub create_disks : prototype($$$$$$$$$$$) {
"SEV-SNP uses consolidated read-only firmware and does not require an EFI disk\n"
if $amd_sev_type && $amd_sev_type eq 'snp';
- ($volid, $size) = PVE::QemuServer::create_efidisk(
+ ($volid, $size) = PVE::QemuServer::OVMF::create_efidisk(
$storecfg, $storeid, $vmid, $fmt, $arch, $disk, $smm, $amd_sev_type,
);
} elsif ($ds eq 'tpmstate0') {
@@ -4455,7 +4458,7 @@ __PACKAGE__->register_method({
format => $format,
};
- $dest_info->{efisize} = PVE::QemuServer::get_efivars_size($oldconf)
+ $dest_info->{efisize} = PVE::QemuServer::OVMF::get_efivars_size($oldconf)
if $opt eq 'efidisk0';
my $newdrive = PVE::QemuServer::clone_disk(
@@ -4733,7 +4736,7 @@ __PACKAGE__->register_method({
format => $format,
};
- $dest_info->{efisize} = PVE::QemuServer::get_efivars_size($conf)
+ $dest_info->{efisize} = PVE::QemuServer::OVMF::get_efivars_size($conf)
if $disk eq 'efidisk0';
my $newdrive = PVE::QemuServer::clone_disk(
diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index 28d7ac56..9ccaf7e0 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -31,6 +31,7 @@ use PVE::QemuServer::Helpers qw(min_version);
use PVE::QemuServer::Machine;
use PVE::QemuServer::Monitor qw(mon_cmd);
use PVE::QemuServer::Memory qw(get_current_memory);
+use PVE::QemuServer::OVMF;
use PVE::QemuServer::QMPHelpers;
use PVE::QemuServer;
@@ -635,7 +636,7 @@ sub config_update_local_disksizes {
# we want to set the efidisk size in the config to the size of the
# real OVMF_VARS.fd image, else we can create a too big image, which does not work
if (defined($conf->{efidisk0})) {
- PVE::QemuServer::update_efidisk_size($conf);
+ PVE::QemuServer::OVMF::update_efidisk_size($conf);
}
# TPM state might have an irregular filesize, to avoid problems on transfer
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 63b4d469..719687dc 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -56,7 +56,7 @@ use PVE::QemuServer::Helpers
use PVE::QemuServer::Cloudinit;
use PVE::QemuServer::CGroup;
use PVE::QemuServer::CPUConfig
- qw(print_cpu_device get_cpu_options get_cpu_bitness is_native_arch get_amd_sev_object get_amd_sev_type);
+ qw(print_cpu_device get_cpu_options is_native_arch get_amd_sev_object get_amd_sev_type);
use PVE::QemuServer::Drive qw(
is_valid_drivename
checked_volume_format
@@ -71,6 +71,7 @@ use PVE::QemuServer::Machine;
use PVE::QemuServer::Memory qw(get_current_memory);
use PVE::QemuServer::MetaInfo;
use PVE::QemuServer::Monitor qw(mon_cmd);
+use PVE::QemuServer::OVMF;
use PVE::QemuServer::PCI qw(print_pci_addr print_pcie_addr print_pcie_root_port parse_hostpci);
use PVE::QemuServer::QemuImage;
use PVE::QemuServer::QMPHelpers qw(qemu_deviceadd qemu_devicedel qemu_objectadd qemu_objectdel);
@@ -98,41 +99,6 @@ my sub vm_is_ha_managed {
return PVE::HA::Config::vm_is_ha_managed($vmid);
}
-my $EDK2_FW_BASE = '/usr/share/pve-edk2-firmware/';
-my $OVMF = {
- x86_64 => {
- '4m-no-smm' => [
- "$EDK2_FW_BASE/OVMF_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.fd",
- ],
- '4m-no-smm-ms' => [
- "$EDK2_FW_BASE/OVMF_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.ms.fd",
- ],
- '4m' => [
- "$EDK2_FW_BASE/OVMF_CODE_4M.secboot.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.fd",
- ],
- '4m-ms' => [
- "$EDK2_FW_BASE/OVMF_CODE_4M.secboot.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.ms.fd",
- ],
- '4m-sev' => [
- "$EDK2_FW_BASE/OVMF_CVM_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_CVM_VARS_4M.fd",
- ],
- '4m-snp' => [
- "$EDK2_FW_BASE/OVMF_CVM_4M.fd",
- ],
- # FIXME: These are legacy 2MB-sized images that modern OVMF doesn't supports to build
- # anymore. how can we deperacate this sanely without breaking existing instances, or using
- # older backups and snapshot?
- default => [
- "$EDK2_FW_BASE/OVMF_CODE.fd", "$EDK2_FW_BASE/OVMF_VARS.fd",
- ],
- },
- aarch64 => {
- default => [
- "$EDK2_FW_BASE/AAVMF_CODE.fd", "$EDK2_FW_BASE/AAVMF_VARS.fd",
- ],
- },
-};
-
my $cpuinfo = PVE::ProcFSTools::read_cpuinfo();
# Note about locking: we use flock on the config file protect against concurrent actions.
@@ -3293,36 +3259,6 @@ sub vga_conf_has_spice {
return $1 || 1;
}
-sub get_ovmf_files($$$$) {
- my ($arch, $efidisk, $smm, $amd_sev_type) = @_;
-
- my $types = $OVMF->{$arch}
- or die "no OVMF images known for architecture '$arch'\n";
-
- my $type = 'default';
- if ($arch eq 'x86_64') {
- if ($amd_sev_type && $amd_sev_type eq 'snp') {
- $type = "4m-snp";
- my ($ovmf) = $types->{$type}->@*;
- die "EFI base image '$ovmf' not found\n" if !-f $ovmf;
- return ($ovmf);
- } elsif ($amd_sev_type) {
- $type = "4m-sev";
- } elsif (defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') {
- $type = $smm ? "4m" : "4m-no-smm";
- $type .= '-ms' if $efidisk->{'pre-enrolled-keys'};
- } else {
- # TODO: log_warn about use of legacy images for x86_64 with Promxox VE 9
- }
- }
-
- my ($ovmf_code, $ovmf_vars) = $types->{$type}->@*;
- die "EFI base image '$ovmf_code' not found\n" if !-f $ovmf_code;
- die "EFI vars image '$ovmf_vars' not found\n" if !-f $ovmf_vars;
-
- return ($ovmf_code, $ovmf_vars);
-}
-
# To use query_supported_cpu_flags and query_understood_cpu_flags to get flags
# to use in a QEMU command line (-cpu element), first array_intersect the result
# of query_supported_ with query_understood_. This is necessary because:
@@ -3464,48 +3400,6 @@ my sub should_disable_smm {
&& $vga->{type} =~ m/^(serial\d+|none)$/;
}
-my sub print_ovmf_drive_commandlines {
- my ($conf, $storecfg, $vmid, $arch, $q35, $version_guard) = @_;
-
- my $d = $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
-
- my $amd_sev_type = get_amd_sev_type($conf);
- die "Attempting to configure SEV-SNP with pflash devices instead of using `-bios`\n"
- if $amd_sev_type && $amd_sev_type eq 'snp';
-
- my ($ovmf_code, $ovmf_vars) = get_ovmf_files($arch, $d, $q35, $amd_sev_type);
-
- my $var_drive_str = "if=pflash,unit=1,id=drive-efidisk0";
- if ($d) {
- my ($storeid, $volname) = PVE::Storage::parse_volume_id($d->{file}, 1);
- my ($path, $format) = $d->@{ 'file', 'format' };
- if ($storeid) {
- $path = PVE::Storage::path($storecfg, $d->{file});
- $format //= checked_volume_format($storecfg, $d->{file});
- } elsif (!defined($format)) {
- die "efidisk format must be specified\n";
- }
- # SPI flash does lots of read-modify-write OPs, without writeback this gets really slow #3329
- if ($path =~ m/^rbd:/) {
- $var_drive_str .= ',cache=writeback';
- $path .= ':rbd_cache_policy=writeback'; # avoid write-around, we *need* to cache writes too
- }
- $var_drive_str .= ",format=$format,file=$path";
-
- $var_drive_str .= ",size=" . (-s $ovmf_vars)
- if $format eq 'raw' && $version_guard->(4, 1, 2);
- $var_drive_str .= ',readonly=on' if drive_is_read_only($conf, $d);
- } else {
- log_warn("no efidisk configured! Using temporary efivars disk.");
- my $path = "/tmp/$vmid-ovmf.fd";
- PVE::Tools::file_copy($ovmf_vars, $path, -s $ovmf_vars);
- $var_drive_str .= ",format=raw,file=$path";
- $var_drive_str .= ",size=" . (-s $ovmf_vars) if $version_guard->(4, 1, 2);
- }
-
- return ("if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code", $var_drive_str);
-}
-
my sub get_vga_properties {
my ($conf, $arch, $machine_version, $winversion) = @_;
@@ -3680,21 +3574,10 @@ sub config_to_command {
}
if ($conf->{bios} && $conf->{bios} eq 'ovmf') {
- die "OVMF (UEFI) BIOS is not supported on 32-bit CPU types\n"
- if !$forcecpu && get_cpu_bitness($conf->{cpu}, $arch) == 32;
-
- my $amd_sev_type = get_amd_sev_type($conf);
- if ($amd_sev_type && $amd_sev_type eq 'snp') {
- if (defined($conf->{efidisk0})) {
- log_warn("EFI disks are not supported with SEV-SNP and will be ignored");
- }
- push $cmd->@*, '-bios', get_ovmf_files($arch, undef, undef, $amd_sev_type);
- } else {
- my ($code_drive_str, $var_drive_str) =
- print_ovmf_drive_commandlines($conf, $storecfg, $vmid, $arch, $q35, $version_guard);
- push $cmd->@*, '-drive', $code_drive_str;
- push $cmd->@*, '-drive', $var_drive_str;
- }
+ my $ovmf_cmd = PVE::QemuServer::OVMF::print_ovmf_commandline(
+ $conf, $storecfg, $vmid, $arch, $q35, $version_guard, $forcecpu,
+ );
+ push $cmd->@*, $ovmf_cmd->@*;
}
if ($q35) { # tell QEMU to load q35 config early
@@ -8853,29 +8736,6 @@ sub qemu_use_old_bios_files {
return ($use_old_bios_files, $machine_type);
}
-sub get_efivars_size {
- my ($conf, $efidisk) = @_;
-
- my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf);
- $efidisk //= $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
- my $smm = PVE::QemuServer::Machine::machine_type_is_q35($conf);
- my $amd_sev_type = get_amd_sev_type($conf);
- my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm, $amd_sev_type);
- return -s $ovmf_vars;
-}
-
-sub update_efidisk_size {
- my ($conf) = @_;
-
- return if !defined($conf->{efidisk0});
-
- my $disk = PVE::QemuServer::parse_drive('efidisk0', $conf->{efidisk0});
- $disk->{size} = get_efivars_size($conf);
- $conf->{efidisk0} = print_drive($disk);
-
- return;
-}
-
sub update_tpmstate_size {
my ($conf) = @_;
@@ -8884,22 +8744,6 @@ sub update_tpmstate_size {
$conf->{tpmstate0} = print_drive($disk);
}
-sub create_efidisk($$$$$$$$) {
- my ($storecfg, $storeid, $vmid, $fmt, $arch, $efidisk, $smm, $amd_sev_type) = @_;
-
- my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm, $amd_sev_type);
-
- my $vars_size_b = -s $ovmf_vars;
- my $vars_size = PVE::Tools::convert_size($vars_size_b, 'b' => 'kb');
- my $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $fmt, undef, $vars_size);
- PVE::Storage::activate_volumes($storecfg, [$volid]);
-
- PVE::QemuServer::QemuImage::convert($ovmf_vars, $volid, $vars_size_b);
- my $size = PVE::Storage::volume_size_info($storecfg, $volid, 3);
-
- return ($volid, $size / 1024);
-}
-
sub vm_iothreads_list {
my ($vmid) = @_;
diff --git a/src/PVE/QemuServer/Makefile b/src/PVE/QemuServer/Makefile
index a34ec83b..dd6fe505 100644
--- a/src/PVE/QemuServer/Makefile
+++ b/src/PVE/QemuServer/Makefile
@@ -14,6 +14,7 @@ SOURCES=Agent.pm \
Memory.pm \
MetaInfo.pm \
Monitor.pm \
+ OVMF.pm \
PCI.pm \
QemuImage.pm \
QMPHelpers.pm \
diff --git a/src/PVE/QemuServer/OVMF.pm b/src/PVE/QemuServer/OVMF.pm
new file mode 100644
index 00000000..70c626a5
--- /dev/null
+++ b/src/PVE/QemuServer/OVMF.pm
@@ -0,0 +1,186 @@
+package PVE::QemuServer::OVMF;
+
+use strict;
+use warnings;
+
+use PVE::RESTEnvironment qw(log_warn);
+use PVE::Storage;
+use PVE::Tools;
+
+use PVE::QemuServer::Drive qw(checked_volume_format drive_is_read_only parse_drive print_drive);
+use PVE::QemuServer::CPUConfig qw(get_amd_sev_type get_cpu_bitness);
+use PVE::QemuServer::Helpers;
+use PVE::QemuServer::Machine;
+use PVE::QemuServer::QemuImage;
+
+my $EDK2_FW_BASE = '/usr/share/pve-edk2-firmware/';
+my $OVMF = {
+ x86_64 => {
+ '4m-no-smm' => [
+ "$EDK2_FW_BASE/OVMF_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.fd",
+ ],
+ '4m-no-smm-ms' => [
+ "$EDK2_FW_BASE/OVMF_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.ms.fd",
+ ],
+ '4m' => [
+ "$EDK2_FW_BASE/OVMF_CODE_4M.secboot.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.fd",
+ ],
+ '4m-ms' => [
+ "$EDK2_FW_BASE/OVMF_CODE_4M.secboot.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.ms.fd",
+ ],
+ '4m-sev' => [
+ "$EDK2_FW_BASE/OVMF_CVM_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_CVM_VARS_4M.fd",
+ ],
+ '4m-snp' => [
+ "$EDK2_FW_BASE/OVMF_CVM_4M.fd",
+ ],
+ # FIXME: These are legacy 2MB-sized images that modern OVMF doesn't supports to build
+ # anymore. how can we deperacate this sanely without breaking existing instances, or using
+ # older backups and snapshot?
+ default => [
+ "$EDK2_FW_BASE/OVMF_CODE.fd", "$EDK2_FW_BASE/OVMF_VARS.fd",
+ ],
+ },
+ aarch64 => {
+ default => [
+ "$EDK2_FW_BASE/AAVMF_CODE.fd", "$EDK2_FW_BASE/AAVMF_VARS.fd",
+ ],
+ },
+};
+
+my sub get_ovmf_files($$$$) {
+ my ($arch, $efidisk, $smm, $amd_sev_type) = @_;
+
+ my $types = $OVMF->{$arch}
+ or die "no OVMF images known for architecture '$arch'\n";
+
+ my $type = 'default';
+ if ($arch eq 'x86_64') {
+ if ($amd_sev_type && $amd_sev_type eq 'snp') {
+ $type = "4m-snp";
+ my ($ovmf) = $types->{$type}->@*;
+ die "EFI base image '$ovmf' not found\n" if !-f $ovmf;
+ return ($ovmf);
+ } elsif ($amd_sev_type) {
+ $type = "4m-sev";
+ } elsif (defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') {
+ $type = $smm ? "4m" : "4m-no-smm";
+ $type .= '-ms' if $efidisk->{'pre-enrolled-keys'};
+ } else {
+ # TODO: log_warn about use of legacy images for x86_64 with Promxox VE 9
+ }
+ }
+
+ my ($ovmf_code, $ovmf_vars) = $types->{$type}->@*;
+ die "EFI base image '$ovmf_code' not found\n" if !-f $ovmf_code;
+ die "EFI vars image '$ovmf_vars' not found\n" if !-f $ovmf_vars;
+
+ return ($ovmf_code, $ovmf_vars);
+}
+
+my sub print_ovmf_drive_commandlines {
+ my ($conf, $storecfg, $vmid, $arch, $q35, $version_guard) = @_;
+
+ my $d = $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
+
+ my $amd_sev_type = get_amd_sev_type($conf);
+ die "Attempting to configure SEV-SNP with pflash devices instead of using `-bios`\n"
+ if $amd_sev_type && $amd_sev_type eq 'snp';
+
+ my ($ovmf_code, $ovmf_vars) = get_ovmf_files($arch, $d, $q35, $amd_sev_type);
+
+ my $var_drive_str = "if=pflash,unit=1,id=drive-efidisk0";
+ if ($d) {
+ my ($storeid, $volname) = PVE::Storage::parse_volume_id($d->{file}, 1);
+ my ($path, $format) = $d->@{ 'file', 'format' };
+ if ($storeid) {
+ $path = PVE::Storage::path($storecfg, $d->{file});
+ $format //= checked_volume_format($storecfg, $d->{file});
+ } elsif (!defined($format)) {
+ die "efidisk format must be specified\n";
+ }
+ # SPI flash does lots of read-modify-write OPs, without writeback this gets really slow #3329
+ if ($path =~ m/^rbd:/) {
+ $var_drive_str .= ',cache=writeback';
+ $path .= ':rbd_cache_policy=writeback'; # avoid write-around, we *need* to cache writes too
+ }
+ $var_drive_str .= ",format=$format,file=$path";
+
+ $var_drive_str .= ",size=" . (-s $ovmf_vars)
+ if $format eq 'raw' && $version_guard->(4, 1, 2);
+ $var_drive_str .= ',readonly=on' if drive_is_read_only($conf, $d);
+ } else {
+ log_warn("no efidisk configured! Using temporary efivars disk.");
+ my $path = "/tmp/$vmid-ovmf.fd";
+ PVE::Tools::file_copy($ovmf_vars, $path, -s $ovmf_vars);
+ $var_drive_str .= ",format=raw,file=$path";
+ $var_drive_str .= ",size=" . (-s $ovmf_vars) if $version_guard->(4, 1, 2);
+ }
+
+ return ("if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code", $var_drive_str);
+}
+
+sub get_efivars_size {
+ my ($conf, $efidisk) = @_;
+
+ my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf);
+ $efidisk //= $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
+ my $smm = PVE::QemuServer::Machine::machine_type_is_q35($conf);
+ my $amd_sev_type = get_amd_sev_type($conf);
+ my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm, $amd_sev_type);
+ return -s $ovmf_vars;
+}
+
+sub update_efidisk_size {
+ my ($conf) = @_;
+
+ return if !defined($conf->{efidisk0});
+
+ my $disk = parse_drive('efidisk0', $conf->{efidisk0});
+ $disk->{size} = get_efivars_size($conf);
+ $conf->{efidisk0} = print_drive($disk);
+
+ return;
+}
+
+sub create_efidisk($$$$$$$$) {
+ my ($storecfg, $storeid, $vmid, $fmt, $arch, $efidisk, $smm, $amd_sev_type) = @_;
+
+ my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm, $amd_sev_type);
+
+ my $vars_size_b = -s $ovmf_vars;
+ my $vars_size = PVE::Tools::convert_size($vars_size_b, 'b' => 'kb');
+ my $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $fmt, undef, $vars_size);
+ PVE::Storage::activate_volumes($storecfg, [$volid]);
+
+ PVE::QemuServer::QemuImage::convert($ovmf_vars, $volid, $vars_size_b);
+ my $size = PVE::Storage::volume_size_info($storecfg, $volid, 3);
+
+ return ($volid, $size / 1024);
+}
+
+sub print_ovmf_commandline {
+ my ($conf, $storecfg, $vmid, $arch, $q35, $version_guard, $forcecpu) = @_;
+
+ my $cmd = [];
+
+ die "OVMF (UEFI) BIOS is not supported on 32-bit CPU types\n"
+ if !$forcecpu && get_cpu_bitness($conf->{cpu}, $arch) == 32;
+
+ my $amd_sev_type = get_amd_sev_type($conf);
+ if ($amd_sev_type && $amd_sev_type eq 'snp') {
+ if (defined($conf->{efidisk0})) {
+ log_warn("EFI disks are not supported with SEV-SNP and will be ignored");
+ }
+ push $cmd->@*, '-bios', get_ovmf_files($arch, undef, undef, $amd_sev_type);
+ } else {
+ my ($code_drive_str, $var_drive_str) =
+ print_ovmf_drive_commandlines($conf, $storecfg, $vmid, $arch, $q35, $version_guard);
+ push $cmd->@*, '-drive', $code_drive_str;
+ push $cmd->@*, '-drive', $var_drive_str;
+ }
+
+ return $cmd;
+}
+
+1;
diff --git a/src/test/MigrationTest/Shared.pm b/src/test/MigrationTest/Shared.pm
index 0b1ac7a0..e29cd1df 100644
--- a/src/test/MigrationTest/Shared.pm
+++ b/src/test/MigrationTest/Shared.pm
@@ -150,6 +150,10 @@ $qemu_server_module->mock(
vm_stop_cleanup => sub {
return;
},
+);
+
+our $qemu_server_ovmf_module = Test::MockModule->new("PVE::QemuServer::OVMF");
+$qemu_server_ovmf_module->mock(
get_efivars_size => sub {
return 128 * 1024;
},
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 08/15] blockdev: re-use cache setting from child node
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (6 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 07/15] introduce OVMF module Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 09/15] blockdev: add workaround for issue #3229 Fiona Ebner
` (8 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
To ensure that the setting is always consistent between format and
file node.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/Blockdev.pm | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index 76a00383..f799a950 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -176,16 +176,13 @@ sub generate_format_blockdev {
$format = $drive->{format} // 'raw';
}
- # define cache option on both format && file node like libvirt does
- my $cache = generate_blockdev_drive_cache($drive, $scfg);
-
my $node_name = get_node_name('fmt', $drive_id, $drive->{file}, $options->{'snapshot-name'});
return {
'node-name' => "$node_name",
driver => "$format",
file => $child,
- cache => $cache,
+ cache => $child->{cache}, # define cache option on both format && file node like libvirt
'read-only' => read_only_json_option($drive, $options),
};
}
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 09/15] blockdev: add workaround for issue #3229
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (7 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 08/15] blockdev: re-use cache setting from child node Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 10/15] blockdev: add support for 'size' option Fiona Ebner
` (7 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Enforce the 'writeback' cache setting for an EFI disk with RBD driver
to work around issue #3229. See also commit 6aaad230 ("fix #3329: turn
on cache=writeback for efidisks on rbd").
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/Blockdev.pm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index f799a950..f096f9d1 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -128,7 +128,14 @@ sub generate_file_blockdev {
$scfg = PVE::Storage::storage_config($storecfg, $storeid);
}
- $blockdev->{cache} = generate_blockdev_drive_cache($drive, $scfg);
+ # SPI flash does lots of read-modify-write OPs, without writeback this gets really slow #3329
+ # It also needs the rbd_cache_policy set to 'writeback' on the RBD side, which is done by the
+ # storage layer.
+ if ($blockdev->{driver} eq 'rbd' && $drive->{interface} eq 'efidisk') {
+ $blockdev->{cache} = { direct => JSON::false, 'no-flush' => JSON::false };
+ } else {
+ $blockdev->{cache} = generate_blockdev_drive_cache($drive, $scfg);
+ }
my $driver = $blockdev->{driver};
# only certain drivers have the aio setting
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 10/15] blockdev: add support for 'size' option
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (8 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 09/15] blockdev: add workaround for issue #3229 Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 11/15] ovmf: add support for using blockdev Fiona Ebner
` (6 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
For EFI disks in raw format, it is necessary to specify a precise size
and have no padding. See commit 818ce80e ("fix efidisks on storages with
minimum sizes bigger than OVMF_VARS.fd") for details.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/Blockdev.pm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index f096f9d1..6e6b9245 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -185,13 +185,20 @@ sub generate_format_blockdev {
my $node_name = get_node_name('fmt', $drive_id, $drive->{file}, $options->{'snapshot-name'});
- return {
+ my $blockdev = {
'node-name' => "$node_name",
driver => "$format",
file => $child,
cache => $child->{cache}, # define cache option on both format && file node like libvirt
'read-only' => read_only_json_option($drive, $options),
};
+
+ if (defined($options->{size})) {
+ die "blockdev: 'size' is only supported for 'raw' format" if $format ne 'raw';
+ $blockdev->{size} = int($options->{size});
+ }
+
+ return $blockdev;
}
sub generate_drive_blockdev {
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 11/15] ovmf: add support for using blockdev
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (9 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 10/15] blockdev: add support for 'size' option Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-24 8:38 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 12/15] cfg2cmd: ovmf: support print_ovmf_commandline() returning machine flags Fiona Ebner
` (5 subsequent siblings)
16 siblings, 1 reply; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Co-developed-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/OVMF.pm | 53 ++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/src/PVE/QemuServer/OVMF.pm b/src/PVE/QemuServer/OVMF.pm
index 70c626a5..5c0d8b53 100644
--- a/src/PVE/QemuServer/OVMF.pm
+++ b/src/PVE/QemuServer/OVMF.pm
@@ -3,10 +3,13 @@ package PVE::QemuServer::OVMF;
use strict;
use warnings;
+use JSON qw(to_json);
+
use PVE::RESTEnvironment qw(log_warn);
use PVE::Storage;
use PVE::Tools;
+use PVE::QemuServer::Blockdev;
use PVE::QemuServer::Drive qw(checked_volume_format drive_is_read_only parse_drive print_drive);
use PVE::QemuServer::CPUConfig qw(get_amd_sev_type get_cpu_bitness);
use PVE::QemuServer::Helpers;
@@ -159,6 +162,56 @@ sub create_efidisk($$$$$$$$) {
return ($volid, $size / 1024);
}
+my sub generate_ovmf_blockdev {
+ my ($conf, $storecfg, $vmid, $arch, $q35) = @_;
+
+ my $drive = $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
+
+ my $amd_sev_type = get_amd_sev_type($conf);
+ die "Attempting to configure SEV-SNP with pflash devices instead of using `-bios`\n"
+ if $amd_sev_type && $amd_sev_type eq 'snp';
+
+ my ($ovmf_code, $ovmf_vars) = get_ovmf_files($arch, $drive, $q35, $amd_sev_type);
+
+ my $ovmf_code_blockdev = {
+ driver => 'raw',
+ file => { driver => 'file', filename => "$ovmf_code" },
+ 'node-name' => 'pflash0',
+ };
+
+ my $format;
+
+ if ($drive) {
+ my ($storeid, $volname) = PVE::Storage::parse_volume_id($drive->{file}, 1);
+ $format = $drive->{format};
+ if ($storeid) {
+ $format //= checked_volume_format($storecfg, $drive->{file});
+ } elsif (!defined($format)) {
+ die "efidisk format must be specified\n";
+ }
+ } else {
+ log_warn("no efidisk configured! Using temporary efivars disk.");
+ my $path = "/tmp/$vmid-ovmf.fd";
+ PVE::Tools::file_copy($ovmf_vars, $path, -s $ovmf_vars);
+ $drive = { file => $path };
+ $format = 'raw';
+ }
+
+ my $extra_blockdev_options = {};
+ # extra protection for templates, but SATA and IDE don't support it..
+ $extra_blockdev_options->{'read-only'} = 1 if drive_is_read_only($conf, $drive);
+
+ $extra_blockdev_options->{size} = -s $ovmf_vars if $format eq 'raw';
+
+ my $throttle_group = PVE::QemuServer::Blockdev::generate_throttle_group($drive);
+
+ my $ovmf_vars_blockdev = PVE::QemuServer::Blockdev::generate_drive_blockdev(
+ $storecfg, $drive, $extra_blockdev_options,
+ );
+
+ return ($ovmf_code_blockdev, $ovmf_vars_blockdev, $throttle_group);
+}
+
sub print_ovmf_commandline {
my ($conf, $storecfg, $vmid, $arch, $q35, $version_guard, $forcecpu) = @_;
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [PATCH qemu-server 12/15] cfg2cmd: ovmf: support print_ovmf_commandline() returning machine flags
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (10 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 11/15] ovmf: add support for using blockdev Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 13/15] print drive device: don't reference any drive for 'none' starting with machine version 10.0 Fiona Ebner
` (4 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
This is in preparation for the switch to -blockdev, where it will be
necessary to specify the 'pflash0' and 'pflash1' machine flags.
Suggested-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 3 ++-
src/PVE/QemuServer/OVMF.pm | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 719687dc..4edd1793 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -3574,10 +3574,11 @@ sub config_to_command {
}
if ($conf->{bios} && $conf->{bios} eq 'ovmf') {
- my $ovmf_cmd = PVE::QemuServer::OVMF::print_ovmf_commandline(
+ my ($ovmf_cmd, $ovmf_machine_flags) = PVE::QemuServer::OVMF::print_ovmf_commandline(
$conf, $storecfg, $vmid, $arch, $q35, $version_guard, $forcecpu,
);
push $cmd->@*, $ovmf_cmd->@*;
+ push $machineFlags->@*, $ovmf_machine_flags->@*;
}
if ($q35) { # tell QEMU to load q35 config early
diff --git a/src/PVE/QemuServer/OVMF.pm b/src/PVE/QemuServer/OVMF.pm
index 5c0d8b53..8b28f902 100644
--- a/src/PVE/QemuServer/OVMF.pm
+++ b/src/PVE/QemuServer/OVMF.pm
@@ -216,6 +216,7 @@ sub print_ovmf_commandline {
my ($conf, $storecfg, $vmid, $arch, $q35, $version_guard, $forcecpu) = @_;
my $cmd = [];
+ my $machine_flags = [];
die "OVMF (UEFI) BIOS is not supported on 32-bit CPU types\n"
if !$forcecpu && get_cpu_bitness($conf->{cpu}, $arch) == 32;
@@ -233,7 +234,7 @@ sub print_ovmf_commandline {
push $cmd->@*, '-drive', $var_drive_str;
}
- return $cmd;
+ return ($cmd, $machine_flags);
}
1;
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [RFC qemu-server 13/15] print drive device: don't reference any drive for 'none' starting with machine version 10.0
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (11 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 12/15] cfg2cmd: ovmf: support print_ovmf_commandline() returning machine flags Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 14/15] blockdev: add support for NBD paths Fiona Ebner
` (3 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
There will be no block node for 'none' after switching to '-blockdev'.
Co-developed-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
[FE: split out from larger patch
do it also for non-SCSI cases]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
RFC, should be applied with the final switch to blockdev.
Changes since last time:
* udpate tests
src/PVE/QemuServer.pm | 18 +++++++++++++++---
src/test/cfg2cmd/bootorder-empty.conf.cmd | 2 +-
src/test/cfg2cmd/bootorder-legacy.conf.cmd | 2 +-
src/test/cfg2cmd/bootorder.conf.cmd | 2 +-
...cputype-icelake-client-deprecation.conf.cmd | 2 +-
src/test/cfg2cmd/seabios_serial.conf.cmd | 2 +-
src/test/cfg2cmd/simple-btrfs.conf.cmd | 2 +-
src/test/cfg2cmd/simple-cifs.conf.cmd | 2 +-
src/test/cfg2cmd/simple-rbd.conf.cmd | 2 +-
src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 2 +-
.../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 2 +-
src/test/cfg2cmd/simple1-template.conf.cmd | 2 +-
src/test/cfg2cmd/simple1.conf.cmd | 2 +-
13 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 4edd1793..38272420 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -1376,7 +1376,12 @@ sub print_drivedevice_full {
my $drive_id = PVE::QemuServer::Drive::get_drive_id($drive);
if ($drive->{interface} eq 'virtio') {
my $pciaddr = print_pci_addr("$drive_id", $bridges, $arch);
- $device = "virtio-blk-pci,drive=drive-$drive_id,id=${drive_id}${pciaddr}";
+ $device = 'virtio-blk-pci';
+ # for the switch to -blockdev, there is no blockdev for 'none'
+ if (!min_version($machine_version, 10, 0) || $drive->{file} ne 'none') {
+ $device .= ",drive=drive-$drive_id";
+ }
+ $device .= ",id=${drive_id}${pciaddr}";
$device .= ",iothread=iothread-$drive_id" if $drive->{iothread};
} elsif ($drive->{interface} eq 'scsi') {
@@ -1392,7 +1397,11 @@ sub print_drivedevice_full {
$device = "scsi-$device_type,bus=$controller_prefix$controller.0,channel=0,scsi-id=0"
. ",lun=$drive->{index}";
}
- $device .= ",drive=drive-$drive_id,id=$drive_id";
+ # for the switch to -blockdev, there is no blockdev for 'none'
+ if (!min_version($machine_version, 10, 0) || $drive->{file} ne 'none') {
+ $device .= ",drive=drive-$drive_id";
+ }
+ $device .= ",id=$drive_id";
if ($drive->{ssd} && ($device_type eq 'block' || $device_type eq 'hd')) {
$device .= ",rotation_rate=1";
@@ -1432,7 +1441,10 @@ sub print_drivedevice_full {
} else {
$device .= ",bus=ahci$controller.$unit";
}
- $device .= ",drive=drive-$drive_id,id=$drive_id";
+ if (!min_version($machine_version, 10, 0) || $drive->{file} ne 'none') {
+ $device .= ",drive=drive-$drive_id";
+ }
+ $device .= ",id=$drive_id";
if ($device_type eq 'hd') {
if (my $model = $drive->{model}) {
diff --git a/src/test/cfg2cmd/bootorder-empty.conf.cmd b/src/test/cfg2cmd/bootorder-empty.conf.cmd
index e4bf4e6d..3f8fdb8e 100644
--- a/src/test/cfg2cmd/bootorder-empty.conf.cmd
+++ b/src/test/cfg2cmd/bootorder-empty.conf.cmd
@@ -28,7 +28,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2' \
-device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi4,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=4,drive=drive-scsi4,id=scsi4,write-cache=on' \
diff --git a/src/test/cfg2cmd/bootorder-legacy.conf.cmd b/src/test/cfg2cmd/bootorder-legacy.conf.cmd
index 7627780c..cd990cd8 100644
--- a/src/test/cfg2cmd/bootorder-legacy.conf.cmd
+++ b/src/test/cfg2cmd/bootorder-legacy.conf.cmd
@@ -28,7 +28,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi4,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=4,drive=drive-scsi4,id=scsi4,write-cache=on' \
diff --git a/src/test/cfg2cmd/bootorder.conf.cmd b/src/test/cfg2cmd/bootorder.conf.cmd
index 74af37e1..3cef2161 100644
--- a/src/test/cfg2cmd/bootorder.conf.cmd
+++ b/src/test/cfg2cmd/bootorder.conf.cmd
@@ -28,7 +28,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=103' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=103' \
-device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi4,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=4,drive=drive-scsi4,id=scsi4,bootindex=102,write-cache=on' \
diff --git a/src/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd b/src/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd
index effba2b7..e6e09278 100644
--- a/src/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd
+++ b/src/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd
@@ -26,7 +26,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/var/lib/vz/images/8006/base-8006-disk-0.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
diff --git a/src/test/cfg2cmd/seabios_serial.conf.cmd b/src/test/cfg2cmd/seabios_serial.conf.cmd
index f901a459..0eb02459 100644
--- a/src/test/cfg2cmd/seabios_serial.conf.cmd
+++ b/src/test/cfg2cmd/seabios_serial.conf.cmd
@@ -26,7 +26,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
diff --git a/src/test/cfg2cmd/simple-btrfs.conf.cmd b/src/test/cfg2cmd/simple-btrfs.conf.cmd
index 9c3f97d2..2aa2083d 100644
--- a/src/test/cfg2cmd/simple-btrfs.conf.cmd
+++ b/src/test/cfg2cmd/simple-btrfs.conf.cmd
@@ -26,7 +26,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/butter/bread/images/8006/vm-8006-disk-0/disk.raw,if=none,id=drive-scsi0,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
diff --git a/src/test/cfg2cmd/simple-cifs.conf.cmd b/src/test/cfg2cmd/simple-cifs.conf.cmd
index 61e8d01e..d23a046a 100644
--- a/src/test/cfg2cmd/simple-cifs.conf.cmd
+++ b/src/test/cfg2cmd/simple-cifs.conf.cmd
@@ -24,7 +24,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=native,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,write-cache=on' \
diff --git a/src/test/cfg2cmd/simple-rbd.conf.cmd b/src/test/cfg2cmd/simple-rbd.conf.cmd
index ea5934c4..df7cba3f 100644
--- a/src/test/cfg2cmd/simple-rbd.conf.cmd
+++ b/src/test/cfg2cmd/simple-rbd.conf.cmd
@@ -26,7 +26,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=rbd:cpool/vm-8006-disk-0:mon_host=127.0.0.42;127.0.0.21;[\:\:1]:auth_supported=none,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
diff --git a/src/test/cfg2cmd/simple-virtio-blk.conf.cmd b/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
index 2182febc..0a7eb473 100644
--- a/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
+++ b/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
@@ -27,7 +27,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-virtio0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,iothread=iothread-virtio0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
diff --git a/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd b/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
index d9a8e5e9..a90156b0 100644
--- a/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
+++ b/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
@@ -26,7 +26,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=iscsi://127.0.0.1/iqn.2019-10.org.test:foobar/0,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
diff --git a/src/test/cfg2cmd/simple1-template.conf.cmd b/src/test/cfg2cmd/simple1-template.conf.cmd
index 60531b77..c736c84a 100644
--- a/src/test/cfg2cmd/simple1-template.conf.cmd
+++ b/src/test/cfg2cmd/simple1-template.conf.cmd
@@ -24,7 +24,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/var/lib/vz/images/8006/base-8006-disk-1.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap,readonly=on' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,write-cache=on' \
diff --git a/src/test/cfg2cmd/simple1.conf.cmd b/src/test/cfg2cmd/simple1.conf.cmd
index aa76ca62..e657aed7 100644
--- a/src/test/cfg2cmd/simple1.conf.cmd
+++ b/src/test/cfg2cmd/simple1.conf.cmd
@@ -26,7 +26,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
- -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
+ -device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
-drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [RFC qemu-server 14/15] blockdev: add support for NBD paths
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (12 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 13/15] print drive device: don't reference any drive for 'none' starting with machine version 10.0 Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0 Fiona Ebner
` (2 subsequent siblings)
16 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Co-developed-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
RFC, not tested yet.
src/PVE/QemuServer/Blockdev.pm | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index 6e6b9245..a11bbaa6 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -12,6 +12,18 @@ use PVE::Storage;
use PVE::QemuServer::Drive qw(drive_is_cdrom);
+# gives ($host, $port, $export)
+my $NBD_TCP_PATH_RE_3 = qr/nbd:(\S+):(\d+):exportname=(\S+)/;
+my $NBD_UNIX_PATH_RE_2 = qr/nbd:unix:(\S+):exportname=(\S+)/;
+
+my sub is_nbd {
+ my ($drive) = @_;
+
+ return 1 if $drive->{file} =~ $NBD_TCP_PATH_RE_3;
+ return 1 if $drive->{file} =~ $NBD_UNIX_PATH_RE_2;
+ return 0;
+}
+
my sub get_node_name {
my ($type, $drive_id, $volid, $snap) = @_;
@@ -98,7 +110,13 @@ sub generate_file_blockdev {
my $drive_id = PVE::QemuServer::Drive::get_drive_id($drive);
- if ($drive->{file} eq 'cdrom') {
+ if ($drive->{file} =~ m/^$NBD_UNIX_PATH_RE_2$/) {
+ my $server = { type => 'unix', path => "$1" };
+ $blockdev = { driver => 'nbd', server => $server, export => "$2" };
+ } elsif ($drive->{file} =~ m/^$NBD_TCP_PATH_RE_3$/) {
+ my $server = { type => 'inet', host => "$1", port => "$2" }; # port is also a string in QAPI
+ $blockdev = { driver => 'nbd', server => $server, export => "$3" };
+ } elsif ($drive->{file} eq 'cdrom') {
my $path = PVE::QemuServer::Drive::get_iso_path($storecfg, $drive->{file});
$blockdev = { driver => 'host_cdrom', filename => "$path" };
} elsif ($drive->{file} =~ m|^/|) {
@@ -162,6 +180,7 @@ sub generate_format_blockdev {
die "generate_format_blockdev called without volid/path\n" if !$drive->{file};
die "generate_format_blockdev called with 'none'\n" if $drive->{file} eq 'none';
+ die "generate_format_blockdev called with NBD path\n" if is_nbd($drive);
my $scfg;
my $format;
@@ -210,7 +229,9 @@ sub generate_drive_blockdev {
die "generate_drive_blockdev called with 'none'\n" if $drive->{file} eq 'none';
my $child = generate_file_blockdev($storecfg, $drive, $options);
- $child = generate_format_blockdev($storecfg, $drive, $child, $options);
+ if (!is_nbd($drive)) {
+ $child = generate_format_blockdev($storecfg, $drive, $child, $options);
+ }
# this is the top filter entry point, use $drive-drive_id as nodename
return {
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (13 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 14/15] blockdev: add support for NBD paths Fiona Ebner
@ 2025-06-23 15:44 ` Fiona Ebner
2025-06-24 13:53 ` DERUMIER, Alexandre via pve-devel
2025-06-24 9:40 ` [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two DERUMIER, Alexandre via pve-devel
2025-06-24 11:44 ` [pve-devel] partially-applied: " Fabian Grünbichler
16 siblings, 1 reply; 31+ messages in thread
From: Fiona Ebner @ 2025-06-23 15:44 UTC (permalink / raw)
To: pve-devel
Co-developed-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
RFC, there will be a series to make everything work properly first.
Changes since last time:
* There is a default timeout in QMPClient now, so no need to specify it explicitly
* also switch for EFI disk
* remove throttle group again if blockdev-add fails
* mock file stat
* mock rbd_volume_config_get() (next version of storage patches have not
been sent yet).
src/PVE/QemuServer.pm | 165 +++++++++++++-----
src/PVE/QemuServer/OVMF.pm | 19 +-
src/test/cfg2cmd/aio.conf.cmd | 42 +++--
src/test/cfg2cmd/bootorder-empty.conf.cmd | 11 +-
src/test/cfg2cmd/bootorder-legacy.conf.cmd | 11 +-
src/test/cfg2cmd/bootorder.conf.cmd | 11 +-
...putype-icelake-client-deprecation.conf.cmd | 5 +-
src/test/cfg2cmd/efi-raw-template.conf.cmd | 7 +-
src/test/cfg2cmd/efi-raw.conf.cmd | 7 +-
.../cfg2cmd/efi-secboot-and-tpm-q35.conf.cmd | 7 +-
src/test/cfg2cmd/efi-secboot-and-tpm.conf.cmd | 7 +-
src/test/cfg2cmd/efidisk-on-rbd.conf.cmd | 7 +-
src/test/cfg2cmd/ide.conf.cmd | 15 +-
src/test/cfg2cmd/q35-ide.conf.cmd | 15 +-
.../q35-linux-hostpci-mapping.conf.cmd | 7 +-
.../q35-linux-hostpci-multifunction.conf.cmd | 7 +-
.../q35-linux-hostpci-template.conf.cmd | 10 +-
...q35-linux-hostpci-x-pci-overrides.conf.cmd | 7 +-
src/test/cfg2cmd/q35-linux-hostpci.conf.cmd | 7 +-
src/test/cfg2cmd/q35-simple.conf.cmd | 7 +-
src/test/cfg2cmd/seabios_serial.conf.cmd | 5 +-
src/test/cfg2cmd/sev-es.conf.cmd | 7 +-
src/test/cfg2cmd/sev-std.conf.cmd | 7 +-
src/test/cfg2cmd/simple-btrfs.conf.cmd | 14 +-
src/test/cfg2cmd/simple-cifs.conf.cmd | 14 +-
.../cfg2cmd/simple-disk-passthrough.conf.cmd | 9 +-
src/test/cfg2cmd/simple-lvm.conf.cmd | 12 +-
src/test/cfg2cmd/simple-lvmthin.conf.cmd | 12 +-
src/test/cfg2cmd/simple-rbd.conf.cmd | 26 ++-
src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 5 +-
.../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 14 +-
src/test/cfg2cmd/simple1-template.conf.cmd | 8 +-
src/test/cfg2cmd/simple1.conf.cmd | 5 +-
src/test/run_config2command_tests.pl | 22 +++
34 files changed, 368 insertions(+), 166 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 38272420..f8d80fe5 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -3972,13 +3972,33 @@ sub config_to_command {
push @$devices, '-blockdev', $live_restore->{blockdev};
}
- my $drive_cmd =
- print_drive_commandline_full($storecfg, $vmid, $drive, $live_blockdev_name);
+ if (min_version($machine_version, 10, 0)) { # for the switch to -blockdev
+ my $throttle_group = PVE::QemuServer::Blockdev::generate_throttle_group($drive);
+ push @$cmd, '-object', to_json($throttle_group, { canonical => 1 });
- # extra protection for templates, but SATA and IDE don't support it..
- $drive_cmd .= ',readonly=on' if drive_is_read_only($conf, $drive);
+ die "FIXME: blockdev for live restore not yet implemented"
+ if $live_blockdev_name;
+
+ my $extra_blockdev_options = {};
+ # extra protection for templates, but SATA and IDE don't support it..
+ $extra_blockdev_options->{'read-only'} = 1 if drive_is_read_only($conf, $drive);
+
+ if ($drive->{file} ne 'none') {
+ my $blockdev = PVE::QemuServer::Blockdev::generate_drive_blockdev(
+ $storecfg, $drive, $extra_blockdev_options,
+ );
+ push @$devices, '-blockdev', to_json($blockdev, { canonical => 1 });
+ }
+ } else {
+ my $drive_cmd =
+ print_drive_commandline_full($storecfg, $vmid, $drive, $live_blockdev_name);
+
+ # extra protection for templates, but SATA and IDE don't support it..
+ $drive_cmd .= ',readonly=on' if drive_is_read_only($conf, $drive);
+
+ push @$devices, '-drive', $drive_cmd;
+ }
- push @$devices, '-drive', $drive_cmd;
push @$devices, '-device',
print_drivedevice_full(
$storecfg, $conf, $vmid, $drive, $bridges, $arch, $machine_type,
@@ -4382,28 +4402,63 @@ sub qemu_iothread_del {
sub qemu_driveadd {
my ($storecfg, $vmid, $device) = @_;
- my $drive = print_drive_commandline_full($storecfg, $vmid, $device, undef);
- $drive =~ s/\\/\\\\/g;
- my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_add auto \"$drive\"", 60);
+ my $machine_type = PVE::QemuServer::Machine::get_current_qemu_machine($vmid);
- # If the command succeeds qemu prints: "OK"
- return 1 if $ret =~ m/OK/s;
+ # for the switch to -blockdev
+ if (PVE::QemuServer::Machine::is_machine_version_at_least($machine_type, 10, 0)) {
+ my $throttle_group = PVE::QemuServer::Blockdev::generate_throttle_group($device);
+ mon_cmd($vmid, 'object-add', %$throttle_group);
- die "adding drive failed: $ret\n";
+ eval {
+ my $blockdev =
+ PVE::QemuServer::Blockdev::generate_drive_blockdev($storecfg, $device, {});
+ mon_cmd($vmid, 'blockdev-add', %$blockdev);
+ };
+ if (my $err = $@) {
+ my $drive_id = PVE::QemuServer::Drive::get_drive_id($device);
+ eval { mon_cmd($vmid, 'object-del', id => "throttle-drive-$drive_id"); };
+ warn $@ if $@;
+ die $err;
+ }
+
+ return 1;
+ } else {
+ my $drive = print_drive_commandline_full($storecfg, $vmid, $device, undef);
+ $drive =~ s/\\/\\\\/g;
+ my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_add auto \"$drive\"", 60);
+
+ # If the command succeeds qemu prints: "OK"
+ return 1 if $ret =~ m/OK/s;
+
+ die "adding drive failed: $ret\n";
+ }
}
sub qemu_drivedel {
my ($vmid, $deviceid) = @_;
- my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_del drive-$deviceid", 10 * 60);
- $ret =~ s/^\s+//;
+ my $machine_type = PVE::QemuServer::Machine::get_current_qemu_machine($vmid);
- return 1 if $ret eq "";
+ # for the switch to -blockdev
+ if (PVE::QemuServer::Machine::is_machine_version_at_least($machine_type, 10, 0)) {
+ # QEMU recursively auto-removes the file children, i.e. file and format node below the top
+ # node and also implicit backing children referenced by a qcow2 image.
+ eval { mon_cmd($vmid, 'blockdev-del', 'node-name' => "drive-$deviceid"); };
+ die "deleting blockdev $deviceid failed : $@\n" if $@;
+ # FIXME ignore already removed scenario like below?
- # NB: device not found errors mean the drive was auto-deleted and we ignore the error
- return 1 if $ret =~ m/Device \'.*?\' not found/s;
+ mon_cmd($vmid, 'object-del', id => "throttle-drive-$deviceid");
+ } else {
+ my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_del drive-$deviceid", 10 * 60);
+ $ret =~ s/^\s+//;
- die "deleting drive $deviceid failed : $ret\n";
+ return 1 if $ret eq "";
+
+ # NB: device not found errors mean the drive was auto-deleted and we ignore the error
+ return 1 if $ret =~ m/Device \'.*?\' not found/s;
+
+ die "deleting drive $deviceid failed : $ret\n";
+ }
}
sub qemu_deviceaddverify {
@@ -4660,29 +4715,59 @@ sub qemu_block_set_io_throttle {
return if !check_running($vmid);
- mon_cmd(
- $vmid, "block_set_io_throttle",
- device => $deviceid,
- bps => int($bps),
- bps_rd => int($bps_rd),
- bps_wr => int($bps_wr),
- iops => int($iops),
- iops_rd => int($iops_rd),
- iops_wr => int($iops_wr),
- bps_max => int($bps_max),
- bps_rd_max => int($bps_rd_max),
- bps_wr_max => int($bps_wr_max),
- iops_max => int($iops_max),
- iops_rd_max => int($iops_rd_max),
- iops_wr_max => int($iops_wr_max),
- bps_max_length => int($bps_max_length),
- bps_rd_max_length => int($bps_rd_max_length),
- bps_wr_max_length => int($bps_wr_max_length),
- iops_max_length => int($iops_max_length),
- iops_rd_max_length => int($iops_rd_max_length),
- iops_wr_max_length => int($iops_wr_max_length),
- );
-
+ my $machine_type = PVE::QemuServer::Machine::get_current_qemu_machine($vmid);
+ # for the switch to -blockdev
+ if (PVE::QemuServer::Machine::is_machine_version_at_least($machine_type, 10, 0)) {
+ mon_cmd(
+ $vmid,
+ 'qom-set',
+ path => "throttle-$deviceid",
+ property => "limits",
+ value => {
+ 'bps-total' => int($bps),
+ 'bps-read' => int($bps_rd),
+ 'bps-write' => int($bps_wr),
+ 'iops-total' => int($iops),
+ 'iops-read' => int($iops_rd),
+ 'iops-write' => int($iops_wr),
+ 'bps-total-max' => int($bps_max),
+ 'bps-read-max' => int($bps_rd_max),
+ 'bps-write-max' => int($bps_wr_max),
+ 'iops-total-max' => int($iops_max),
+ 'iops-read-max' => int($iops_rd_max),
+ 'iops-write-max' => int($iops_wr_max),
+ 'bps-total-max-length' => int($bps_max_length),
+ 'bps-read-max-length' => int($bps_rd_max_length),
+ 'bps-write-max-length' => int($bps_wr_max_length),
+ 'iops-total-max-length' => int($iops_max_length),
+ 'iops-read-max-length' => int($iops_rd_max_length),
+ 'iops-write-max-length' => int($iops_wr_max_length),
+ },
+ );
+ } else {
+ mon_cmd(
+ $vmid, "block_set_io_throttle",
+ device => $deviceid,
+ bps => int($bps),
+ bps_rd => int($bps_rd),
+ bps_wr => int($bps_wr),
+ iops => int($iops),
+ iops_rd => int($iops_rd),
+ iops_wr => int($iops_wr),
+ bps_max => int($bps_max),
+ bps_rd_max => int($bps_rd_max),
+ bps_wr_max => int($bps_wr_max),
+ iops_max => int($iops_max),
+ iops_rd_max => int($iops_rd_max),
+ iops_wr_max => int($iops_wr_max),
+ bps_max_length => int($bps_max_length),
+ bps_rd_max_length => int($bps_rd_max_length),
+ bps_wr_max_length => int($bps_wr_max_length),
+ iops_max_length => int($iops_max_length),
+ iops_rd_max_length => int($iops_rd_max_length),
+ iops_wr_max_length => int($iops_wr_max_length),
+ );
+ }
}
sub qemu_block_resize {
diff --git a/src/PVE/QemuServer/OVMF.pm b/src/PVE/QemuServer/OVMF.pm
index 8b28f902..bf47d0d9 100644
--- a/src/PVE/QemuServer/OVMF.pm
+++ b/src/PVE/QemuServer/OVMF.pm
@@ -228,10 +228,21 @@ sub print_ovmf_commandline {
}
push $cmd->@*, '-bios', get_ovmf_files($arch, undef, undef, $amd_sev_type);
} else {
- my ($code_drive_str, $var_drive_str) =
- print_ovmf_drive_commandlines($conf, $storecfg, $vmid, $arch, $q35, $version_guard);
- push $cmd->@*, '-drive', $code_drive_str;
- push $cmd->@*, '-drive', $var_drive_str;
+ if ($version_guard->(10, 0, 0)) { # for the switch to -blockdev
+ my ($code_blockdev, $vars_blockdev, $throttle_group) =
+ generate_ovmf_blockdev($conf, $storecfg, $vmid, $arch, $q35);
+
+ push $cmd->@*, '-object', to_json($throttle_group, { canonical => 1 });
+ push $cmd->@*, '-blockdev', to_json($code_blockdev, { canonical => 1 });
+ push $cmd->@*, '-blockdev', to_json($vars_blockdev, { canonical => 1 });
+ push $machine_flags->@*, "pflash0=$code_blockdev->{'node-name'}",
+ "pflash1=$vars_blockdev->{'node-name'}";
+ } else {
+ my ($code_drive_str, $var_drive_str) =
+ print_ovmf_drive_commandlines($conf, $storecfg, $vmid, $arch, $q35, $version_guard);
+ push $cmd->@*, '-drive', $code_drive_str;
+ push $cmd->@*, '-drive', $var_drive_str;
+ }
}
return ($cmd, $machine_flags);
diff --git a/src/test/cfg2cmd/aio.conf.cmd b/src/test/cfg2cmd/aio.conf.cmd
index c199bacf..272c6cd6 100644
--- a/src/test/cfg2cmd/aio.conf.cmd
+++ b/src/test/cfg2cmd/aio.conf.cmd
@@ -14,6 +14,20 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 512 \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi3","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi4","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi5","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi6","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi7","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi8","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi9","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi10","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi11","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi12","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi13","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -24,33 +38,33 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.raw,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=threads,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.raw","node-name":"e3b2553803d55d43b9986a0aac3e9a7","read-only":false},"node-name":"f3b2553803d55d43b9986a0aac3e9a7","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=0,drive=drive-scsi0,id=scsi0,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-1.raw,if=none,id=drive-scsi1,discard=on,format=raw,cache=none,aio=native,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"native","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-1.raw","node-name":"e08707d013893852b3d4d42301a4298","read-only":false},"node-name":"f08707d013893852b3d4d42301a4298","read-only":false},"node-name":"drive-scsi1","throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=1,drive=drive-scsi1,id=scsi1,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-2.raw,if=none,id=drive-scsi2,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-2.raw","node-name":"edb0854bba55e8b2544ad937c9f5afc","read-only":false},"node-name":"fdb0854bba55e8b2544ad937c9f5afc","read-only":false},"node-name":"drive-scsi2","throttle-group":"throttle-drive-scsi2"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=2,drive=drive-scsi2,id=scsi2,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-3.raw,if=none,id=drive-scsi3,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-3.raw","node-name":"e9c170cb9491763cad3f31718205efc","read-only":false},"node-name":"f9c170cb9491763cad3f31718205efc","read-only":false},"node-name":"drive-scsi3","throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=3,drive=drive-scsi3,id=scsi3,write-cache=on' \
- -drive 'file=/mnt/pve/cifs-store/images/8006/vm-8006-disk-4.raw,if=none,id=drive-scsi4,discard=on,format=raw,cache=none,aio=native,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"native","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/mnt/pve/cifs-store/images/8006/vm-8006-disk-4.raw","node-name":"ea34ecc24c40da0d53420ef344ced37","read-only":false},"node-name":"fa34ecc24c40da0d53420ef344ced37","read-only":false},"node-name":"drive-scsi4","throttle-group":"throttle-drive-scsi4"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=4,drive=drive-scsi4,id=scsi4,write-cache=on' \
- -drive 'file=/mnt/pve/cifs-store/images/8006/vm-8006-disk-5.raw,if=none,id=drive-scsi5,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/mnt/pve/cifs-store/images/8006/vm-8006-disk-5.raw","node-name":"e39cacf47a4f4877072601505d90949","read-only":false},"node-name":"f39cacf47a4f4877072601505d90949","read-only":false},"node-name":"drive-scsi5","throttle-group":"throttle-drive-scsi5"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=5,drive=drive-scsi5,id=scsi5,write-cache=on' \
- -drive 'file=/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-6,if=none,id=drive-scsi6,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-6","node-name":"e7db1ee70981087e4a2861bc7da417b","read-only":false},"node-name":"f7db1ee70981087e4a2861bc7da417b","read-only":false},"node-name":"drive-scsi6","throttle-group":"throttle-drive-scsi6"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=6,drive=drive-scsi6,id=scsi6,write-cache=on' \
-device 'lsi,id=scsihw1,bus=pci.0,addr=0x6' \
- -drive 'file=/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-7,if=none,id=drive-scsi7,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-7","node-name":"e2d2deac808301140a96c862fe3ea85","read-only":false},"node-name":"f2d2deac808301140a96c862fe3ea85","read-only":false},"node-name":"drive-scsi7","throttle-group":"throttle-drive-scsi7"}' \
-device 'scsi-hd,bus=scsihw1.0,scsi-id=0,drive=drive-scsi7,id=scsi7,write-cache=on' \
- -drive 'file=/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-8,if=none,id=drive-scsi8,cache=writeback,discard=on,format=raw,aio=threads,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-8","node-name":"e9796b73db57b8943746ede7d0d3060","read-only":false},"node-name":"f9796b73db57b8943746ede7d0d3060","read-only":false},"node-name":"drive-scsi8","throttle-group":"throttle-drive-scsi8"}' \
-device 'scsi-hd,bus=scsihw1.0,scsi-id=1,drive=drive-scsi8,id=scsi8,write-cache=on' \
- -drive 'file=/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-9,if=none,id=drive-scsi9,cache=writeback,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-9","node-name":"efa538892acc012edbdc5810035bf7d","read-only":false},"node-name":"ffa538892acc012edbdc5810035bf7d","read-only":false},"node-name":"drive-scsi9","throttle-group":"throttle-drive-scsi9"}' \
-device 'scsi-hd,bus=scsihw1.0,scsi-id=2,drive=drive-scsi9,id=scsi9,write-cache=on' \
- -drive 'file=rbd:cpool/vm-8006-disk-8:mon_host=127.0.0.42;127.0.0.21;[\:\:1]:auth_supported=none,if=none,id=drive-scsi10,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"auth-client-required":["none"],"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"rbd","image":"vm-8006-disk-8","node-name":"e6f4cbffa741d16bba69304eb2800ef","pool":"cpool","read-only":false,"server":[{"host":"127.0.0.42","port":"3300"},{"host":"127.0.0.21","port":"3300"},{"host":"::1","port":"3300"}]},"node-name":"f6f4cbffa741d16bba69304eb2800ef","read-only":false},"node-name":"drive-scsi10","throttle-group":"throttle-drive-scsi10"}' \
-device 'scsi-hd,bus=scsihw1.0,scsi-id=3,drive=drive-scsi10,id=scsi10,write-cache=on' \
- -drive 'file=rbd:cpool/vm-8006-disk-8:mon_host=127.0.0.42;127.0.0.21;[\:\:1]:auth_supported=none,if=none,id=drive-scsi11,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"auth-client-required":["none"],"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"rbd","image":"vm-8006-disk-8","node-name":"e42375c54de70f5f4be966d98c90255","pool":"cpool","read-only":false,"server":[{"host":"127.0.0.42","port":"3300"},{"host":"127.0.0.21","port":"3300"},{"host":"::1","port":"3300"}]},"node-name":"f42375c54de70f5f4be966d98c90255","read-only":false},"node-name":"drive-scsi11","throttle-group":"throttle-drive-scsi11"}' \
-device 'scsi-hd,bus=scsihw1.0,scsi-id=4,drive=drive-scsi11,id=scsi11,write-cache=on' \
- -drive 'file=/dev/veegee/vm-8006-disk-9,if=none,id=drive-scsi12,discard=on,format=raw,cache=none,aio=native,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"native","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/veegee/vm-8006-disk-9","node-name":"ed7b2c9e0133619fcf6cb8ce5903502","read-only":false},"node-name":"fd7b2c9e0133619fcf6cb8ce5903502","read-only":false},"node-name":"drive-scsi12","throttle-group":"throttle-drive-scsi12"}' \
-device 'scsi-hd,bus=scsihw1.0,scsi-id=5,drive=drive-scsi12,id=scsi12,write-cache=on' \
- -drive 'file=/dev/veegee/vm-8006-disk-9,if=none,id=drive-scsi13,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/veegee/vm-8006-disk-9","node-name":"ed85420a880203ca1401d00a8edf132","read-only":false},"node-name":"fd85420a880203ca1401d00a8edf132","read-only":false},"node-name":"drive-scsi13","throttle-group":"throttle-drive-scsi13"}' \
-device 'scsi-hd,bus=scsihw1.0,scsi-id=6,drive=drive-scsi13,id=scsi13,write-cache=on' \
-machine 'type=pc+pve0'
diff --git a/src/test/cfg2cmd/bootorder-empty.conf.cmd b/src/test/cfg2cmd/bootorder-empty.conf.cmd
index 3f8fdb8e..89f73145 100644
--- a/src/test/cfg2cmd/bootorder-empty.conf.cmd
+++ b/src/test/cfg2cmd/bootorder-empty.conf.cmd
@@ -15,8 +15,12 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi4","limits":{},"qom-type":"throttle-group"}' \
-object 'iothread,id=iothread-virtio0' \
+ -object '{"id":"throttle-drive-virtio0","limits":{},"qom-type":"throttle-group"}' \
-object 'iothread,id=iothread-virtio1' \
+ -object '{"id":"throttle-drive-virtio1","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -27,14 +31,13 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2' \
-device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi4,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"e6bf62e20f6c14a2c19bd6f1f5ac36c","read-only":false},"node-name":"f6bf62e20f6c14a2c19bd6f1f5ac36c","read-only":false},"node-name":"drive-scsi4","throttle-group":"throttle-drive-scsi4"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=4,drive=drive-scsi4,id=scsi4,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-virtio0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"edd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"fdd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"drive-virtio0","throttle-group":"throttle-drive-virtio0"}' \
-device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,iothread=iothread-virtio0,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-virtio1,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"eeb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"feb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"drive-virtio1","throttle-group":"throttle-drive-virtio1"}' \
-device 'virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256' \
diff --git a/src/test/cfg2cmd/bootorder-legacy.conf.cmd b/src/test/cfg2cmd/bootorder-legacy.conf.cmd
index cd990cd8..a2341692 100644
--- a/src/test/cfg2cmd/bootorder-legacy.conf.cmd
+++ b/src/test/cfg2cmd/bootorder-legacy.conf.cmd
@@ -15,8 +15,12 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi4","limits":{},"qom-type":"throttle-group"}' \
-object 'iothread,id=iothread-virtio0' \
+ -object '{"id":"throttle-drive-virtio0","limits":{},"qom-type":"throttle-group"}' \
-object 'iothread,id=iothread-virtio1' \
+ -object '{"id":"throttle-drive-virtio1","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -27,14 +31,13 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi4,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"e6bf62e20f6c14a2c19bd6f1f5ac36c","read-only":false},"node-name":"f6bf62e20f6c14a2c19bd6f1f5ac36c","read-only":false},"node-name":"drive-scsi4","throttle-group":"throttle-drive-scsi4"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=4,drive=drive-scsi4,id=scsi4,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-virtio0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"edd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"fdd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"drive-virtio0","throttle-group":"throttle-drive-virtio0"}' \
-device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,iothread=iothread-virtio0,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-virtio1,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"eeb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"feb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"drive-virtio1","throttle-group":"throttle-drive-virtio1"}' \
-device 'virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1,bootindex=302,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=100' \
diff --git a/src/test/cfg2cmd/bootorder.conf.cmd b/src/test/cfg2cmd/bootorder.conf.cmd
index 3cef2161..87a9fca0 100644
--- a/src/test/cfg2cmd/bootorder.conf.cmd
+++ b/src/test/cfg2cmd/bootorder.conf.cmd
@@ -15,8 +15,12 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi4","limits":{},"qom-type":"throttle-group"}' \
-object 'iothread,id=iothread-virtio0' \
+ -object '{"id":"throttle-drive-virtio0","limits":{},"qom-type":"throttle-group"}' \
-object 'iothread,id=iothread-virtio1' \
+ -object '{"id":"throttle-drive-virtio1","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -27,14 +31,13 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=103' \
-device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi4,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"e6bf62e20f6c14a2c19bd6f1f5ac36c","read-only":false},"node-name":"f6bf62e20f6c14a2c19bd6f1f5ac36c","read-only":false},"node-name":"drive-scsi4","throttle-group":"throttle-drive-scsi4"}' \
-device 'scsi-hd,bus=scsihw0.0,scsi-id=4,drive=drive-scsi4,id=scsi4,bootindex=102,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-virtio0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"edd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"fdd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"drive-virtio0","throttle-group":"throttle-drive-virtio0"}' \
-device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,iothread=iothread-virtio0,write-cache=on' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-virtio1,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"eeb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"feb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"drive-virtio1","throttle-group":"throttle-drive-virtio1"}' \
-device 'virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=101' \
diff --git a/src/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd b/src/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd
index e6e09278..11533c1d 100644
--- a/src/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd
+++ b/src/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd
@@ -15,6 +15,8 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu 'Icelake-Server,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,vendor=GenuineIntel' \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -25,9 +27,8 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/8006/base-8006-disk-0.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/base-8006-disk-0.qcow2","node-name":"e417d5947e69c5890b1e3ddf8a68167","read-only":false},"node-name":"f417d5947e69c5890b1e3ddf8a68167","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
-machine 'type=pc+pve0'
diff --git a/src/test/cfg2cmd/efi-raw-template.conf.cmd b/src/test/cfg2cmd/efi-raw-template.conf.cmd
index f66cbb0d..642898cd 100644
--- a/src/test/cfg2cmd/efi-raw-template.conf.cmd
+++ b/src/test/cfg2cmd/efi-raw-template.conf.cmd
@@ -8,8 +8,9 @@
-mon 'chardev=qmp-event,mode=control' \
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/var/lib/vz/images/100/base-disk-100-0.raw,size=131072,readonly=on' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/base-disk-100-0.raw","node-name":"e3bd051dc2860cd423537bc00138c50","read-only":true},"node-name":"f3bd051dc2860cd423537bc00138c50","read-only":true,"size":131072},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-smp '1,sockets=1,cores=1,maxcpus=1' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
@@ -25,5 +26,5 @@
-device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -machine 'accel=tcg,type=pc+pve0' \
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,accel=tcg,type=pc+pve0' \
-snapshot
diff --git a/src/test/cfg2cmd/efi-raw.conf.cmd b/src/test/cfg2cmd/efi-raw.conf.cmd
index 6406686d..2db6ca41 100644
--- a/src/test/cfg2cmd/efi-raw.conf.cmd
+++ b/src/test/cfg2cmd/efi-raw.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=7b10d7af-b932-4c66-b2c3-3996152ec465' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/var/lib/vz/images/100/vm-disk-100-0.raw,size=131072' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-disk-100-0.raw","node-name":"e3c77a41648168ee29008dc344126a9","read-only":false},"node-name":"f3c77a41648168ee29008dc344126a9","read-only":false,"size":131072},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-smp '1,sockets=1,cores=1,maxcpus=1' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
@@ -26,4 +27,4 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -machine 'type=pc+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=pc+pve0'
diff --git a/src/test/cfg2cmd/efi-secboot-and-tpm-q35.conf.cmd b/src/test/cfg2cmd/efi-secboot-and-tpm-q35.conf.cmd
index 4e9a7e87..a17f2165 100644
--- a/src/test/cfg2cmd/efi-secboot-and-tpm-q35.conf.cmd
+++ b/src/test/cfg2cmd/efi-secboot-and-tpm-q35.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=7b10d7af-b932-4c66-b2c3-3996152ec465' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE_4M.secboot.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/var/lib/vz/images/100/vm-disk-100-0.raw,size=540672' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE_4M.secboot.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-disk-100-0.raw","node-name":"e3c77a41648168ee29008dc344126a9","read-only":false},"node-name":"f3c77a41648168ee29008dc344126a9","read-only":false,"size":540672},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-smp '1,sockets=1,cores=1,maxcpus=1' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
@@ -27,4 +28,4 @@
-device 'VGA,id=vga,bus=pcie.0,addr=0x1' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -machine 'type=q35+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
diff --git a/src/test/cfg2cmd/efi-secboot-and-tpm.conf.cmd b/src/test/cfg2cmd/efi-secboot-and-tpm.conf.cmd
index 175d9b10..475487ce 100644
--- a/src/test/cfg2cmd/efi-secboot-and-tpm.conf.cmd
+++ b/src/test/cfg2cmd/efi-secboot-and-tpm.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=7b10d7af-b932-4c66-b2c3-3996152ec465' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE_4M.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/var/lib/vz/images/100/vm-disk-100-0.raw,size=540672' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE_4M.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-disk-100-0.raw","node-name":"e3c77a41648168ee29008dc344126a9","read-only":false},"node-name":"f3c77a41648168ee29008dc344126a9","read-only":false,"size":540672},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-smp '1,sockets=1,cores=1,maxcpus=1' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
@@ -29,4 +30,4 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -machine 'type=pc+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=pc+pve0'
diff --git a/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd b/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
index 5c55c01b..474e8038 100644
--- a/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
+++ b/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e688' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,cache=writeback,format=raw,file=rbd:cpool/vm-100-disk-1:mon_host=127.0.0.42;127.0.0.21;[\:\:1]:auth_supported=none:rbd_cache_policy=writeback,size=131072' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"auth-client-required":["none"],"cache":{"direct":false,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"rbd","image":"vm-100-disk-1","node-name":"eeb8f022b5551ad1d795611f112c767","pool":"cpool","read-only":false,"server":[{"host":"127.0.0.42","port":"3300"},{"host":"127.0.0.21","port":"3300"},{"host":"::1","port":"3300"}]},"node-name":"feb8f022b5551ad1d795611f112c767","read-only":false,"size":131072},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-smp '1,sockets=1,cores=1,maxcpus=1' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
@@ -31,4 +32,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=pc+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=pc+pve0'
diff --git a/src/test/cfg2cmd/ide.conf.cmd b/src/test/cfg2cmd/ide.conf.cmd
index a0d6c3ed..78fe7550 100644
--- a/src/test/cfg2cmd/ide.conf.cmd
+++ b/src/test/cfg2cmd/ide.conf.cmd
@@ -15,6 +15,11 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 512 \
+ -object '{"id":"throttle-drive-ide0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-ide1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-ide3","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -25,16 +30,16 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'file=/var/lib/vz/template/iso/zero.iso,if=none,id=drive-ide0,media=cdrom,format=raw,aio=io_uring' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"driver":"file","filename":"/var/lib/vz/template/iso/zero.iso","node-name":"e19e15bf93b8cf09e2a5d1669648165","read-only":true},"node-name":"f19e15bf93b8cf09e2a5d1669648165","read-only":true},"node-name":"drive-ide0","throttle-group":"throttle-drive-ide0"}' \
-device 'ide-cd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=200' \
- -drive 'file=/mnt/pve/cifs-store/template/iso/one.iso,if=none,id=drive-ide1,media=cdrom,format=raw,aio=threads' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"driver":"file","filename":"/mnt/pve/cifs-store/template/iso/one.iso","node-name":"e247a6535f864815c8e9dbb5a118336","read-only":true},"node-name":"f247a6535f864815c8e9dbb5a118336","read-only":true},"node-name":"drive-ide1","throttle-group":"throttle-drive-ide1"}' \
-device 'ide-cd,bus=ide.0,unit=1,drive=drive-ide1,id=ide1,bootindex=201' \
- -drive 'file=/mnt/pve/cifs-store/template/iso/two.iso,if=none,id=drive-ide2,media=cdrom,format=raw,aio=threads' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"driver":"file","filename":"/mnt/pve/cifs-store/template/iso/two.iso","node-name":"ec78a64f692c2fa9f873a111580aebd","read-only":true},"node-name":"fc78a64f692c2fa9f873a111580aebd","read-only":true},"node-name":"drive-ide2","throttle-group":"throttle-drive-ide2"}' \
-device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=202' \
- -drive 'file=/mnt/pve/cifs-store/template/iso/three.iso,if=none,id=drive-ide3,media=cdrom,format=raw,aio=threads' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"driver":"file","filename":"/mnt/pve/cifs-store/template/iso/three.iso","node-name":"e35557bae4bcbf9edc9f7ff7f132f30","read-only":true},"node-name":"f35557bae4bcbf9edc9f7ff7f132f30","read-only":true},"node-name":"drive-ide3","throttle-group":"throttle-drive-ide3"}' \
-device 'ide-cd,bus=ide.1,unit=1,drive=drive-ide3,id=ide3,bootindex=203' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/100/vm-100-disk-2.qcow2,if=none,id=drive-scsi0,format=qcow2,cache=none,aio=io_uring,detect-zeroes=on' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-2.qcow2","node-name":"ec11e0572184321efc5835152b95d5d","read-only":false},"node-name":"fc11e0572184321efc5835152b95d5d","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/cfg2cmd/q35-ide.conf.cmd b/src/test/cfg2cmd/q35-ide.conf.cmd
index f12fa44d..f94accb9 100644
--- a/src/test/cfg2cmd/q35-ide.conf.cmd
+++ b/src/test/cfg2cmd/q35-ide.conf.cmd
@@ -16,6 +16,11 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 512 \
+ -object '{"id":"throttle-drive-ide0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-ide1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-ide3","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
-global 'ICH9-LPC.disable_s3=1' \
-global 'ICH9-LPC.disable_s4=1' \
-readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \
@@ -24,16 +29,16 @@
-device 'VGA,id=vga,bus=pcie.0,addr=0x1' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'file=/mnt/pve/cifs-store/template/iso/zero.iso,if=none,id=drive-ide0,media=cdrom,format=raw,aio=threads' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"driver":"file","filename":"/mnt/pve/cifs-store/template/iso/zero.iso","node-name":"e1677eafc00b7016099210662868e38","read-only":true},"node-name":"f1677eafc00b7016099210662868e38","read-only":true},"node-name":"drive-ide0","throttle-group":"throttle-drive-ide0"}' \
-device 'ide-cd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=200' \
- -drive 'file=/mnt/pve/cifs-store/template/iso/one.iso,if=none,id=drive-ide1,media=cdrom,format=raw,aio=threads' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"driver":"file","filename":"/mnt/pve/cifs-store/template/iso/one.iso","node-name":"e247a6535f864815c8e9dbb5a118336","read-only":true},"node-name":"f247a6535f864815c8e9dbb5a118336","read-only":true},"node-name":"drive-ide1","throttle-group":"throttle-drive-ide1"}' \
-device 'ide-cd,bus=ide.2,unit=0,drive=drive-ide1,id=ide1,bootindex=201' \
- -drive 'file=/mnt/pve/cifs-store/template/iso/two.iso,if=none,id=drive-ide2,media=cdrom,format=raw,aio=threads' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"driver":"file","filename":"/mnt/pve/cifs-store/template/iso/two.iso","node-name":"ec78a64f692c2fa9f873a111580aebd","read-only":true},"node-name":"fc78a64f692c2fa9f873a111580aebd","read-only":true},"node-name":"drive-ide2","throttle-group":"throttle-drive-ide2"}' \
-device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=202' \
- -drive 'file=/mnt/pve/cifs-store/template/iso/three.iso,if=none,id=drive-ide3,media=cdrom,format=raw,aio=threads' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"driver":"file","filename":"/mnt/pve/cifs-store/template/iso/three.iso","node-name":"e35557bae4bcbf9edc9f7ff7f132f30","read-only":true},"node-name":"f35557bae4bcbf9edc9f7ff7f132f30","read-only":true},"node-name":"drive-ide3","throttle-group":"throttle-drive-ide3"}' \
-device 'ide-cd,bus=ide.3,unit=0,drive=drive-ide3,id=ide3,bootindex=203' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/100/vm-100-disk-2.qcow2,if=none,id=drive-scsi0,format=qcow2,cache=none,aio=io_uring,detect-zeroes=on' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-2.qcow2","node-name":"ec11e0572184321efc5835152b95d5d","read-only":false},"node-name":"fc11e0572184321efc5835152b95d5d","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd
index 717c0be4..0f547533 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=qcow2,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-1.qcow2","node-name":"e70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"f70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \
-smp '2,sockets=2,cores=1,maxcpus=2' \
-nodefaults \
@@ -35,4 +36,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=q35+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
diff --git a/src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd
index 146bf3e5..f94e913d 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=qcow2,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-1.qcow2","node-name":"e70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"f70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \
-smp '2,sockets=2,cores=1,maxcpus=2' \
-nodefaults \
@@ -35,4 +36,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=q35+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
diff --git a/src/test/cfg2cmd/q35-linux-hostpci-template.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci-template.conf.cmd
index ce69f23a..8826e5ed 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci-template.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci-template.conf.cmd
@@ -8,8 +8,9 @@
-mon 'chardev=qmp-event,mode=control' \
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=qcow2,file=/var/lib/vz/images/100/base-100-disk-1.qcow2,readonly=on' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/base-100-disk-1.qcow2","node-name":"eb6bec0e3c391fabb7fb7dd73ced9bf","read-only":true},"node-name":"fb6bec0e3c391fabb7fb7dd73ced9bf","read-only":true},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-smp '1,sockets=1,cores=1,maxcpus=1' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
@@ -17,6 +18,7 @@
-nographic \
-cpu qemu64 \
-m 512 \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -26,7 +28,7 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/100/base-100-disk-2.raw,if=none,id=drive-scsi0,format=raw,cache=none,aio=io_uring,detect-zeroes=on,readonly=on' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/base-100-disk-2.raw","node-name":"e24dfe239201bb9924fc4cfb899ca70","read-only":true},"node-name":"f24dfe239201bb9924fc4cfb899ca70","read-only":true},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,write-cache=on' \
- -machine 'accel=tcg,type=pc+pve0' \
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,accel=tcg,type=pc+pve0' \
-snapshot
diff --git a/src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd
index 0f0cb2c0..5090335e 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=qcow2,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-1.qcow2","node-name":"e70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"f70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \
-smp '2,sockets=2,cores=1,maxcpus=2' \
-nodefaults \
@@ -34,4 +35,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=q35+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
diff --git a/src/test/cfg2cmd/q35-linux-hostpci.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci.conf.cmd
index 0abb569b..0c1b4f07 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=qcow2,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-1.qcow2","node-name":"e70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"f70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \
-smp '2,sockets=2,cores=1,maxcpus=2' \
-nodefaults \
@@ -40,4 +41,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=q35+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
diff --git a/src/test/cfg2cmd/q35-simple.conf.cmd b/src/test/cfg2cmd/q35-simple.conf.cmd
index 371ea7dd..d555f021 100644
--- a/src/test/cfg2cmd/q35-simple.conf.cmd
+++ b/src/test/cfg2cmd/q35-simple.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=qcow2,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-1.qcow2","node-name":"e70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"f70e3017c5a79fdee5a04aa92ac1e9c","read-only":false},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \
-smp '2,sockets=1,cores=2,maxcpus=2' \
-nodefaults \
@@ -28,4 +29,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=q35+pve0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
diff --git a/src/test/cfg2cmd/seabios_serial.conf.cmd b/src/test/cfg2cmd/seabios_serial.conf.cmd
index 0eb02459..a00def0a 100644
--- a/src/test/cfg2cmd/seabios_serial.conf.cmd
+++ b/src/test/cfg2cmd/seabios_serial.conf.cmd
@@ -15,6 +15,8 @@
-nographic \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -25,10 +27,9 @@
-device 'isa-serial,chardev=serial0' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"ecd04be4259153b8293415fefa2a84c","read-only":false},"node-name":"fcd04be4259153b8293415fefa2a84c","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/cfg2cmd/sev-es.conf.cmd b/src/test/cfg2cmd/sev-es.conf.cmd
index 3a100306..d6acfa8c 100644
--- a/src/test/cfg2cmd/sev-es.conf.cmd
+++ b/src/test/cfg2cmd/sev-es.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=7b10d7af-b932-4c66-b2c3-3996152ec465' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CVM_CODE_4M.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/var/lib/vz/images/100/vm-disk-100-0.raw,size=540672' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CVM_CODE_4M.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-disk-100-0.raw","node-name":"e3c77a41648168ee29008dc344126a9","read-only":false},"node-name":"f3c77a41648168ee29008dc344126a9","read-only":false,"size":540672},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-smp '1,sockets=1,cores=1,maxcpus=1' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
@@ -27,4 +28,4 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-object 'sev-guest,id=sev0,cbitpos=51,reduced-phys-bits=6,policy=0xc' \
- -machine 'type=pc+pve0,confidential-guest-support=sev0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=pc+pve0,confidential-guest-support=sev0'
diff --git a/src/test/cfg2cmd/sev-std.conf.cmd b/src/test/cfg2cmd/sev-std.conf.cmd
index 06da2ca0..ea0ddec9 100644
--- a/src/test/cfg2cmd/sev-std.conf.cmd
+++ b/src/test/cfg2cmd/sev-std.conf.cmd
@@ -9,8 +9,9 @@
-pidfile /var/run/qemu-server/8006.pid \
-daemonize \
-smbios 'type=1,uuid=7b10d7af-b932-4c66-b2c3-3996152ec465' \
- -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CVM_CODE_4M.fd' \
- -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/var/lib/vz/images/100/vm-disk-100-0.raw,size=540672' \
+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
+ -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CVM_CODE_4M.fd"},"node-name":"pflash0"}' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-disk-100-0.raw","node-name":"e3c77a41648168ee29008dc344126a9","read-only":false},"node-name":"f3c77a41648168ee29008dc344126a9","read-only":false,"size":540672},"node-name":"drive-efidisk0","throttle-group":"throttle-drive-efidisk0"}' \
-smp '1,sockets=1,cores=1,maxcpus=1' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
@@ -27,4 +28,4 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-object 'sev-guest,id=sev0,cbitpos=51,reduced-phys-bits=6,policy=0x8' \
- -machine 'type=pc+pve0,confidential-guest-support=sev0'
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=pc+pve0,confidential-guest-support=sev0'
diff --git a/src/test/cfg2cmd/simple-btrfs.conf.cmd b/src/test/cfg2cmd/simple-btrfs.conf.cmd
index 2aa2083d..6c944f62 100644
--- a/src/test/cfg2cmd/simple-btrfs.conf.cmd
+++ b/src/test/cfg2cmd/simple-btrfs.conf.cmd
@@ -15,6 +15,11 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi3","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -25,16 +30,15 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/butter/bread/images/8006/vm-8006-disk-0/disk.raw,if=none,id=drive-scsi0,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/butter/bread/images/8006/vm-8006-disk-0/disk.raw","node-name":"e99aff0ff797aa030a22e9f580076dd","read-only":false},"node-name":"f99aff0ff797aa030a22e9f580076dd","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
- -drive 'file=/butter/bread/images/8006/vm-8006-disk-0/disk.raw,if=none,id=drive-scsi1,cache=writeback,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/butter/bread/images/8006/vm-8006-disk-0/disk.raw","node-name":"e7b2fd2a8c5dbfc550d9781e5df8841","read-only":false},"node-name":"f7b2fd2a8c5dbfc550d9781e5df8841","read-only":false},"node-name":"drive-scsi1","throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,write-cache=on' \
- -drive 'file=/butter/bread/images/8006/vm-8006-disk-0/disk.raw,if=none,id=drive-scsi2,cache=writethrough,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/butter/bread/images/8006/vm-8006-disk-0/disk.raw","node-name":"ed78b07bb04c2cbd8aedc648e885569","read-only":false},"node-name":"fd78b07bb04c2cbd8aedc648e885569","read-only":false},"node-name":"drive-scsi2","throttle-group":"throttle-drive-scsi2"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=2,drive=drive-scsi2,id=scsi2,write-cache=off' \
- -drive 'file=/butter/bread/images/8006/vm-8006-disk-0/disk.raw,if=none,id=drive-scsi3,cache=directsync,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/butter/bread/images/8006/vm-8006-disk-0/disk.raw","node-name":"e7487c01d831e2b51a5446980170ec9","read-only":false},"node-name":"f7487c01d831e2b51a5446980170ec9","read-only":false},"node-name":"drive-scsi3","throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi3,id=scsi3,write-cache=off' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/cfg2cmd/simple-cifs.conf.cmd b/src/test/cfg2cmd/simple-cifs.conf.cmd
index d23a046a..f22eb033 100644
--- a/src/test/cfg2cmd/simple-cifs.conf.cmd
+++ b/src/test/cfg2cmd/simple-cifs.conf.cmd
@@ -14,6 +14,11 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 512 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi3","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -23,15 +28,14 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=native,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"native","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw","node-name":"e2b3b8f2d6a23adc1aa3ecd195dbaf5","read-only":false},"node-name":"f2b3b8f2d6a23adc1aa3ecd195dbaf5","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,write-cache=on' \
- -drive 'file=/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw,if=none,id=drive-scsi1,cache=writeback,discard=on,format=raw,aio=threads,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw","node-name":"ee4d9a961200a669c1a8182632aba3e","read-only":false},"node-name":"fe4d9a961200a669c1a8182632aba3e","read-only":false},"node-name":"drive-scsi1","throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,write-cache=on' \
- -drive 'file=/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw,if=none,id=drive-scsi2,cache=writethrough,discard=on,format=raw,aio=threads,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw","node-name":"e6a3bf7eee1e2636cbe31f62b537b6c","read-only":false},"node-name":"f6a3bf7eee1e2636cbe31f62b537b6c","read-only":false},"node-name":"drive-scsi2","throttle-group":"throttle-drive-scsi2"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=2,drive=drive-scsi2,id=scsi2,write-cache=off' \
- -drive 'file=/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw,if=none,id=drive-scsi3,cache=directsync,discard=on,format=raw,aio=native,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"native","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/mnt/pve/cifs-store/images/8006/vm-8006-disk-0.raw","node-name":"e7042ee58e764b1296ad54014cb9a03","read-only":false},"node-name":"f7042ee58e764b1296ad54014cb9a03","read-only":false},"node-name":"drive-scsi3","throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi3,id=scsi3,write-cache=off' \
-machine 'type=pc+pve0'
diff --git a/src/test/cfg2cmd/simple-disk-passthrough.conf.cmd b/src/test/cfg2cmd/simple-disk-passthrough.conf.cmd
index 70ee9f6b..58368210 100644
--- a/src/test/cfg2cmd/simple-disk-passthrough.conf.cmd
+++ b/src/test/cfg2cmd/simple-disk-passthrough.conf.cmd
@@ -15,6 +15,9 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -25,12 +28,12 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'file=/dev/cdrom,if=none,id=drive-ide2,media=cdrom,format=raw,aio=io_uring' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"driver":"host_cdrom","filename":"/dev/cdrom","node-name":"ee50e59431a6228dc388fc821b35696","read-only":true},"node-name":"fe50e59431a6228dc388fc821b35696","read-only":true},"node-name":"drive-ide2","throttle-group":"throttle-drive-ide2"}' \
-device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/dev/sda,if=none,id=drive-scsi0,format=raw,cache=none,aio=io_uring,detect-zeroes=on' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"host_device","filename":"/dev/sda","node-name":"eec235c1b362ebd19d5e98959b4c171","read-only":false},"node-name":"fec235c1b362ebd19d5e98959b4c171","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
- -drive 'file=/mnt/file.raw,if=none,id=drive-scsi1,format=raw,cache=none,aio=io_uring,detect-zeroes=on' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/mnt/file.raw","node-name":"e234a4e3b89ac3adac9bdbf0c3dd6b4","read-only":false},"node-name":"f234a4e3b89ac3adac9bdbf0c3dd6b4","read-only":false},"node-name":"drive-scsi1","throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/cfg2cmd/simple-lvm.conf.cmd b/src/test/cfg2cmd/simple-lvm.conf.cmd
index 40a6c7c8..650f0ac3 100644
--- a/src/test/cfg2cmd/simple-lvm.conf.cmd
+++ b/src/test/cfg2cmd/simple-lvm.conf.cmd
@@ -14,6 +14,10 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 512 \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi3","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -24,12 +28,12 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/dev/veegee/vm-8006-disk-0,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=native,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"native","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/veegee/vm-8006-disk-0","node-name":"e0378a375d635b0f473569544c7c207","read-only":false},"node-name":"f0378a375d635b0f473569544c7c207","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
- -drive 'file=/dev/veegee/vm-8006-disk-0,if=none,id=drive-scsi1,cache=writeback,discard=on,format=raw,aio=threads,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/veegee/vm-8006-disk-0","node-name":"e2fbae024c8a771f708f4a5391211b0","read-only":false},"node-name":"f2fbae024c8a771f708f4a5391211b0","read-only":false},"node-name":"drive-scsi1","throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,write-cache=on' \
- -drive 'file=/dev/veegee/vm-8006-disk-0,if=none,id=drive-scsi2,cache=writethrough,discard=on,format=raw,aio=threads,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/veegee/vm-8006-disk-0","node-name":"e4328c26b141e3efe1564cb60bf1155","read-only":false},"node-name":"f4328c26b141e3efe1564cb60bf1155","read-only":false},"node-name":"drive-scsi2","throttle-group":"throttle-drive-scsi2"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=2,drive=drive-scsi2,id=scsi2,write-cache=off' \
- -drive 'file=/dev/veegee/vm-8006-disk-0,if=none,id=drive-scsi3,cache=directsync,discard=on,format=raw,aio=native,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"native","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/veegee/vm-8006-disk-0","node-name":"e68e10f8128f05fe5f7e85cc1f9922b","read-only":false},"node-name":"f68e10f8128f05fe5f7e85cc1f9922b","read-only":false},"node-name":"drive-scsi3","throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi3,id=scsi3,write-cache=off' \
-machine 'type=pc+pve0'
diff --git a/src/test/cfg2cmd/simple-lvmthin.conf.cmd b/src/test/cfg2cmd/simple-lvmthin.conf.cmd
index 8d366aff..22251bc6 100644
--- a/src/test/cfg2cmd/simple-lvmthin.conf.cmd
+++ b/src/test/cfg2cmd/simple-lvmthin.conf.cmd
@@ -14,6 +14,10 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 512 \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi3","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -24,12 +28,12 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/dev/pve/vm-8006-disk-0,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/pve/vm-8006-disk-0","node-name":"e6d87b01b7bb888b8426534a542ff1c","read-only":false},"node-name":"f6d87b01b7bb888b8426534a542ff1c","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
- -drive 'file=/dev/pve/vm-8006-disk-0,if=none,id=drive-scsi1,cache=writeback,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/pve/vm-8006-disk-0","node-name":"e96d9ece81aa4271aa2d8485184f66b","read-only":false},"node-name":"f96d9ece81aa4271aa2d8485184f66b","read-only":false},"node-name":"drive-scsi1","throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,write-cache=on' \
- -drive 'file=/dev/pve/vm-8006-disk-0,if=none,id=drive-scsi2,cache=writethrough,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/pve/vm-8006-disk-0","node-name":"e0b89788ef97beda10a850ab45897d9","read-only":false},"node-name":"f0b89788ef97beda10a850ab45897d9","read-only":false},"node-name":"drive-scsi2","throttle-group":"throttle-drive-scsi2"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=2,drive=drive-scsi2,id=scsi2,write-cache=off' \
- -drive 'file=/dev/pve/vm-8006-disk-0,if=none,id=drive-scsi3,cache=directsync,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/pve/vm-8006-disk-0","node-name":"ea7b6871af66ca3e13e95bd74570aa2","read-only":false},"node-name":"fa7b6871af66ca3e13e95bd74570aa2","read-only":false},"node-name":"drive-scsi3","throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi3,id=scsi3,write-cache=off' \
-machine 'type=pc+pve0'
diff --git a/src/test/cfg2cmd/simple-rbd.conf.cmd b/src/test/cfg2cmd/simple-rbd.conf.cmd
index df7cba3f..9260e448 100644
--- a/src/test/cfg2cmd/simple-rbd.conf.cmd
+++ b/src/test/cfg2cmd/simple-rbd.conf.cmd
@@ -15,6 +15,15 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi3","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi4","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi5","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi6","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi7","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -25,24 +34,23 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=rbd:cpool/vm-8006-disk-0:mon_host=127.0.0.42;127.0.0.21;[\:\:1]:auth_supported=none,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"auth-client-required":["none"],"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"rbd","image":"vm-8006-disk-0","node-name":"e8e1af6f55c6a2466f178045aa79710","pool":"cpool","read-only":false,"server":[{"host":"127.0.0.42","port":"3300"},{"host":"127.0.0.21","port":"3300"},{"host":"::1","port":"3300"}]},"node-name":"f8e1af6f55c6a2466f178045aa79710","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
- -drive 'file=rbd:cpool/vm-8006-disk-0:mon_host=127.0.0.42;127.0.0.21;[\:\:1]:auth_supported=none,if=none,id=drive-scsi1,cache=writeback,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"auth-client-required":["none"],"cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"rbd","image":"vm-8006-disk-0","node-name":"e3990bba2ed1f48c5bb23e9f37b4cec","pool":"cpool","read-only":false,"server":[{"host":"127.0.0.42","port":"3300"},{"host":"127.0.0.21","port":"3300"},{"host":"::1","port":"3300"}]},"node-name":"f3990bba2ed1f48c5bb23e9f37b4cec","read-only":false},"node-name":"drive-scsi1","throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,write-cache=on' \
- -drive 'file=rbd:cpool/vm-8006-disk-0:mon_host=127.0.0.42;127.0.0.21;[\:\:1]:auth_supported=none,if=none,id=drive-scsi2,cache=writethrough,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"auth-client-required":["none"],"cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"rbd","image":"vm-8006-disk-0","node-name":"e3beccc2a8f2eacb8b5df8055a7d093","pool":"cpool","read-only":false,"server":[{"host":"127.0.0.42","port":"3300"},{"host":"127.0.0.21","port":"3300"},{"host":"::1","port":"3300"}]},"node-name":"f3beccc2a8f2eacb8b5df8055a7d093","read-only":false},"node-name":"drive-scsi2","throttle-group":"throttle-drive-scsi2"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=2,drive=drive-scsi2,id=scsi2,write-cache=off' \
- -drive 'file=rbd:cpool/vm-8006-disk-0:mon_host=127.0.0.42;127.0.0.21;[\:\:1]:auth_supported=none,if=none,id=drive-scsi3,cache=directsync,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"auth-client-required":["none"],"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"rbd","image":"vm-8006-disk-0","node-name":"eef923d5dfcee93fbc712b03f9f21af","pool":"cpool","read-only":false,"server":[{"host":"127.0.0.42","port":"3300"},{"host":"127.0.0.21","port":"3300"},{"host":"::1","port":"3300"}]},"node-name":"fef923d5dfcee93fbc712b03f9f21af","read-only":false},"node-name":"drive-scsi3","throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi3,id=scsi3,write-cache=off' \
- -drive 'file=/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0,if=none,id=drive-scsi4,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0","node-name":"eb2c7a292f03b9f6d015cf83ae79730","read-only":false},"node-name":"fb2c7a292f03b9f6d015cf83ae79730","read-only":false},"node-name":"drive-scsi4","throttle-group":"throttle-drive-scsi4"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=4,drive=drive-scsi4,id=scsi4,write-cache=on' \
- -drive 'file=/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0,if=none,id=drive-scsi5,cache=writeback,discard=on,format=raw,aio=threads,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0","node-name":"e5258ec75558b1f102af1e20e677fd0","read-only":false},"node-name":"f5258ec75558b1f102af1e20e677fd0","read-only":false},"node-name":"drive-scsi5","throttle-group":"throttle-drive-scsi5"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=5,drive=drive-scsi5,id=scsi5,write-cache=on' \
- -drive 'file=/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0,if=none,id=drive-scsi6,cache=writethrough,discard=on,format=raw,aio=threads,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"aio":"threads","cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0","node-name":"edb33cdcea8ec3e2225509c4945227e","read-only":false},"node-name":"fdb33cdcea8ec3e2225509c4945227e","read-only":false},"node-name":"drive-scsi6","throttle-group":"throttle-drive-scsi6"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=6,drive=drive-scsi6,id=scsi6,write-cache=off' \
- -drive 'file=/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0,if=none,id=drive-scsi7,cache=directsync,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0","node-name":"eb0b017124a47505c97a5da052e0141","read-only":false},"node-name":"fb0b017124a47505c97a5da052e0141","read-only":false},"node-name":"drive-scsi7","throttle-group":"throttle-drive-scsi7"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=7,drive=drive-scsi7,id=scsi7,write-cache=off' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/cfg2cmd/simple-virtio-blk.conf.cmd b/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
index 0a7eb473..4a3a4c7a 100644
--- a/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
+++ b/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
@@ -15,7 +15,9 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
-object 'iothread,id=iothread-virtio0' \
+ -object '{"id":"throttle-drive-virtio0","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -26,9 +28,8 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-virtio0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"edd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"fdd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"drive-virtio0","throttle-group":"throttle-drive-virtio0"}' \
-device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,iothread=iothread-virtio0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd b/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
index a90156b0..22603fa5 100644
--- a/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
+++ b/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
@@ -15,6 +15,11 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi1","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi3","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -25,16 +30,15 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=iscsi://127.0.0.1/iqn.2019-10.org.test:foobar/0,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"iscsi","lun":0,"node-name":"e7106ac43d4f125a1911487dd9e3e42","portal":"127.0.0.1","read-only":false,"target":"iqn.2019-10.org.test:foobar","transport":"tcp"},"node-name":"f7106ac43d4f125a1911487dd9e3e42","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
- -drive 'file=iscsi://127.0.0.1/iqn.2019-10.org.test:foobar/0,if=none,id=drive-scsi1,cache=writeback,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"iscsi","lun":0,"node-name":"efdb73e0d0acc5a60e3ff438cb20113","portal":"127.0.0.1","read-only":false,"target":"iqn.2019-10.org.test:foobar","transport":"tcp"},"node-name":"ffdb73e0d0acc5a60e3ff438cb20113","read-only":false},"node-name":"drive-scsi1","throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,write-cache=on' \
- -drive 'file=iscsi://127.0.0.1/iqn.2019-10.org.test:foobar/0,if=none,id=drive-scsi2,cache=writethrough,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"driver":"raw","file":{"cache":{"direct":false,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"iscsi","lun":0,"node-name":"eab527a81b458aa9603dca5e2505f6e","portal":"127.0.0.1","read-only":false,"target":"iqn.2019-10.org.test:foobar","transport":"tcp"},"node-name":"fab527a81b458aa9603dca5e2505f6e","read-only":false},"node-name":"drive-scsi2","throttle-group":"throttle-drive-scsi2"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=2,drive=drive-scsi2,id=scsi2,write-cache=off' \
- -drive 'file=iscsi://127.0.0.1/iqn.2019-10.org.test:foobar/0,if=none,id=drive-scsi3,cache=directsync,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"raw","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"iscsi","lun":0,"node-name":"e915a332310039f7a3feed6901eb5da","portal":"127.0.0.1","read-only":false,"target":"iqn.2019-10.org.test:foobar","transport":"tcp"},"node-name":"f915a332310039f7a3feed6901eb5da","read-only":false},"node-name":"drive-scsi3","throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi3,id=scsi3,write-cache=off' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/cfg2cmd/simple1-template.conf.cmd b/src/test/cfg2cmd/simple1-template.conf.cmd
index c736c84a..4f8f29f6 100644
--- a/src/test/cfg2cmd/simple1-template.conf.cmd
+++ b/src/test/cfg2cmd/simple1-template.conf.cmd
@@ -15,6 +15,9 @@
-nographic \
-cpu qemu64 \
-m 512 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-sata0","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -23,13 +26,12 @@
-device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/8006/base-8006-disk-1.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap,readonly=on' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/base-8006-disk-1.qcow2","node-name":"e1085774206ae4a6b6bf8426ff08f16","read-only":true},"node-name":"f1085774206ae4a6b6bf8426ff08f16","read-only":true},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,write-cache=on' \
-device 'ahci,id=ahci0,multifunction=on,bus=pci.0,addr=0x7' \
- -drive 'file=/var/lib/vz/images/8006/base-8006-disk-0.qcow2,if=none,id=drive-sata0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/base-8006-disk-0.qcow2","node-name":"eab334c2e07734480f33dd80d89871b","read-only":false},"node-name":"fab334c2e07734480f33dd80d89871b","read-only":false},"node-name":"drive-sata0","throttle-group":"throttle-drive-sata0"}' \
-device 'ide-hd,bus=ahci0.0,drive=drive-sata0,id=sata0,write-cache=on' \
-machine 'accel=tcg,smm=off,type=pc+pve0' \
-snapshot
diff --git a/src/test/cfg2cmd/simple1.conf.cmd b/src/test/cfg2cmd/simple1.conf.cmd
index e657aed7..677b0527 100644
--- a/src/test/cfg2cmd/simple1.conf.cmd
+++ b/src/test/cfg2cmd/simple1.conf.cmd
@@ -15,6 +15,8 @@
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
-m 768 \
+ -object '{"id":"throttle-drive-ide2","limits":{},"qom-type":"throttle-group"}' \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
-global 'PIIX4_PM.disable_s3=1' \
-global 'PIIX4_PM.disable_s4=1' \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -25,10 +27,9 @@
-device 'VGA,id=vga,bus=pci.0,addr=0x2' \
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
- -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
- -drive 'file=/var/lib/vz/images/8006/vm-8006-disk-0.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \
+ -blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"ecd04be4259153b8293415fefa2a84c","read-only":false},"node-name":"fcd04be4259153b8293415fefa2a84c","read-only":false},"node-name":"drive-scsi0","throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
diff --git a/src/test/run_config2command_tests.pl b/src/test/run_config2command_tests.pl
index 52fedd7b..d8315f9f 100755
--- a/src/test/run_config2command_tests.pl
+++ b/src/test/run_config2command_tests.pl
@@ -266,6 +266,18 @@ $storage_module->mock(
},
);
+my $file_stat_module = Test::MockModule->new("File::stat");
+$file_stat_module->mock(
+ stat => sub {
+ my ($path) = @_;
+ if ($path =~ m!/dev/!) {
+ return $file_stat_module->original('stat')->('/dev/null');
+ } else {
+ return $file_stat_module->original('stat')->('./run_config2command_tests.pl');
+ }
+ },
+);
+
my $zfsplugin_module = Test::MockModule->new("PVE::Storage::ZFSPlugin");
$zfsplugin_module->mock(
zfs_get_lu_name => sub {
@@ -276,6 +288,16 @@ $zfsplugin_module->mock(
},
);
+my $rbdplugin_module = Test::MockModule->new("PVE::Storage::RBDPlugin");
+$rbdplugin_module->mock(
+ rbd_volume_config_get => sub {
+ my ($scfg, $storeid, $volname, $key) = @_;
+ die "mocked rbd_volume_config_get: unexpected key '$key'\n"
+ if $key ne 'rbd_cache_policy';
+ return "writeback";
+ },
+);
+
my $qemu_server_config;
$qemu_server_config = Test::MockModule->new('PVE::QemuConfig');
$qemu_server_config->mock(
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 11/15] ovmf: add support for using blockdev
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 11/15] ovmf: add support for using blockdev Fiona Ebner
@ 2025-06-24 8:38 ` Fiona Ebner
0 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-24 8:38 UTC (permalink / raw)
To: pve-devel
Am 23.06.25 um 17:44 schrieb Fiona Ebner:
> + my $ovmf_code_blockdev = {
> + driver => 'raw',
> + file => { driver => 'file', filename => "$ovmf_code" },
> + 'node-name' => 'pflash0',
Sorry, only noticed now. We could/should add
'read-only' => JSON::true,
here.
> + };
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (14 preceding siblings ...)
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0 Fiona Ebner
@ 2025-06-24 9:40 ` DERUMIER, Alexandre via pve-devel
2025-06-24 9:59 ` Fiona Ebner
2025-06-24 11:44 ` [pve-devel] partially-applied: " Fabian Grünbichler
16 siblings, 1 reply; 31+ messages in thread
From: DERUMIER, Alexandre via pve-devel @ 2025-06-24 9:40 UTC (permalink / raw)
To: pve-devel; +Cc: DERUMIER, Alexandre
[-- Attachment #1: Type: message/rfc822, Size: 12948 bytes --]
From: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>
To: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two
Date: Tue, 24 Jun 2025 09:40:38 +0000
Message-ID: <6538c03f145d25c180538cecdc229f930f48b9c2.camel@groupe-cyllene.com>
Hi Fiona,
This apply on top of the part one serie v2 ? as some commits seem to be
the same
(I see patches 32,31,28).
Does I need to apply the part one excluding theses patches (I hope that
patch 29,30 will apply without 28), then apply the part2 ?
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 05/15] move helper for iscsi initiator name to helpers module and improve name
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 05/15] move helper for iscsi initiator name to helpers module and improve name Fiona Ebner
@ 2025-06-24 9:48 ` Fabian Grünbichler
2025-06-24 10:05 ` Fiona Ebner
0 siblings, 1 reply; 31+ messages in thread
From: Fabian Grünbichler @ 2025-06-24 9:48 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
> Fiona Ebner <f.ebner@proxmox.com> hat am 23.06.2025 17:44 CEST geschrieben:
>
>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> src/PVE/QemuServer.pm | 21 ++++-----------------
> src/PVE/QemuServer/Helpers.pm | 15 +++++++++++++++
> src/test/run_config2command_tests.pl | 2 +-
> src/test/run_qemu_img_convert_tests.pl | 2 +-
> 4 files changed, 21 insertions(+), 19 deletions(-)
>
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index 71376edc..b67fe832 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -51,7 +51,8 @@ use PVE::Tools
> use PVE::QMPClient;
> use PVE::QemuConfig;
> use PVE::QemuConfig::NoWrite;
> -use PVE::QemuServer::Helpers qw(config_aware_timeout min_version kvm_user_version windows_version);
> +use PVE::QemuServer::Helpers
> + qw(config_aware_timeout get_iscsi_initiator_name min_version kvm_user_version windows_version);
> use PVE::QemuServer::Cloudinit;
> use PVE::QemuServer::CGroup;
> use PVE::QemuServer::CPUConfig
> @@ -1506,20 +1507,6 @@ sub print_drivedevice_full {
> return $device;
> }
>
> -sub get_initiator_name {
> - my $initiator;
> -
> - my $fh = IO::File->new('/etc/iscsi/initiatorname.iscsi') || return;
> - while (defined(my $line = <$fh>)) {
> - next if $line !~ m/^\s*InitiatorName\s*=\s*([\.\-:\w]+)/;
> - $initiator = $1;
> - last;
> - }
> - $fh->close();
> -
> - return $initiator;
> -}
> -
> sub print_drive_commandline_full {
> my ($storecfg, $vmid, $drive, $live_restore_name) = @_;
>
> @@ -4010,7 +3997,7 @@ sub config_to_command {
> my $scsihw = defined($conf->{scsihw}) ? $conf->{scsihw} : $defaults->{scsihw};
>
> # Add iscsi initiator name if available
> - if (my $initiator = get_initiator_name()) {
> + if (my $initiator = get_iscsi_initiator_name()) {
> push @$devices, '-iscsi', "initiator-name=$initiator";
> }
>
> @@ -8357,7 +8344,7 @@ sub convert_iscsi_path {
> my $target = $2;
> my $lun = $3;
>
> - my $initiator_name = get_initiator_name();
> + my $initiator_name = get_iscsi_initiator_name();
>
> return "file.driver=iscsi,file.transport=tcp,file.initiator-name=$initiator_name,"
> . "file.portal=$portal,file.target=$target,file.lun=$lun,driver=raw";
> diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
> index 9ec989f7..3e444839 100644
> --- a/src/PVE/QemuServer/Helpers.pm
> +++ b/src/PVE/QemuServer/Helpers.pm
> @@ -16,6 +16,7 @@ use base 'Exporter';
> our @EXPORT_OK = qw(
> min_version
> config_aware_timeout
> + get_iscsi_initiator_name
> kvm_user_version
> parse_number_sets
> windows_version
> @@ -296,4 +297,18 @@ sub needs_extraction {
> return $vtype eq 'import' && $fmt =~ m/^ova\+(.*)$/;
> }
>
> +sub get_iscsi_initiator_name {
> + my $initiator;
> +
> + my $fh = IO::File->new('/etc/iscsi/initiatorname.iscsi') || return;
> + while (defined(my $line = <$fh>)) {
> + next if $line !~ m/^\s*InitiatorName\s*=\s*([\.\-:\w]+)/;
> + $initiator = $1;
> + last;
> + }
> + $fh->close();
> +
> + return $initiator;
> +}
> +
> 1;
> diff --git a/src/test/run_config2command_tests.pl b/src/test/run_config2command_tests.pl
> index 9f4ecabf..52fedd7b 100755
> --- a/src/test/run_config2command_tests.pl
> +++ b/src/test/run_config2command_tests.pl
> @@ -248,7 +248,7 @@ $qemu_server_module->mock(
> get_host_arch => sub() {
> return $current_test->{host_arch} // 'x86_64';
> },
> - get_initiator_name => sub {
> + get_iscsi_initiator_name => sub {
> return 'iqn.1993-08.org.debian:01:aabbccddeeff';
> },
hmm, this works "by accident"
> cleanup_pci_devices => {
> diff --git a/src/test/run_qemu_img_convert_tests.pl b/src/test/run_qemu_img_convert_tests.pl
> index 55144994..86eb53be 100755
> --- a/src/test/run_qemu_img_convert_tests.pl
> +++ b/src/test/run_qemu_img_convert_tests.pl
> @@ -504,7 +504,7 @@ $qemu_server_module->mock(
> run_command => sub {
> $command = shift;
> },
> - get_initiator_name => sub {
> + get_iscsi_initiator_name => sub {
same here - should we move it to mock Helpers already in this patch?
> return "foobar";
> },
> );
> --
> 2.47.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two
2025-06-24 9:40 ` [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two DERUMIER, Alexandre via pve-devel
@ 2025-06-24 9:59 ` Fiona Ebner
2025-06-24 11:25 ` DERUMIER, Alexandre via pve-devel
0 siblings, 1 reply; 31+ messages in thread
From: Fiona Ebner @ 2025-06-24 9:59 UTC (permalink / raw)
To: Proxmox VE development discussion
Hi,
Am 24.06.25 um 11:40 schrieb DERUMIER, Alexandre via pve-devel:
> This apply on top of the part one serie v2 ? as some commits seem to be
> the same
>
> (I see patches 32,31,28).
>
> Does I need to apply the part one excluding theses patches (I hope that
> patch 29,30 will apply without 28), then apply the part2 ?
Yes, but note that v2 of part one was already applied on master except
those patches. I.e. this series here applies on current master. But
you'll need Debian Trixie going forward, as there now is a dependency on
libpve-common-perl >= 9.0.1 too.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 05/15] move helper for iscsi initiator name to helpers module and improve name
2025-06-24 9:48 ` Fabian Grünbichler
@ 2025-06-24 10:05 ` Fiona Ebner
2025-06-24 10:10 ` Fabian Grünbichler
0 siblings, 1 reply; 31+ messages in thread
From: Fiona Ebner @ 2025-06-24 10:05 UTC (permalink / raw)
To: Fabian Grünbichler, Proxmox VE development discussion
Am 24.06.25 um 11:48 schrieb Fabian Grünbichler:
>> Fiona Ebner <f.ebner@proxmox.com> hat am 23.06.2025 17:44 CEST geschrieben:
>> diff --git a/src/test/run_config2command_tests.pl b/src/test/run_config2command_tests.pl
>> index 9f4ecabf..52fedd7b 100755
>> --- a/src/test/run_config2command_tests.pl
>> +++ b/src/test/run_config2command_tests.pl
>> @@ -248,7 +248,7 @@ $qemu_server_module->mock(
>> get_host_arch => sub() {
>> return $current_test->{host_arch} // 'x86_64';
>> },
>> - get_initiator_name => sub {
>> + get_iscsi_initiator_name => sub {
>> return 'iqn.1993-08.org.debian:01:aabbccddeeff';
>> },
>
> hmm, this works "by accident"
>
>> cleanup_pci_devices => {
>> diff --git a/src/test/run_qemu_img_convert_tests.pl b/src/test/run_qemu_img_convert_tests.pl
>> index 55144994..86eb53be 100755
>> --- a/src/test/run_qemu_img_convert_tests.pl
>> +++ b/src/test/run_qemu_img_convert_tests.pl
>> @@ -504,7 +504,7 @@ $qemu_server_module->mock(
>> run_command => sub {
>> $command = shift;
>> },
>> - get_initiator_name => sub {
>> + get_iscsi_initiator_name => sub {
>
> same here - should we move it to mock Helpers already in this patch?
No, not by accident. You do need to mock it where it's imported!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 05/15] move helper for iscsi initiator name to helpers module and improve name
2025-06-24 10:05 ` Fiona Ebner
@ 2025-06-24 10:10 ` Fabian Grünbichler
0 siblings, 0 replies; 31+ messages in thread
From: Fabian Grünbichler @ 2025-06-24 10:10 UTC (permalink / raw)
To: Fiona Ebner, Proxmox VE development discussion
> Fiona Ebner <f.ebner@proxmox.com> hat am 24.06.2025 12:05 CEST geschrieben:
>
>
> Am 24.06.25 um 11:48 schrieb Fabian Grünbichler:
> >> Fiona Ebner <f.ebner@proxmox.com> hat am 23.06.2025 17:44 CEST geschrieben:
> >> diff --git a/src/test/run_config2command_tests.pl b/src/test/run_config2command_tests.pl
> >> index 9f4ecabf..52fedd7b 100755
> >> --- a/src/test/run_config2command_tests.pl
> >> +++ b/src/test/run_config2command_tests.pl
> >> @@ -248,7 +248,7 @@ $qemu_server_module->mock(
> >> get_host_arch => sub() {
> >> return $current_test->{host_arch} // 'x86_64';
> >> },
> >> - get_initiator_name => sub {
> >> + get_iscsi_initiator_name => sub {
> >> return 'iqn.1993-08.org.debian:01:aabbccddeeff';
> >> },
> >
> > hmm, this works "by accident"
> >
> >> cleanup_pci_devices => {
> >> diff --git a/src/test/run_qemu_img_convert_tests.pl b/src/test/run_qemu_img_convert_tests.pl
> >> index 55144994..86eb53be 100755
> >> --- a/src/test/run_qemu_img_convert_tests.pl
> >> +++ b/src/test/run_qemu_img_convert_tests.pl
> >> @@ -504,7 +504,7 @@ $qemu_server_module->mock(
> >> run_command => sub {
> >> $command = shift;
> >> },
> >> - get_initiator_name => sub {
> >> + get_iscsi_initiator_name => sub {
> >
> > same here - should we move it to mock Helpers already in this patch?
>
> No, not by accident. You do need to mock it where it's imported!
ugh, TIL (again I guess)! thanks for the clarification!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 07/15] introduce OVMF module
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 07/15] introduce OVMF module Fiona Ebner
@ 2025-06-24 10:23 ` Fabian Grünbichler
0 siblings, 0 replies; 31+ messages in thread
From: Fabian Grünbichler @ 2025-06-24 10:23 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
> Fiona Ebner <f.ebner@proxmox.com> hat am 23.06.2025 17:44 CEST geschrieben:
some small nits/questions inline..
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> src/PVE/API2/Qemu.pm | 13 ++-
> src/PVE/QemuMigrate.pm | 3 +-
> src/PVE/QemuServer.pm | 168 +---------------------------
> src/PVE/QemuServer/Makefile | 1 +
> src/PVE/QemuServer/OVMF.pm | 186 +++++++++++++++++++++++++++++++
> src/test/MigrationTest/Shared.pm | 4 +
> 6 files changed, 207 insertions(+), 168 deletions(-)
> create mode 100644 src/PVE/QemuServer/OVMF.pm
>
> diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
> index ce6f362d..44322db6 100644
> --- a/src/PVE/API2/Qemu.pm
> +++ b/src/PVE/API2/Qemu.pm
> @@ -36,6 +36,7 @@ use PVE::QemuServer::Monitor qw(mon_cmd);
> use PVE::QemuServer::Machine;
> use PVE::QemuServer::Memory qw(get_current_memory);
> use PVE::QemuServer::MetaInfo;
> +use PVE::QemuServer::OVMF;
> use PVE::QemuServer::PCI;
> use PVE::QemuServer::QMPHelpers;
> use PVE::QemuServer::RNG;
> @@ -540,8 +541,10 @@ my sub create_disks : prototype($$$$$$$$$$$) {
> format => $disk->{format},
> };
>
> - $dest_info->{efisize} = PVE::QemuServer::get_efivars_size($conf, $disk)
> - if $ds eq 'efidisk0';
> + if ($ds eq 'efidisk0') {
> + $dest_info->{efisize} =
> + PVE::QemuServer::OVMF::get_efivars_size($conf, $disk);
we could change this to pass in $amd_sev_type (+ some other things, or leave a wrapper around it
in PVE::QemuServer, see below)
> + }
>
> eval {
> ($dst_volid, $size) =
> @@ -612,7 +615,7 @@ my sub create_disks : prototype($$$$$$$$$$$) {
> "SEV-SNP uses consolidated read-only firmware and does not require an EFI disk\n"
> if $amd_sev_type && $amd_sev_type eq 'snp';
>
> - ($volid, $size) = PVE::QemuServer::create_efidisk(
> + ($volid, $size) = PVE::QemuServer::OVMF::create_efidisk(
> $storecfg, $storeid, $vmid, $fmt, $arch, $disk, $smm, $amd_sev_type,
since we already get and pass $amd_sev_type here
> );
> } elsif ($ds eq 'tpmstate0') {
> @@ -4455,7 +4458,7 @@ __PACKAGE__->register_method({
> format => $format,
> };
>
> - $dest_info->{efisize} = PVE::QemuServer::get_efivars_size($oldconf)
> + $dest_info->{efisize} = PVE::QemuServer::OVMF::get_efivars_size($oldconf)
would need to update this
> if $opt eq 'efidisk0';
>
> my $newdrive = PVE::QemuServer::clone_disk(
> @@ -4733,7 +4736,7 @@ __PACKAGE__->register_method({
> format => $format,
> };
>
> - $dest_info->{efisize} = PVE::QemuServer::get_efivars_size($conf)
> + $dest_info->{efisize} = PVE::QemuServer::OVMF::get_efivars_size($conf)
and this as well though
> if $disk eq 'efidisk0';
>
> my $newdrive = PVE::QemuServer::clone_disk(
> diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
> index 28d7ac56..9ccaf7e0 100644
> --- a/src/PVE/QemuMigrate.pm
> +++ b/src/PVE/QemuMigrate.pm
> @@ -31,6 +31,7 @@ use PVE::QemuServer::Helpers qw(min_version);
> use PVE::QemuServer::Machine;
> use PVE::QemuServer::Monitor qw(mon_cmd);
> use PVE::QemuServer::Memory qw(get_current_memory);
> +use PVE::QemuServer::OVMF;
> use PVE::QemuServer::QMPHelpers;
> use PVE::QemuServer;
>
> @@ -635,7 +636,7 @@ sub config_update_local_disksizes {
> # we want to set the efidisk size in the config to the size of the
> # real OVMF_VARS.fd image, else we can create a too big image, which does not work
> if (defined($conf->{efidisk0})) {
> - PVE::QemuServer::update_efidisk_size($conf);
> + PVE::QemuServer::OVMF::update_efidisk_size($conf);
this already returns immediately if no efidisk is defined, so we
could drop the surrounding if here? this is also the only call site,
and we already do plenty of parsing and printing of drives here,
so maybe we could even inline it instead - the only OVMF specific
thing is a call to get_efivars_size
> }
>
> # TPM state might have an irregular filesize, to avoid problems on transfer
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index 63b4d469..719687dc 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -56,7 +56,7 @@ use PVE::QemuServer::Helpers
> use PVE::QemuServer::Cloudinit;
> use PVE::QemuServer::CGroup;
> use PVE::QemuServer::CPUConfig
> - qw(print_cpu_device get_cpu_options get_cpu_bitness is_native_arch get_amd_sev_object get_amd_sev_type);
> + qw(print_cpu_device get_cpu_options is_native_arch get_amd_sev_object get_amd_sev_type);
> use PVE::QemuServer::Drive qw(
> is_valid_drivename
> checked_volume_format
> @@ -71,6 +71,7 @@ use PVE::QemuServer::Machine;
> use PVE::QemuServer::Memory qw(get_current_memory);
> use PVE::QemuServer::MetaInfo;
> use PVE::QemuServer::Monitor qw(mon_cmd);
> +use PVE::QemuServer::OVMF;
> use PVE::QemuServer::PCI qw(print_pci_addr print_pcie_addr print_pcie_root_port parse_hostpci);
> use PVE::QemuServer::QemuImage;
> use PVE::QemuServer::QMPHelpers qw(qemu_deviceadd qemu_devicedel qemu_objectadd qemu_objectdel);
> @@ -98,41 +99,6 @@ my sub vm_is_ha_managed {
> return PVE::HA::Config::vm_is_ha_managed($vmid);
> }
>
> -my $EDK2_FW_BASE = '/usr/share/pve-edk2-firmware/';
> -my $OVMF = {
> - x86_64 => {
> - '4m-no-smm' => [
> - "$EDK2_FW_BASE/OVMF_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.fd",
> - ],
> - '4m-no-smm-ms' => [
> - "$EDK2_FW_BASE/OVMF_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.ms.fd",
> - ],
> - '4m' => [
> - "$EDK2_FW_BASE/OVMF_CODE_4M.secboot.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.fd",
> - ],
> - '4m-ms' => [
> - "$EDK2_FW_BASE/OVMF_CODE_4M.secboot.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.ms.fd",
> - ],
> - '4m-sev' => [
> - "$EDK2_FW_BASE/OVMF_CVM_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_CVM_VARS_4M.fd",
> - ],
> - '4m-snp' => [
> - "$EDK2_FW_BASE/OVMF_CVM_4M.fd",
> - ],
> - # FIXME: These are legacy 2MB-sized images that modern OVMF doesn't supports to build
> - # anymore. how can we deperacate this sanely without breaking existing instances, or using
> - # older backups and snapshot?
> - default => [
> - "$EDK2_FW_BASE/OVMF_CODE.fd", "$EDK2_FW_BASE/OVMF_VARS.fd",
> - ],
> - },
> - aarch64 => {
> - default => [
> - "$EDK2_FW_BASE/AAVMF_CODE.fd", "$EDK2_FW_BASE/AAVMF_VARS.fd",
> - ],
> - },
> -};
> -
> my $cpuinfo = PVE::ProcFSTools::read_cpuinfo();
>
> # Note about locking: we use flock on the config file protect against concurrent actions.
> @@ -3293,36 +3259,6 @@ sub vga_conf_has_spice {
> return $1 || 1;
> }
>
> -sub get_ovmf_files($$$$) {
> - my ($arch, $efidisk, $smm, $amd_sev_type) = @_;
> -
> - my $types = $OVMF->{$arch}
> - or die "no OVMF images known for architecture '$arch'\n";
> -
> - my $type = 'default';
> - if ($arch eq 'x86_64') {
> - if ($amd_sev_type && $amd_sev_type eq 'snp') {
> - $type = "4m-snp";
> - my ($ovmf) = $types->{$type}->@*;
> - die "EFI base image '$ovmf' not found\n" if !-f $ovmf;
> - return ($ovmf);
> - } elsif ($amd_sev_type) {
> - $type = "4m-sev";
> - } elsif (defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') {
> - $type = $smm ? "4m" : "4m-no-smm";
> - $type .= '-ms' if $efidisk->{'pre-enrolled-keys'};
> - } else {
> - # TODO: log_warn about use of legacy images for x86_64 with Promxox VE 9
> - }
> - }
> -
> - my ($ovmf_code, $ovmf_vars) = $types->{$type}->@*;
> - die "EFI base image '$ovmf_code' not found\n" if !-f $ovmf_code;
> - die "EFI vars image '$ovmf_vars' not found\n" if !-f $ovmf_vars;
> -
> - return ($ovmf_code, $ovmf_vars);
> -}
> -
> # To use query_supported_cpu_flags and query_understood_cpu_flags to get flags
> # to use in a QEMU command line (-cpu element), first array_intersect the result
> # of query_supported_ with query_understood_. This is necessary because:
> @@ -3464,48 +3400,6 @@ my sub should_disable_smm {
> && $vga->{type} =~ m/^(serial\d+|none)$/;
> }
>
> -my sub print_ovmf_drive_commandlines {
> - my ($conf, $storecfg, $vmid, $arch, $q35, $version_guard) = @_;
> -
> - my $d = $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
> -
> - my $amd_sev_type = get_amd_sev_type($conf);
> - die "Attempting to configure SEV-SNP with pflash devices instead of using `-bios`\n"
> - if $amd_sev_type && $amd_sev_type eq 'snp';
> -
> - my ($ovmf_code, $ovmf_vars) = get_ovmf_files($arch, $d, $q35, $amd_sev_type);
> -
> - my $var_drive_str = "if=pflash,unit=1,id=drive-efidisk0";
> - if ($d) {
> - my ($storeid, $volname) = PVE::Storage::parse_volume_id($d->{file}, 1);
> - my ($path, $format) = $d->@{ 'file', 'format' };
> - if ($storeid) {
> - $path = PVE::Storage::path($storecfg, $d->{file});
> - $format //= checked_volume_format($storecfg, $d->{file});
> - } elsif (!defined($format)) {
> - die "efidisk format must be specified\n";
> - }
> - # SPI flash does lots of read-modify-write OPs, without writeback this gets really slow #3329
> - if ($path =~ m/^rbd:/) {
> - $var_drive_str .= ',cache=writeback';
> - $path .= ':rbd_cache_policy=writeback'; # avoid write-around, we *need* to cache writes too
> - }
> - $var_drive_str .= ",format=$format,file=$path";
> -
> - $var_drive_str .= ",size=" . (-s $ovmf_vars)
> - if $format eq 'raw' && $version_guard->(4, 1, 2);
> - $var_drive_str .= ',readonly=on' if drive_is_read_only($conf, $d);
> - } else {
> - log_warn("no efidisk configured! Using temporary efivars disk.");
> - my $path = "/tmp/$vmid-ovmf.fd";
> - PVE::Tools::file_copy($ovmf_vars, $path, -s $ovmf_vars);
> - $var_drive_str .= ",format=raw,file=$path";
> - $var_drive_str .= ",size=" . (-s $ovmf_vars) if $version_guard->(4, 1, 2);
> - }
> -
> - return ("if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code", $var_drive_str);
> -}
> -
> my sub get_vga_properties {
> my ($conf, $arch, $machine_version, $winversion) = @_;
>
> @@ -3680,21 +3574,10 @@ sub config_to_command {
> }
>
> if ($conf->{bios} && $conf->{bios} eq 'ovmf') {
> - die "OVMF (UEFI) BIOS is not supported on 32-bit CPU types\n"
> - if !$forcecpu && get_cpu_bitness($conf->{cpu}, $arch) == 32;
> -
> - my $amd_sev_type = get_amd_sev_type($conf);
if we keep this
> - if ($amd_sev_type && $amd_sev_type eq 'snp') {
> - if (defined($conf->{efidisk0})) {
> - log_warn("EFI disks are not supported with SEV-SNP and will be ignored");
> - }
> - push $cmd->@*, '-bios', get_ovmf_files($arch, undef, undef, $amd_sev_type);
> - } else {
> - my ($code_drive_str, $var_drive_str) =
> - print_ovmf_drive_commandlines($conf, $storecfg, $vmid, $arch, $q35, $version_guard);
> - push $cmd->@*, '-drive', $code_drive_str;
> - push $cmd->@*, '-drive', $var_drive_str;
> - }
> + my $ovmf_cmd = PVE::QemuServer::OVMF::print_ovmf_commandline(
> + $conf, $storecfg, $vmid, $arch, $q35, $version_guard, $forcecpu,
and pass it here (maybe combine amd_sev, forcecpu, smm and q35 into an options hash)?
> + );
> + push $cmd->@*, $ovmf_cmd->@*;
> }
>
> if ($q35) { # tell QEMU to load q35 config early
> @@ -8853,29 +8736,6 @@ sub qemu_use_old_bios_files {
> return ($use_old_bios_files, $machine_type);
> }
>
> -sub get_efivars_size {
> - my ($conf, $efidisk) = @_;
> -
> - my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf);
> - $efidisk //= $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
> - my $smm = PVE::QemuServer::Machine::machine_type_is_q35($conf);
> - my $amd_sev_type = get_amd_sev_type($conf);
> - my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm, $amd_sev_type);
> - return -s $ovmf_vars;
and maybe move just the last two lines here to OVMF.pm, but leave the $conf to options hash part
here for the call above and for other calls to get_efivars_size ?
> -}
> -
> -sub update_efidisk_size {
> - my ($conf) = @_;
> -
> - return if !defined($conf->{efidisk0});
> -
> - my $disk = PVE::QemuServer::parse_drive('efidisk0', $conf->{efidisk0});
> - $disk->{size} = get_efivars_size($conf);
> - $conf->{efidisk0} = print_drive($disk);
> -
> - return;
> -}
> -
> sub update_tpmstate_size {
> my ($conf) = @_;
>
> @@ -8884,22 +8744,6 @@ sub update_tpmstate_size {
> $conf->{tpmstate0} = print_drive($disk);
> }
>
> -sub create_efidisk($$$$$$$$) {
> - my ($storecfg, $storeid, $vmid, $fmt, $arch, $efidisk, $smm, $amd_sev_type) = @_;
> -
> - my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm, $amd_sev_type);
> -
> - my $vars_size_b = -s $ovmf_vars;
> - my $vars_size = PVE::Tools::convert_size($vars_size_b, 'b' => 'kb');
> - my $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $fmt, undef, $vars_size);
> - PVE::Storage::activate_volumes($storecfg, [$volid]);
> -
> - PVE::QemuServer::QemuImage::convert($ovmf_vars, $volid, $vars_size_b);
> - my $size = PVE::Storage::volume_size_info($storecfg, $volid, 3);
> -
> - return ($volid, $size / 1024);
> -}
> -
> sub vm_iothreads_list {
> my ($vmid) = @_;
>
> diff --git a/src/PVE/QemuServer/Makefile b/src/PVE/QemuServer/Makefile
> index a34ec83b..dd6fe505 100644
> --- a/src/PVE/QemuServer/Makefile
> +++ b/src/PVE/QemuServer/Makefile
> @@ -14,6 +14,7 @@ SOURCES=Agent.pm \
> Memory.pm \
> MetaInfo.pm \
> Monitor.pm \
> + OVMF.pm \
> PCI.pm \
> QemuImage.pm \
> QMPHelpers.pm \
> diff --git a/src/PVE/QemuServer/OVMF.pm b/src/PVE/QemuServer/OVMF.pm
> new file mode 100644
> index 00000000..70c626a5
> --- /dev/null
> +++ b/src/PVE/QemuServer/OVMF.pm
> @@ -0,0 +1,186 @@
> +package PVE::QemuServer::OVMF;
> +
> +use strict;
> +use warnings;
> +
> +use PVE::RESTEnvironment qw(log_warn);
> +use PVE::Storage;
> +use PVE::Tools;
> +
> +use PVE::QemuServer::Drive qw(checked_volume_format drive_is_read_only parse_drive print_drive);
> +use PVE::QemuServer::CPUConfig qw(get_amd_sev_type get_cpu_bitness);
then we could get rid of this import here. get_cpu_bitness is only used
in one place as well, so we could get of that as well..
the entanglement right now is small, but these things tend to grow over
time..
> +use PVE::QemuServer::Helpers;
only used for determining the arch in get_efivars_size
> +use PVE::QemuServer::Machine;
this one's only used to determine whether the config is q35 in
get_efivars_size, could maybe also be moved to the call site?
so these three use statements could maybe be left in PVE::QemuServer..
> +use PVE::QemuServer::QemuImage;
> +
> +my $EDK2_FW_BASE = '/usr/share/pve-edk2-firmware/';
> +my $OVMF = {
> + x86_64 => {
> + '4m-no-smm' => [
> + "$EDK2_FW_BASE/OVMF_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.fd",
> + ],
> + '4m-no-smm-ms' => [
> + "$EDK2_FW_BASE/OVMF_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.ms.fd",
> + ],
> + '4m' => [
> + "$EDK2_FW_BASE/OVMF_CODE_4M.secboot.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.fd",
> + ],
> + '4m-ms' => [
> + "$EDK2_FW_BASE/OVMF_CODE_4M.secboot.fd", "$EDK2_FW_BASE/OVMF_VARS_4M.ms.fd",
> + ],
> + '4m-sev' => [
> + "$EDK2_FW_BASE/OVMF_CVM_CODE_4M.fd", "$EDK2_FW_BASE/OVMF_CVM_VARS_4M.fd",
> + ],
> + '4m-snp' => [
> + "$EDK2_FW_BASE/OVMF_CVM_4M.fd",
> + ],
> + # FIXME: These are legacy 2MB-sized images that modern OVMF doesn't supports to build
> + # anymore. how can we deperacate this sanely without breaking existing instances, or using
> + # older backups and snapshot?
> + default => [
> + "$EDK2_FW_BASE/OVMF_CODE.fd", "$EDK2_FW_BASE/OVMF_VARS.fd",
> + ],
> + },
> + aarch64 => {
> + default => [
> + "$EDK2_FW_BASE/AAVMF_CODE.fd", "$EDK2_FW_BASE/AAVMF_VARS.fd",
> + ],
> + },
> +};
> +
> +my sub get_ovmf_files($$$$) {
> + my ($arch, $efidisk, $smm, $amd_sev_type) = @_;
> +
> + my $types = $OVMF->{$arch}
> + or die "no OVMF images known for architecture '$arch'\n";
> +
> + my $type = 'default';
> + if ($arch eq 'x86_64') {
> + if ($amd_sev_type && $amd_sev_type eq 'snp') {
> + $type = "4m-snp";
> + my ($ovmf) = $types->{$type}->@*;
> + die "EFI base image '$ovmf' not found\n" if !-f $ovmf;
> + return ($ovmf);
> + } elsif ($amd_sev_type) {
> + $type = "4m-sev";
> + } elsif (defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') {
> + $type = $smm ? "4m" : "4m-no-smm";
> + $type .= '-ms' if $efidisk->{'pre-enrolled-keys'};
> + } else {
> + # TODO: log_warn about use of legacy images for x86_64 with Promxox VE 9
> + }
> + }
> +
> + my ($ovmf_code, $ovmf_vars) = $types->{$type}->@*;
> + die "EFI base image '$ovmf_code' not found\n" if !-f $ovmf_code;
> + die "EFI vars image '$ovmf_vars' not found\n" if !-f $ovmf_vars;
> +
> + return ($ovmf_code, $ovmf_vars);
> +}
> +
> +my sub print_ovmf_drive_commandlines {
> + my ($conf, $storecfg, $vmid, $arch, $q35, $version_guard) = @_;
> +
> + my $d = $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
> +
> + my $amd_sev_type = get_amd_sev_type($conf);
> + die "Attempting to configure SEV-SNP with pflash devices instead of using `-bios`\n"
> + if $amd_sev_type && $amd_sev_type eq 'snp';
> +
> + my ($ovmf_code, $ovmf_vars) = get_ovmf_files($arch, $d, $q35, $amd_sev_type);
> +
> + my $var_drive_str = "if=pflash,unit=1,id=drive-efidisk0";
> + if ($d) {
> + my ($storeid, $volname) = PVE::Storage::parse_volume_id($d->{file}, 1);
> + my ($path, $format) = $d->@{ 'file', 'format' };
> + if ($storeid) {
> + $path = PVE::Storage::path($storecfg, $d->{file});
> + $format //= checked_volume_format($storecfg, $d->{file});
> + } elsif (!defined($format)) {
> + die "efidisk format must be specified\n";
> + }
> + # SPI flash does lots of read-modify-write OPs, without writeback this gets really slow #3329
> + if ($path =~ m/^rbd:/) {
> + $var_drive_str .= ',cache=writeback';
> + $path .= ':rbd_cache_policy=writeback'; # avoid write-around, we *need* to cache writes too
> + }
> + $var_drive_str .= ",format=$format,file=$path";
> +
> + $var_drive_str .= ",size=" . (-s $ovmf_vars)
> + if $format eq 'raw' && $version_guard->(4, 1, 2);
> + $var_drive_str .= ',readonly=on' if drive_is_read_only($conf, $d);
> + } else {
> + log_warn("no efidisk configured! Using temporary efivars disk.");
> + my $path = "/tmp/$vmid-ovmf.fd";
> + PVE::Tools::file_copy($ovmf_vars, $path, -s $ovmf_vars);
> + $var_drive_str .= ",format=raw,file=$path";
> + $var_drive_str .= ",size=" . (-s $ovmf_vars) if $version_guard->(4, 1, 2);
> + }
> +
> + return ("if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code", $var_drive_str);
> +}
> +
> +sub get_efivars_size {
> + my ($conf, $efidisk) = @_;
> +
> + my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf);
> + $efidisk //= $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
> + my $smm = PVE::QemuServer::Machine::machine_type_is_q35($conf);
> + my $amd_sev_type = get_amd_sev_type($conf);
> + my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm, $amd_sev_type);
> + return -s $ovmf_vars;
> +}
> +
> +sub update_efidisk_size {
> + my ($conf) = @_;
> +
> + return if !defined($conf->{efidisk0});
> +
> + my $disk = parse_drive('efidisk0', $conf->{efidisk0});
> + $disk->{size} = get_efivars_size($conf);
> + $conf->{efidisk0} = print_drive($disk);
> +
> + return;
> +}
> +
> +sub create_efidisk($$$$$$$$) {
> + my ($storecfg, $storeid, $vmid, $fmt, $arch, $efidisk, $smm, $amd_sev_type) = @_;
> +
> + my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm, $amd_sev_type);
> +
> + my $vars_size_b = -s $ovmf_vars;
> + my $vars_size = PVE::Tools::convert_size($vars_size_b, 'b' => 'kb');
> + my $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $fmt, undef, $vars_size);
> + PVE::Storage::activate_volumes($storecfg, [$volid]);
> +
> + PVE::QemuServer::QemuImage::convert($ovmf_vars, $volid, $vars_size_b);
> + my $size = PVE::Storage::volume_size_info($storecfg, $volid, 3);
> +
> + return ($volid, $size / 1024);
> +}
> +
> +sub print_ovmf_commandline {
> + my ($conf, $storecfg, $vmid, $arch, $q35, $version_guard, $forcecpu) = @_;
> +
> + my $cmd = [];
> +
> + die "OVMF (UEFI) BIOS is not supported on 32-bit CPU types\n"
> + if !$forcecpu && get_cpu_bitness($conf->{cpu}, $arch) == 32;
> +
> + my $amd_sev_type = get_amd_sev_type($conf);
> + if ($amd_sev_type && $amd_sev_type eq 'snp') {
> + if (defined($conf->{efidisk0})) {
> + log_warn("EFI disks are not supported with SEV-SNP and will be ignored");
> + }
> + push $cmd->@*, '-bios', get_ovmf_files($arch, undef, undef, $amd_sev_type);
> + } else {
> + my ($code_drive_str, $var_drive_str) =
> + print_ovmf_drive_commandlines($conf, $storecfg, $vmid, $arch, $q35, $version_guard);
> + push $cmd->@*, '-drive', $code_drive_str;
> + push $cmd->@*, '-drive', $var_drive_str;
> + }
> +
> + return $cmd;
> +}
> +
> +1;
> diff --git a/src/test/MigrationTest/Shared.pm b/src/test/MigrationTest/Shared.pm
> index 0b1ac7a0..e29cd1df 100644
> --- a/src/test/MigrationTest/Shared.pm
> +++ b/src/test/MigrationTest/Shared.pm
> @@ -150,6 +150,10 @@ $qemu_server_module->mock(
> vm_stop_cleanup => sub {
> return;
> },
> +);
> +
> +our $qemu_server_ovmf_module = Test::MockModule->new("PVE::QemuServer::OVMF");
> +$qemu_server_ovmf_module->mock(
> get_efivars_size => sub {
> return 128 * 1024;
> },
> --
> 2.47.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two
2025-06-24 9:59 ` Fiona Ebner
@ 2025-06-24 11:25 ` DERUMIER, Alexandre via pve-devel
0 siblings, 0 replies; 31+ messages in thread
From: DERUMIER, Alexandre via pve-devel @ 2025-06-24 11:25 UTC (permalink / raw)
To: pve-devel, f.ebner; +Cc: DERUMIER, Alexandre
[-- Attachment #1: Type: message/rfc822, Size: 12633 bytes --]
From: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>
To: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>, "f.ebner@proxmox.com" <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two
Date: Tue, 24 Jun 2025 11:25:36 +0000
Message-ID: <d8600a83f87cea25ad69ba084b99a2766c735d93.camel@groupe-cyllene.com>
>>Yes, but note that v2 of part one was already applied on master
>>except
>>those patches.
ah ok, sorry, I didn't see it !
>>I.e. this series here applies on current master. But
>>you'll need Debian Trixie going forward, as there now is a dependency
>>on
>>libpve-common-perl >= 9.0.1 too.
Time to upgrade :)
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* [pve-devel] partially-applied: [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
` (15 preceding siblings ...)
2025-06-24 9:40 ` [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two DERUMIER, Alexandre via pve-devel
@ 2025-06-24 11:44 ` Fabian Grünbichler
16 siblings, 0 replies; 31+ messages in thread
From: Fabian Grünbichler @ 2025-06-24 11:44 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
applied everything but OVMF part (7, 11, 12) and the RFC part at the end!
thanks :)
> Fiona Ebner <f.ebner@proxmox.com> hat am 23.06.2025 17:44 CEST geschrieben:
>
>
> Set default timeouts for blockdev QMP commands (picked up the series
> from [0] and rebased).
>
> Factor out more code into dedicated modules, most notably for qemu-img
> and OVMF.
>
> Add helper to generate blockdev commandline for EFI disks based on
> Alexandre's patch, carrying along the necessary workarounds.
>
> New version of final patch to switch to -blockdev, should not be
> applied yet, support for all operations is still missing, that will
> follow in a separate series.
>
> [0]: https://lore.proxmox.com/pve-devel/20241212100247.20926-1-f.ebner@proxmox.com/
>
> Fiona Ebner (15):
> fix #5985: qmp client: increase timeout for
> {device,netdev,object}_{add,del} commands
> qmp client: add default timeouts for more blockdev commands
> helpers: add missing includes
> helpers: fix perlcritic warning about variables named $a and $b
> move helper for iscsi initiator name to helpers module and improve
> name
> introduce QemuImage module
> introduce OVMF module
> blockdev: re-use cache setting from child node
> blockdev: add workaround for issue #3229
> blockdev: add support for 'size' option
> ovmf: add support for using blockdev
> cfg2cmd: ovmf: support print_ovmf_commandline() returning machine
> flags
> print drive device: don't reference any drive for 'none' starting with
> machine version 10.0
> blockdev: add support for NBD paths
> command line: switch to blockdev starting with machine version 10.0
>
> src/PVE/API2/Qemu.pm | 13 +-
> src/PVE/QMPClient.pm | 12 +
> src/PVE/QemuMigrate.pm | 3 +-
> src/PVE/QemuServer.pm | 491 ++++++------------
> src/PVE/QemuServer/Blockdev.pm | 48 +-
> src/PVE/QemuServer/Helpers.pm | 27 +-
> src/PVE/QemuServer/ImportDisk.pm | 6 +-
> src/PVE/QemuServer/Makefile | 2 +
> src/PVE/QemuServer/OVMF.pm | 251 +++++++++
> src/PVE/QemuServer/QemuImage.pm | 123 +++++
> src/test/MigrationTest/Shared.pm | 4 +
> src/test/cfg2cmd/aio.conf.cmd | 42 +-
> src/test/cfg2cmd/bootorder-empty.conf.cmd | 13 +-
> src/test/cfg2cmd/bootorder-legacy.conf.cmd | 13 +-
> src/test/cfg2cmd/bootorder.conf.cmd | 13 +-
> ...putype-icelake-client-deprecation.conf.cmd | 7 +-
> src/test/cfg2cmd/efi-raw-template.conf.cmd | 7 +-
> src/test/cfg2cmd/efi-raw.conf.cmd | 7 +-
> .../cfg2cmd/efi-secboot-and-tpm-q35.conf.cmd | 7 +-
> src/test/cfg2cmd/efi-secboot-and-tpm.conf.cmd | 7 +-
> src/test/cfg2cmd/efidisk-on-rbd.conf.cmd | 7 +-
> src/test/cfg2cmd/ide.conf.cmd | 15 +-
> src/test/cfg2cmd/q35-ide.conf.cmd | 15 +-
> .../q35-linux-hostpci-mapping.conf.cmd | 7 +-
> .../q35-linux-hostpci-multifunction.conf.cmd | 7 +-
> .../q35-linux-hostpci-template.conf.cmd | 10 +-
> ...q35-linux-hostpci-x-pci-overrides.conf.cmd | 7 +-
> src/test/cfg2cmd/q35-linux-hostpci.conf.cmd | 7 +-
> src/test/cfg2cmd/q35-simple.conf.cmd | 7 +-
> src/test/cfg2cmd/seabios_serial.conf.cmd | 7 +-
> src/test/cfg2cmd/sev-es.conf.cmd | 7 +-
> src/test/cfg2cmd/sev-std.conf.cmd | 7 +-
> src/test/cfg2cmd/simple-btrfs.conf.cmd | 16 +-
> src/test/cfg2cmd/simple-cifs.conf.cmd | 16 +-
> .../cfg2cmd/simple-disk-passthrough.conf.cmd | 9 +-
> src/test/cfg2cmd/simple-lvm.conf.cmd | 12 +-
> src/test/cfg2cmd/simple-lvmthin.conf.cmd | 12 +-
> src/test/cfg2cmd/simple-rbd.conf.cmd | 28 +-
> src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 7 +-
> .../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 16 +-
> src/test/cfg2cmd/simple1-template.conf.cmd | 10 +-
> src/test/cfg2cmd/simple1.conf.cmd | 7 +-
> src/test/run_config2command_tests.pl | 24 +-
> src/test/run_qemu_img_convert_tests.pl | 19 +-
> 44 files changed, 878 insertions(+), 497 deletions(-)
> create mode 100644 src/PVE/QemuServer/OVMF.pm
> create mode 100644 src/PVE/QemuServer/QemuImage.pm
>
> --
> 2.47.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0 Fiona Ebner
@ 2025-06-24 13:53 ` DERUMIER, Alexandre via pve-devel
2025-06-24 14:34 ` Fiona Ebner
0 siblings, 1 reply; 31+ messages in thread
From: DERUMIER, Alexandre via pve-devel @ 2025-06-24 13:53 UTC (permalink / raw)
To: pve-devel; +Cc: DERUMIER, Alexandre
[-- Attachment #1: Type: message/rfc822, Size: 15022 bytes --]
From: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>
To: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
Date: Tue, 24 Jun 2025 13:53:32 +0000
Message-ID: <3546b11e573fc1c57f401402834ecb0e2577838d.camel@groupe-cyllene.com>
>>diff --git a/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
>>b/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
>>index 5c55c01b..474e8038 100644
>>--- a/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
>>+++ b/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
>>@@ -9,8 +9,9 @@
>> -pidfile /var/run/qemu-server/8006.pid \
>> -daemonize \
>> -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e688' \
>>- -drive
>>'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-
>>firmware//OVMF_CODE.fd' \
>>- -drive 'if=pflash,unit=1,id=drive-
>>efidisk0,cache=writeback,format=raw,file=rbd:cpool/vm-100-disk-
>>1:mon_host=127.0.0.42;127.0.0.21;>>>>[\:\:1]:auth_supported=none:rbd_
cache_policy=writeback,size=131072' \
>>+ -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-
>>type":"throttle-group"}' \
>>+ -blockdev
'{"driver":"raw","file":>>{"driver":"file","filename":"/usr/share/pve-
edk2->>firmware//OVMF_CODE.fd"},"node-name":"pflash0"}' \
>>+ -blockdev
'{"driver":"throttle","file":{"cache":>>{"direct":false,"no-
flush":false},"driver":"raw","file":{"auth-client-
>>required":["none"],"cache":{"direct":false,"no-flush":false},"detect-
>>zeroes":"on","discard":"ignore","driver":"rbd","image":"vm-100-disk-
>>1","node-
>>name":"eeb8f022b5551ad1d795611f112c767","pool":"cpool","read-
>>only":false,"server":[{"host":"127.0.0.42","port":"3300"},{"host":"12
7.0.0.21","port":"3300"},{"host":"::1","port":"3300"}]},"node-
>>name":"feb8f022b5551ad1d795611f112c767","read-
>>only":false,"size":131072},"node-name":"drive-efidisk0","throttle-
>>group":"throttle-drive-efidisk0"}' \
It's missing
"key-value-pairs":{"rbd-cache-policy":"writeback"}
?
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
2025-06-24 13:53 ` DERUMIER, Alexandre via pve-devel
@ 2025-06-24 14:34 ` Fiona Ebner
2025-06-24 14:41 ` DERUMIER, Alexandre via pve-devel
` (2 more replies)
0 siblings, 3 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-24 14:34 UTC (permalink / raw)
To: Proxmox VE development discussion
Am 24.06.25 um 15:53 schrieb DERUMIER, Alexandre via pve-devel:
>>> name":"feb8f022b5551ad1d795611f112c767","read-
>>> only":false,"size":131072},"node-name":"drive-efidisk0","throttle-
>>> group":"throttle-drive-efidisk0"}' \
>
> It's missing
> "key-value-pairs":{"rbd-cache-policy":"writeback"}
Would be a good catch ;) But after the recent discussion upstream [0],
the plan is to not patch QEMU, but set the option via RBD in the storage
plugin itself for EFI disks, that's why the hint is still passed along.
I added a comment that it's set via the storage layer in patch 09/15.
[0]:
https://lore.kernel.org/qemu-devel/CAOi1vP81g40nOnskY8fR8Eh7j9JMJdfD=P0+HBVUp80suNQWJQ@mail.gmail.com/
I think I'll send the next version of the storage patches relatively
shortly after part three (still quite a bit of splitting up
QemuServer.pm on the way, e.g for introducing a BlockJob module). I'll
try to send part three in the following days, I hope I get around to
also include blockdev-mirror there.
Part four is then hopefully the final one, doing all the version-guarded
switches and making all features work, fingers crossed :)
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
2025-06-24 14:34 ` Fiona Ebner
@ 2025-06-24 14:41 ` DERUMIER, Alexandre via pve-devel
2025-06-25 11:31 ` DERUMIER, Alexandre via pve-devel
[not found] ` <f3d01b2976480800cfa294cf888534aebadec067.camel@groupe-cyllene.com>
2 siblings, 0 replies; 31+ messages in thread
From: DERUMIER, Alexandre via pve-devel @ 2025-06-24 14:41 UTC (permalink / raw)
To: pve-devel, f.ebner; +Cc: DERUMIER, Alexandre
[-- Attachment #1: Type: message/rfc822, Size: 12786 bytes --]
From: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>
To: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>, "f.ebner@proxmox.com" <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
Date: Tue, 24 Jun 2025 14:41:51 +0000
Message-ID: <e478f5e7269d48f6f3d8ec7d9a45e55ceef0e939.camel@groupe-cyllene.com>
>>Would be a good catch ;) But after the recent discussion upstream
>>[0],
>>the plan is to not patch QEMU, but set the option via RBD in the
>>storage
>>plugin itself for EFI disks, that's why the hint is still passed
>>along.
>>I added a comment that it's set via the storage layer in patch 09/15.
Ah ok, I was not aware about "rbd config image", seem better indeed !
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
2025-06-24 14:34 ` Fiona Ebner
2025-06-24 14:41 ` DERUMIER, Alexandre via pve-devel
@ 2025-06-25 11:31 ` DERUMIER, Alexandre via pve-devel
[not found] ` <f3d01b2976480800cfa294cf888534aebadec067.camel@groupe-cyllene.com>
2 siblings, 0 replies; 31+ messages in thread
From: DERUMIER, Alexandre via pve-devel @ 2025-06-25 11:31 UTC (permalink / raw)
To: pve-devel, f.ebner; +Cc: DERUMIER, Alexandre
[-- Attachment #1: Type: message/rfc822, Size: 14035 bytes --]
From: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>
To: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>, "f.ebner@proxmox.com" <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
Date: Wed, 25 Jun 2025 11:31:15 +0000
Message-ID: <f3d01b2976480800cfa294cf888534aebadec067.camel@groupe-cyllene.com>
>>
>>I think I'll send the next version of the storage patches relatively
>>shortly after part three (still quite a bit of splitting up
>>QemuServer.pm on the way, e.g for introducing a BlockJob module).
>>I'll
>>try to send part three in the following days, I hope I get around to
>>also include blockdev-mirror there.
>>
>>Part four is then hopefully the final one, doing all the version-
>>guarded
>>switches and making all features work, fingers crossed :)
In parallel, I'm working to implement multiple iothreads (great
improvement with nvme drive from my tests)
which seem to need the new -device json syntax like
-device '{"driver":"virtio-blk-pci","num-queues":4,"iothread-vq-
mapping":[{"iothread":"iothread2","vqs":[1,3]},{"iothread":"iothread3",
"vqs":[0,2]}],
So, I'll look to add new -device syntax first
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 06/15] introduce QemuImage module
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 06/15] introduce QemuImage module Fiona Ebner
@ 2025-06-25 12:54 ` Daniel Kral
0 siblings, 0 replies; 31+ messages in thread
From: Daniel Kral @ 2025-06-25 12:54 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
On 6/23/25 17:44, Fiona Ebner wrote:
> diff --git a/src/PVE/QemuServer/ImportDisk.pm b/src/PVE/QemuServer/ImportDisk.pm
> index 8ecd5521..01289fc5 100755
> --- a/src/PVE/QemuServer/ImportDisk.pm
> +++ b/src/PVE/QemuServer/ImportDisk.pm
> @@ -4,9 +4,11 @@ use strict;
> use warnings;
>
> use PVE::Storage;
> -use PVE::QemuServer;
> use PVE::Tools qw(run_command extract_param);
>
> +use PVE::QemuServer;
> +use PVE::QemuServer::QemuImage;
> +
> # imports an external disk image to an existing VM
> # and creates by default a drive entry unused[n] pointing to the created volume
> # $params->{drive_name} may be used to specify ide0, scsi1, etc ...
> @@ -82,7 +84,7 @@ sub do_import {
> local $SIG{PIPE} = sub { die "interrupted by signal $!\n"; };
>
> PVE::Storage::activate_volumes($storecfg, [$dst_volid]);
> - PVE::QemuServer::qemu_img_convert(
> + PVE::QemuImage::convert(
> $src_path,
> $dst_volid,
> $src_size,
Just noticed while doing a import-from=... that here the ::QemuServer
was missing, sent a quick patch [0] to fix it :)
[0]
https://lore.proxmox.com/pve-devel/20250625125039.153187-1-d.kral@proxmox.com/
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0
[not found] ` <f3d01b2976480800cfa294cf888534aebadec067.camel@groupe-cyllene.com>
@ 2025-06-25 15:42 ` Fiona Ebner
0 siblings, 0 replies; 31+ messages in thread
From: Fiona Ebner @ 2025-06-25 15:42 UTC (permalink / raw)
To: DERUMIER, Alexandre, pve-devel
Am 25.06.25 um 13:31 schrieb DERUMIER, Alexandre:
>>>
>>> I think I'll send the next version of the storage patches relatively
>>> shortly after part three (still quite a bit of splitting up
>>> QemuServer.pm on the way, e.g for introducing a BlockJob module).
>>> I'll
>>> try to send part three in the following days, I hope I get around to
>>> also include blockdev-mirror there.
>>>
>>> Part four is then hopefully the final one, doing all the version-
>>> guarded
>>> switches and making all features work, fingers crossed :)
>
> In parallel, I'm working to implement multiple iothreads (great
> improvement with nvme drive from my tests)
Sounds good!
> which seem to need the new -device json syntax like
>
> -device '{"driver":"virtio-blk-pci","num-queues":4,"iothread-vq-
> mapping":[{"iothread":"iothread2","vqs":[1,3]},{"iothread":"iothread3",
> "vqs":[0,2]}],
>
>
> So, I'll look to add new -device syntax first
Could you please add it in a new QemuServer/DriveDevice.pm module?
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2025-06-25 15:42 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-23 15:44 [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 01/15] fix #5985: qmp client: increase timeout for {device, netdev, object}_{add, del} commands Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 02/15] qmp client: add default timeouts for more blockdev commands Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 03/15] helpers: add missing includes Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 04/15] helpers: fix perlcritic warning about variables named $a and $b Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 05/15] move helper for iscsi initiator name to helpers module and improve name Fiona Ebner
2025-06-24 9:48 ` Fabian Grünbichler
2025-06-24 10:05 ` Fiona Ebner
2025-06-24 10:10 ` Fabian Grünbichler
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 06/15] introduce QemuImage module Fiona Ebner
2025-06-25 12:54 ` Daniel Kral
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 07/15] introduce OVMF module Fiona Ebner
2025-06-24 10:23 ` Fabian Grünbichler
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 08/15] blockdev: re-use cache setting from child node Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 09/15] blockdev: add workaround for issue #3229 Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 10/15] blockdev: add support for 'size' option Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 11/15] ovmf: add support for using blockdev Fiona Ebner
2025-06-24 8:38 ` Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [PATCH qemu-server 12/15] cfg2cmd: ovmf: support print_ovmf_commandline() returning machine flags Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 13/15] print drive device: don't reference any drive for 'none' starting with machine version 10.0 Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 14/15] blockdev: add support for NBD paths Fiona Ebner
2025-06-23 15:44 ` [pve-devel] [RFC qemu-server 15/15] command line: switch to blockdev starting with machine version 10.0 Fiona Ebner
2025-06-24 13:53 ` DERUMIER, Alexandre via pve-devel
2025-06-24 14:34 ` Fiona Ebner
2025-06-24 14:41 ` DERUMIER, Alexandre via pve-devel
2025-06-25 11:31 ` DERUMIER, Alexandre via pve-devel
[not found] ` <f3d01b2976480800cfa294cf888534aebadec067.camel@groupe-cyllene.com>
2025-06-25 15:42 ` Fiona Ebner
2025-06-24 9:40 ` [pve-devel] [PATCH-SERIES qemu-server 00/15] preparation for blockdev, part two DERUMIER, Alexandre via pve-devel
2025-06-24 9:59 ` Fiona Ebner
2025-06-24 11:25 ` DERUMIER, Alexandre via pve-devel
2025-06-24 11:44 ` [pve-devel] partially-applied: " Fabian Grünbichler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal