Commit Graph
4 Commits
Author SHA1 Message Date
dualfroz 9f20cd4f75 fix #5998: import: avoid duplicate disk keys with multiple controllers
The disk key is built from the controller type and the address of the
disk on that controller. The address is only unique per controller, so
with more than one controller of the same type, like a VM with more than
16 disks spread over two SCSI controllers, several disks got the same
key. 'qm importovf' then failed with "cowardly refusing to overwrite
existing entry: scsi0", and the import wizard silently dropped all but
one of those disks, as they are stored in a hash by key.

Keep the address for the first disk using it and move any further disk
with the same address to the lowest address of that bus that is not
used by any other disk.

Add a test manifest with a second SCSI controller.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-09-25 11:38:19 +02:00
upstream 25ba04d0ba Upstream proxmox-git/pve-storage state of the touched files before 0788e6240e 2026-09-25 11:38:09 +02:00
dualfroz 43d4bbbdb2 fix #6969: plugin: keep content directory when freeing its last file
After removing a volume, free_image tries to remove the parent
directory, so that no empty per-guest directories are left behind once
all images of a guest are gone. This was done unconditionally, so
deleting the last ISO, container template, snippet or import file also
removed the shared content directory like 'snippets' or 'template/iso'.

The directory gets re-created shortly after by pvestatd, but as
root:root with default permissions, losing any ownership or mode that
the admin set up, for example to allow a non-root user to upload
snippets.

Only clean up the parent directory for guest images, which are the only
volumes stored in per-guest directories.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-09-25 11:30:43 +02:00
upstream 40459bfd61 Upstream proxmox-git/pve-storage state of the touched files before 5908a0d342 2026-09-25 11:30:43 +02:00