Commit Graph

3574 Commits

Author SHA1 Message Date
Lierfang Support Team
bb75e10cc5 Add pxvirt patch 2025-08-13 19:17:24 +08:00
Fiona Ebner
a479b1b38a fix #6466: aarch64: pci: properly print higher-index PCI bridge addresses
For aarch64, the virt machine has an initial pcie.0 bus. The other pci
bridges that get added on top are called pci.N, see the relevant
section in config_to_command() which adds them.

In particular this fixes adding an RNG device, which is require for
OVMF PXE boot.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250618152009.120524-4-f.ebner@proxmox.com
2025-07-15 19:15:55 +02:00
Fiona Ebner
d6db7ae6cf pci: code cleanup: remove superfluous machine type parameter from print_pci_addr
The only supported machine for aarch64 is 'virt', so there is no need
to check if that is the machine. Also many (all?) other machines for
aarch64 in QEMU also don't have a 'pci' bus by default.

The parameter is also transitively removed from the functions:
1. print_hostpci_devices()
2. print_rng_device_commandline()
3. get_usb_controllers()
4. print_netdevice_full()
5. print_vga_device()

Should this ever be required in the future again, or also for the
$arch itself right now, it would be nicer to properly abstract this
away instead of passing the parameters along everywhere, e.g. by using
a class.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250618152009.120524-3-f.ebner@proxmox.com
2025-07-15 19:15:55 +02:00
Fiona Ebner
67c61303b7 cfg2cmd: print vga: fix call to print_pcie_addr()
The function print_pcie_addr() only takes a single parameter.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250618152009.120524-2-f.ebner@proxmox.com
2025-07-15 19:15:55 +02:00
Thomas Lamprecht
fae0dfd7f6 bump version to 8.4.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-14 13:51:56 +02:00
Thomas Lamprecht
399cd7ace6 revert shipping systemd unit in /usr for Bookworm
As the debhelpers for systemd in Bookworm to not find those files
then, so we would either need to handle the enable/(re)starting
ourselves, or switch back to shipping those files in the aliased /lib
directory for now – the latter is less work and restores the status
quo.

Reported-by: Daniel Herzig <d.herzig@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-14 13:51:02 +02:00
Thomas Lamprecht
6071ef258b bump version to 8.4.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-10 13:51:20 +02:00
Thomas Lamprecht
038c3be23b d/control: require libpve-common-perl >= 8.3.2
To ensure the normalize_pci_id method from sysfs tools we now use is
available.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-10 13:45:09 +02:00
Dominik Csapak
a85370076c fix #6400: pci: allow other pci domains than 0000 for NVIDIA vGPUs
when creating or cleaning up NVIDIA vGPUs, we mistakenly assumed a
PCI domain of 0000, but this might be different.

Use 'normalize_pci_id' from PVE::SysFSTools, which handles this already
correctly.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20250704061852.251189-3-d.csapak@proxmox.com
(cherry picked from commit 6c0cce85ac)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-10 13:44:01 +02:00
Thomas Lamprecht
f6748361a5 re-tidy with perltidy 20250616.01
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-03 12:27:37 +02:00
Fabian Grünbichler
a791bfe09a bump version to 8.3.14
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-07-02 15:38:19 +02:00
Stefan Hanreich
81b7538380 net: use pve-firewall helper for deciding whether to create fw bridges
pve-firewall introduced a new helper for deciding whether to create a
firewall bridge for a given tap interface. In addition to checking for
nftables, it also checks for the type of the bridge. This fixes an
issue with OVS and the nftables firewall, where firewall bridges are
still required in order for the guest firewall to work and the new
helper in pve-firewall checks for that condition now.

Previously, only the vm network script checked the condition for
creating a firewall bridge properly, but not the function for
hotplugging VM network devices. This caused a firewall bridge to
always get created when hotplugging a network device. The additional
firewall bridge had no influence on the functionality of nftables, but
was unnecessary.

For that matter a helper in qemu-server is introduced that should be
used by all call sites.

