From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v2 2/8] config to command: get rid of globalFlags
Date: Fri, 7 Mar 2025 15:44:29 +0100 [thread overview]
Message-ID: <20250307144436.122621-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250307144436.122621-1-d.csapak@proxmox.com>
We only have one place where we use it, so add the global flag inline,
instead of collecting and doing it at the end. This makes it consistent
with our other places where we need '-global' flags.
Adapt the tests, since that global flag changes place, the resulting
qemu hardware should be identical, since qemu handles all global flags
at the same time.
Tested live migration of a vm with such a flag from an old node to new
and it worked without problems.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
new in v2 but replaces the fix for the globalFlags
PVE/QemuServer.pm | 5 ++---
test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd | 4 ++--
test/cfg2cmd/custom-cpu-model.conf.cmd | 4 ++--
test/cfg2cmd/i440fx-win10-hostpci.conf.cmd | 4 ++--
test/cfg2cmd/q35-win10-hostpci.conf.cmd | 4 ++--
test/cfg2cmd/q35-windows-pinning.conf.cmd | 4 ++--
test/cfg2cmd/spice-win.conf.cmd | 4 ++--
7 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index ffd5d56b..1da7e9a1 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3412,7 +3412,7 @@ sub config_to_command {
$conf = $newconf;
}
- my ($globalFlags, $machineFlags, $rtcFlags) = ([], [], []);
+ my ($machineFlags, $rtcFlags) = ([], []);
my $devices = [];
my $bridges = {};
my $ostype = $conf->{ostype};
@@ -3689,7 +3689,7 @@ sub config_to_command {
}
if ($winversion >= 6) {
- push @$globalFlags, 'kvm-pit.lost_tick_policy=discard';
+ push $cmd->@*, '-global', 'kvm-pit.lost_tick_policy=discard';
push @$machineFlags, 'hpet=off';
}
@@ -4001,7 +4001,6 @@ sub config_to_command {
push @$cmd, @$devices;
push @$cmd, '-rtc', join(',', @$rtcFlags) if scalar(@$rtcFlags);
push @$cmd, '-machine', join(',', @$machineFlags) if scalar(@$machineFlags);
- push @$cmd, '-global', join(',', @$globalFlags) if scalar(@$globalFlags);
if (my $vmstate = $conf->{vmstate}) {
my $statepath = PVE::Storage::path($storecfg, $vmstate);
diff --git a/test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd b/test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd
index 077437d2..cbb3e125 100644
--- a/test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd
+++ b/test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd
@@ -13,6 +13,7 @@
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
+ -global 'kvm-pit.lost_tick_policy=discard' \
-cpu 'athlon,+aes,+avx,enforce,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vendor_id=testvend,hv_vpindex,+kvm_pv_eoi,-kvm_pv_unhalt,vendor=AuthenticAMD,host-phys-bits=true' \
-m 512 \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -23,5 +24,4 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-rtc 'driftfix=slew,base=localtime' \
- -machine 'hpet=off,type=pc-i440fx-5.1+pve0' \
- -global 'kvm-pit.lost_tick_policy=discard'
+ -machine 'hpet=off,type=pc-i440fx-5.1+pve0'
diff --git a/test/cfg2cmd/custom-cpu-model.conf.cmd b/test/cfg2cmd/custom-cpu-model.conf.cmd
index 5a9daed8..3393441e 100644
--- a/test/cfg2cmd/custom-cpu-model.conf.cmd
+++ b/test/cfg2cmd/custom-cpu-model.conf.cmd
@@ -13,6 +13,7 @@
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
+ -global 'kvm-pit.lost_tick_policy=discard' \
-cpu 'athlon,+aes,+avx,enforce,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vendor_id=testvend,hv_vpindex,+kvm_pv_eoi,-kvm_pv_unhalt,vendor=AuthenticAMD,+virt-ssbd,phys-bits=40' \
-m 512 \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -23,5 +24,4 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-rtc 'driftfix=slew,base=localtime' \
- -machine 'hpet=off,type=pc-i440fx-5.1+pve0' \
- -global 'kvm-pit.lost_tick_policy=discard'
+ -machine 'hpet=off,type=pc-i440fx-5.1+pve0'
diff --git a/test/cfg2cmd/i440fx-win10-hostpci.conf.cmd b/test/cfg2cmd/i440fx-win10-hostpci.conf.cmd
index 455c898d..06f2f7dd 100644
--- a/test/cfg2cmd/i440fx-win10-hostpci.conf.cmd
+++ b/test/cfg2cmd/i440fx-win10-hostpci.conf.cmd
@@ -15,6 +15,7 @@
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
+ -global 'kvm-pit.lost_tick_policy=discard' \
-cpu 'kvm64,enforce,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vpindex,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep' \
-m 512 \
-object 'memory-backend-ram,id=ram-node0,size=256M' \
@@ -33,5 +34,4 @@
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/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,bootindex=300' \
-rtc 'driftfix=slew,base=localtime' \
- -machine 'hpet=off,type=pc-i440fx-5.1+pve0' \
- -global 'kvm-pit.lost_tick_policy=discard'
+ -machine 'hpet=off,type=pc-i440fx-5.1+pve0'
diff --git a/test/cfg2cmd/q35-win10-hostpci.conf.cmd b/test/cfg2cmd/q35-win10-hostpci.conf.cmd
index cf03989b..4f04b76e 100644
--- a/test/cfg2cmd/q35-win10-hostpci.conf.cmd
+++ b/test/cfg2cmd/q35-win10-hostpci.conf.cmd
@@ -15,6 +15,7 @@
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
+ -global 'kvm-pit.lost_tick_policy=discard' \
-cpu 'kvm64,enforce,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vpindex,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep' \
-m 512 \
-object 'memory-backend-ram,id=ram-node0,size=256M' \
@@ -34,5 +35,4 @@
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/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,bootindex=300' \
-rtc 'driftfix=slew,base=localtime' \
- -machine 'hpet=off,type=pc-q35-5.1+pve0' \
- -global 'kvm-pit.lost_tick_policy=discard'
+ -machine 'hpet=off,type=pc-q35-5.1+pve0'
diff --git a/test/cfg2cmd/q35-windows-pinning.conf.cmd b/test/cfg2cmd/q35-windows-pinning.conf.cmd
index d8570b2c..31a01818 100644
--- a/test/cfg2cmd/q35-windows-pinning.conf.cmd
+++ b/test/cfg2cmd/q35-windows-pinning.conf.cmd
@@ -12,6 +12,7 @@
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
+ -global 'kvm-pit.lost_tick_policy=discard' \
-cpu 'kvm64,enforce,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vpindex,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep' \
-m 512 \
-readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \
@@ -20,5 +21,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' \
-rtc 'driftfix=slew,base=localtime' \
- -machine 'hpet=off,type=pc-q35-9.2+pve0' \
- -global 'kvm-pit.lost_tick_policy=discard'
+ -machine 'hpet=off,type=pc-q35-9.2+pve0'
diff --git a/test/cfg2cmd/spice-win.conf.cmd b/test/cfg2cmd/spice-win.conf.cmd
index 7663522e..32dff365 100644
--- a/test/cfg2cmd/spice-win.conf.cmd
+++ b/test/cfg2cmd/spice-win.conf.cmd
@@ -13,6 +13,7 @@
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
-vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
+ -global 'kvm-pit.lost_tick_policy=discard' \
-cpu 'kvm64,enforce,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vpindex,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep' \
-m 768 \
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
@@ -33,5 +34,4 @@
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A1,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' \
-rtc 'driftfix=slew,base=localtime' \
- -machine 'hpet=off,type=pc-i440fx-4.0+pve0' \
- -global 'kvm-pit.lost_tick_policy=discard'
+ -machine 'hpet=off,type=pc-i440fx-4.0+pve0'
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-03-07 14:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 14:44 [pve-devel] [PATCH qemu-server/docs v2] disable S3/S4 power states by default Dominik Csapak
2025-03-07 14:44 ` [pve-devel] [PATCH qemu-server v2 1/8] tests: cfg2cmd: add test for windows machine pinning from meta info Dominik Csapak
2025-03-07 14:44 ` Dominik Csapak [this message]
2025-03-07 14:44 ` [pve-devel] [PATCH qemu-server v2 3/8] machine: correctly select pve machine version for non pinned windows guests Dominik Csapak
2025-03-07 14:44 ` [pve-devel] [PATCH qemu-server v2 4/8] machine: incorporate pve machine version when pinning " Dominik Csapak
2025-03-07 14:44 ` [pve-devel] [PATCH qemu-server v2 5/8] machine: add S3/S4 power state properties Dominik Csapak
2025-04-04 11:53 ` Fiona Ebner
2025-03-07 14:44 ` [pve-devel] [PATCH qemu-server v2 6/8] machine: bump pve machine version and reverse the s3/s4 defaults Dominik Csapak
2025-04-04 11:54 ` Fiona Ebner
2025-03-07 14:44 ` [pve-devel] [PATCH qemu-server v2 7/8] api: qemu machine capabilities: add custom pveX versions too Dominik Csapak
2025-04-04 12:02 ` Fiona Ebner
2025-03-07 14:44 ` [pve-devel] [PATCH qemu-server v2 8/8] api: qemu machine capabilities: add description for pveX variants Dominik Csapak
2025-04-04 12:04 ` Fiona Ebner
2025-04-04 12:24 ` Fiona Ebner
2025-03-07 14:44 ` [pve-devel] [PATCH docs v2 1/1] qm: pve machine version: add section to explain +pveX versions Dominik Csapak
2025-04-04 12:20 ` Fiona Ebner
2025-04-01 9:17 ` [pve-devel] [PATCH qemu-server/docs v2] disable S3/S4 power states by default Dominik Csapak
2025-04-04 12:22 ` Fiona Ebner
2025-04-04 13:23 ` Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250307144436.122621-3-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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