The have_sdn guards can be removed because pve-manager >= 8.2.10 has a
hard dependency on libpve-network-perl which includes the required
modules.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2025-07-02 15:28:17 +02:00
Thomas Lamprecht
ee08cd188d d/control: replace outdated pkg-config with pkgconf dependency
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-06-17 15:37:53 +02:00
Thomas Lamprecht
54396a397e reorganize source code layout
Moves this repo closer to our others, having a top-level src folder
where all relevant sources and assets are included and a debian/
folder with the packaging metadata.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-06-17 15:37:53 +02:00
Thomas Lamprecht
7bd23e21d6 d/control: record libpve-network-perl dependency
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-06-17 15:37:53 +02:00
Thomas Lamprecht
d9bd9744c5 auto-format code using perltidy with Proxmox style guide
using the new top-level `make tidy` target, which calls perltidy via
our wrapper to enforce the desired style as closely as possible.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-06-16 23:07:20 +02:00
Thomas Lamprecht
38324722b7 buildsys: add top-level make tidy target
See pve-common's commit 5ae1f2e ("buildsys: add tidy make target")
for details about the chosen xargs parameters.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-06-16 23:06:38 +02:00
Fiona Ebner
c2287c17a3 bump version to 8.3.13
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-06-16 10:24:29 +02:00
Fiona Ebner
3d26372d98 tests: cfg2cmd: add test for aio settings
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-06-11 10:04:26 +02:00
Alexandre Derumier via pve-devel
1d87945007 tests: add cache && aio tests for differents storage type
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Link: https://lore.proxmox.com/mailman.286.1749207110.395.pve-devel@lists.proxmox.com
[FE: rename volume group to avoid having duplicate with lvm-thin]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-06-11 10:00:35 +02:00
Thomas Lamprecht
fa46162722 qmeventd: auto-format code base using clang-format
Using the LLVM style with some minor adaptions to avoid cramping to
much into single lines.

For now no make target, but with the .clang-format file one can simply
run:

  clang-format -i qmeventd.[ch]

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-06-04 20:33:40 +02:00
Fiona Ebner
c7cd00516d virtiofs: prevent issue with Windows OS and too many files
As reported in the community forum [0] and the virtio-win project [1],
virtiofsd will run into its open file limit when used with a Windows
guest that reads too many files. It's also reported that the issue
does not occur with Linux guests and a workaround is using
'--inode-file-handles=mandatory' on virtiofsd command line.

The option is described as follows in the virtiofsd help:

> When to use file handles to reference inodes instead of O_PATH file
> descriptors (never, prefer, mandatory)

and the default is 'never'.

Fix the above issue by using 'prefer' rather than 'mandatory', because
that should not break other edge cases:

> prefer: Attempt to generate file handles, but fall back to O_PATH
> file descriptors where the underlying filesystem does not support
> file handles. Useful when there are various different filesystems
> under the shared directory and some of them do not support file
> handles.

[0]: https://forum.proxmox.com/threads/165565/
[1]: https://github.com/virtio-win/kvm-guest-drivers-windows/issues/1136

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Markus Frank <m.frank@proxmox.com>
Link: https://lore.proxmox.com/20250502142133.59401-1-f.ebner@proxmox.com
2025-06-02 08:19:16 +02:00
Alexandre Derumier via pve-devel
1fd1ca60f9 tests: qemu_img_convert: add rbd and btrfs snapshots convert test
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
[FE: avoid re-using already existing path/pool for newly added storages
     minor style fixes]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-05-28 12:24:40 +02:00
Fiona Ebner
c760952771 migrate: code cleanup: factor out variables for transferred memory and vfio
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20250520131431.487048-1-f.ebner@proxmox.com
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-05-21 16:33:48 +02:00
Dominik Csapak
7d1ec25bc1 migrate: silence 'Use of uninitialized value' warning
If no vfio device is present during migration, and the transferred
(main) memory did not change between loop cycles, we get a warning:

 Use of uninitialized value $last_vfio_transferred in string ne

To silence that, check if the transferred vfio value is defined before,
and always write a defined value to $last_vfio_transferred.

This was noticed by a forum user:
https://forum.proxmox.com/threads/166161/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20250519144357.3515197-1-d.csapak@proxmox.com
2025-05-21 16:32:38 +02:00
Fiona Ebner
f97b3da1e6 drive: code cleanup: remove unused $vmid argument from get_iso_path() helper
According to git history, the $vmid argument was never used.

Reported-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-05-06 14:08:04 +02:00
Alexandre Derumier
f671a0dcdf tests: add cfg2cmd for disk passthrough, rbd,krbd && zfs-over-scsi.
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
[FE: mock helper for getting host CD-ROM path
     minor style fixes]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-05-06 11:35:22 +02:00
Fiona Ebner
4d78861740 update disk config: consider recorded fleecing images
Otherwise, a rescan operation would add fleecing images as unused
disks, even if they are already recorded in the special 'fleecing'
section.

Usually, fleecing images are cleaned up directly after backup, so this
is less likely to be an issue after commit 8009da73 ("fix #6317:
backup: use correct cleanup_fleecing_images helper"), but still makes
sense for future-proofing and for other edge cases where cleanup might
have failed.

Reported-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250422080951.10072-1-f.ebner@proxmox.com
2025-04-22 10:14:32 +02:00
Wolfgang Bumiller
8009da73f1 fix #6317: backup: use correct cleanup_fleecing_images helper
The local one is specific for `allocate_fleecing_images` and has a
comment stating to use the one from `PVE::QemuConfig` in all other
cases.

The `cleanup` sub already called this, but only if the VM was running.
We do allocate fleecing images for previously-stopped VMs as well,
though, so we also need to do the cleanup.

As for the `detach_fleecing_images()` call: while could have stayed in
the `vm_running_locall()` branch, it also performs this check and this
way the entire fleecing cleanup stays together in one place.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-04-16 12:39:34 +02:00
Thomas Lamprecht
a411016f58 bump version to 8.3.12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-08 17:30:54 +02:00
Fiona Ebner
d2d8a15dea virtiofs: drop writeback option
VirtIO-fs using writeback cache seems very broken at the moment. If a
guest accesses a file (even just using 'touch'), that the host is
currently writing, the guest can permanently end up with a truncated
version of that file. Even subsequent operations like moving the file,
will not result in the correct file being visible, but just rename the
truncated one.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-04-08 17:30:03 +02:00
Fiona Ebner
dfdd5c3689 d/control: bump (build-)dependency for libpve-guest-common-perl
Version 5.2.0 of libpve-guest-common-perl is required for the
PVE/Mapping/Dir.pm module, but there was a transitive dependency for
libpve-cluster-perl missing for tracking the corresponding file on the
cluster file system and build would still fail with: > unknown file
'mapping/directory.cfg' at /usr/share/perl5/PVE/Cluster.pm

Version 5.2.2 of libpve-guest-common-perl depends on recent enough
libpve-cluster-perl to fix this.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-04-08 12:47:00 +02:00
Thomas Lamprecht
01b761e7f0 bump version to 8.3.11
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 23:35:54 +02:00
Markus Frank
64dad62fd8 disable snapshot (with RAM) and hibernate with virtio-fs devices
Signed-off-by: Markus Frank <m.frank@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Laurențiu Leahu-Vlăducu <l.leahu-vladucu@proxmox.com>
Reviewed-by: Daniel Kral <d.kral@proxmox.com>
Tested-by: Laurențiu Leahu-Vlăducu <l.leahu-vladucu@proxmox.com>
Tested-by: Daniel Kral <d.kral@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Link: https://lore.proxmox.com/20250407134950.265270-6-m.frank@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 22:31:04 +02:00
Markus Frank
7bfffaee5f migration: check_local_resources for virtiofs
add dir mapping checks to check_local_resources

Since the VM needs to be powered off for migration, migration should
work with a directory on shared storage with all caching settings.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Link: https://lore.proxmox.com/20250407134950.265270-5-m.frank@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 22:31:04 +02:00
Markus Frank
87b22e3839 fix #1027: virtio-fs support
Add support for sharing directories with a guest VM.

virtio-fs needs virtiofsd to be started. In order to start virtiofsd
as a process (despite being a daemon it is does not run in the
background), a double-fork is used.

virtiofsd should close itself together with QEMU.

There are the parameters dirid and the optional parameters direct-io,
cache and writeback. Additionally the expose-xattr & expose-acl
parameter can be set to expose xattr & acl settings from the shared
filesystem to the guest system.

The dirid gets mapped to the path on the current node and is also used
as a mount tag (name used to mount the device on the guest).

example config:
```
virtiofs0: foo,direct-io=1,cache=always,expose-acl=1
virtiofs1: dirid=bar,cache=never,expose-xattr=1,writeback=1
```

For information on the optional parameters see the coherent doc patch
and the official gitlab README:
https://gitlab.com/virtio-fs/virtiofsd/-/blob/main/README.md

Also add a permission check for virtiofs directory access.

Add virtiofsd to the Recommends list for the qemu-server Debian
package, this allows users to opt-out of installing this package, e.g.
for certification reasons.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Link: https://lore.proxmox.com/20250407134950.265270-3-m.frank@proxmox.com
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
 [TL: squash d/control change and re-add Lukas' T-b, as nothing
  essentially changed from the v16 where his tag applied]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 22:30:11 +02:00
Fiona Ebner
556cc662ab qmeventd: go back to extracting vmid from commandline instead of cgroup file
In spirit, this is a revert of 502870a0 ("qmeventd: extract vmid from
cgroup file instead of cmdline"), but instead of relying on the custom
'id' commandline option that's added by a Proxmox VE patch to QEMU,
rely on the standard 'pidfile' option to extract the VM ID.

As reported in the community forum [0], at least during stop mode
backup, it seems to be possible to end up with the VM process having
> 0::/system.slice/pvescheduler.service
as its single cgroup entry. It's not clear what exactly happens and
there was no success to reproduce the issue. Might be a rare bug in
systemd or in pve-common's enter_systemd_scope() code.

This was not the first time relying on the cgroup entry caused issues,
see d0b58753 ("qmeventd: improve getting VMID from PID in presence of
legacy cgroup entries").

To avoid such edge cases and issues in the future, go back to
extracting the VM ID from the process's commandline.

It's enough to care about the first occurrence of the 'pidfile'
option, because that's the one added by Proxmox VE, so the 'continue's
in the loop turn into 'break's. Even though a later option would
override the first for QEMU itself to use, that's not supported
anyways and the important part is the VM ID which is present in the
first.

[0]: https://forum.proxmox.com/threads/147409/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20240614092134.18729-1-f.ebner@proxmox.com
2025-04-07 22:08:13 +02:00
Aaron Lauterer
28d8e248c3 vmstatus_return_properties: add missing serial property
Fixes: 8107b37 ("add serial:1 to vmstatus when config has a serial device configured")
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Link: https://lore.proxmox.com/20250407162718.495812-2-a.lauterer@proxmox.com/
2025-04-07 21:55:22 +02:00
Thomas Lamprecht
cbe9de99c5 machine: improve code style in get_pve_version
This makes it a bit more obvious what happens and having an actual
error for bogus $PVE_MACHINE_VERSION entries.

Note that there was no auto-vivification before, as we never directly
accessed $PVE_MACHINE_VERSION->{$verstr}->{highest} but used
get_machine_pve_revisions to query a specific QEMU machine version's
PVE revisions and then operated on the return value, and that method
returns undef if there is no entry at all.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 17:30:16 +02:00
Thomas Lamprecht
a9a5d37bc6 tests: fix config to command expected outputs
This should have been in the patch doing the change :(

Fixes: 65b2041 ("vm-network-scripts: move scripts to /usr/libexec")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 17:30:16 +02:00
Maximiliano Sandoval
65b20410ff vm-network-scripts: move scripts to /usr/libexec
Moves the network scripts from /var/lib/qemu-server into
/usr/libexec/qemu-server.

/usr/libexec is described as binaries run by programs which are not
intended to be directly executed by the user on [FHS 4.7]. On the other
hand /var/lib corresponds to variable state information, which does not
fit the use case here, see [FHS 5.8].

For the sake of preventing race conditions during upgrade we ship both
versions until version 9. This is required as package files are first
unpacked, including the removal of files not shipped by the new
version anymore, and only then configured, which triggers the restart
of the services.

[FHS 4.7]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html
[FHS 5.8]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s08.html

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Link: https://lore.proxmox.com/20250218133206.318155-1-m.sandoval@proxmox.com
2025-04-07 16:01:21 +02:00
Thomas Lamprecht
5f8a64ae59 Merge patch series "more robust handling of fleecing images"
Fiona Ebner <f.ebner@proxmox.com> says:

Record the created fleecing images in the VM configuration to be able
to remove left-overs after hard failures.

Adds a new special configuration section 'fleecing', making special
section handling more generic as preparation, as well as fixing some
corner cases in configuration parsing and adding tests.

Fiona Ebner (16):
  migration: remove unused variable
  test: avoid duplicate mock module in restore config test
  test: add parse config tests
  parse config: be precise about section type checks
  test: add test case exposing issue with unknown sections
  parse config: skip unknown sections and warn about their presence
  vzdump: anchor matches for pending and special sections
  vzdump: skip all special sections
  config: make special section handling generic
  test: parse config: test config with duplicate sections
  parse config: warn about duplicate sections
  check type: require schema as an argument
  config: add fleecing section
  fix #5440: vzdump: better cleanup fleecing images after hard errors
  migration: attempt to clean up potential left-over fleecing images
  destroy vm: clean up potential left-over fleecing images

Link: https://lore.proxmox.com/20250127112923.31703-1-f.ebner@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 14:13:56 +02:00
Fiona Ebner
a5185ba114 destroy vm: clean up potential left-over fleecing images
Avoids that any left-over fleecing images become orphaned.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-17-f.ebner@proxmox.com
2025-04-07 14:13:01 +02:00
Fiona Ebner
4e659fcac6 migration: attempt to clean up potential left-over fleecing images
Clean up left-over fleecing images before the guest is migrated to a
different node and they'd really become orphaned.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-16-f.ebner@proxmox.com
2025-04-07 14:13:01 +02:00
Fiona Ebner
a39866732f fix #5440: vzdump: better cleanup fleecing images after hard errors
By recording the allocated fleecing images in the VM config, they
are not immediately orphaned, should a hard error occur during
backup that prevents cleanup.

They are attempted to be cleaned up during the next backup run.

In the cleanup helper, check if fleecing images are still attached in
QEMU and detach them. This allows recovering from more failure
scenarios. However, to avoid a deadlock, a left-over backup job needs
to be canceled first. While canceling a left-over backup already
happens when cleanup is done for a subsquent backup, it is required
for other cases that like cleanup before migration (to be added in a
following commit).

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-15-f.ebner@proxmox.com
2025-04-07 14:13:01 +02:00
Fiona Ebner
a82c4555e3 config: add fleecing section
Will be used for improved cleanup of fleecing images.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-14-f.ebner@proxmox.com
2025-04-07 14:13:01 +02:00
Fiona Ebner
6eb92d31ba check type: require schema as an argument
In preparation to re-use the helper with a dedicated schema for a
'fleecing' special section.

No functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-13-f.ebner@proxmox.com
2025-04-07 14:13:01 +02:00
Fiona Ebner
68eabc42c1 parse config: warn about duplicate sections
Currently, a duplicate section will quietly override the previous
instance of the section with the same identifier. Keep the current
behavior of preferring later entries, but issue a warning or die when
parsing strictly.

The entry for 'pending' in the result needs to start out as undefined
for the check to also work in presence of empty sections. Avoid
changing the returned value itself, by making sure to initialize the
entry before returning.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-12-f.ebner@proxmox.com
2025-04-07 14:13:01 +02:00
Fiona Ebner
90ae915305 test: parse config: test config with duplicate sections
Add a test case to witness how duplicate sections are handled.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-11-f.ebner@proxmox.com
2025-04-07 14:13:01 +02:00
Fiona Ebner
63567c0c42 config: make special section handling generic
Collect special sections below a common 'special-sections' key in
preparation to introduce a new special section.

The special 'cloudinit' section was added in the top-level of the
configuration structure, but it's cleaner to group special sections
more similar to snapshots.

The 'cloudinit' key was already initialized, so having the new
'special-sections' key be always initialized should not cause issues
after checking and adapting all usages of 'cloudinit' which this patch
attempts to do.

Add compat handling for remote migration which might receive the
configuration hash from a node that does not yet have the changes.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-10-f.ebner@proxmox.com
2025-04-07 14:13:01 +02:00