Am 23.05.25 um 10:30 schrieb DERUMIER, Alexandre: >>> >>> if ($path =~ m|^/|) { >>> # The 'file' driver only works for regular files. The check >>> below is taken from >>> # block/file-posix.c:hdev_probe_device() in QEMU. Do not > bother >>with detecting 'host_cdrom' >>> # devices here, those are not managed by the storage layer. >>> my $st = File::stat::stat($path); >>> + my $driver = (S_ISCHR($st->mode) || S_ISBLK($st->mode)) ? > 'host_device' : 'file'; > > This is breaking my qemu-server config unit tests because the file > don't exist. > > Also, for lvm volume, they are not currently activate at vm command > line generation. (but anyway, I'll need it to retrieve backing chain, > so maybe it's not a problem)
Thanks for testing! I'll add an activate_volume() call in the PVE::Storage::qemu_blockdev_options() function. I'd guess (almost?) all calls of the function will be followed by actually using the device afterwards, so that seems sensible enough. > Do you think it's enough safe to rely on /dev/.. path? Can you mock File::stat::stat() or PVE::Storage::qemu_blockdev_options()? I'd rather not make the production code less precise, just for easier tests if it can be avoided. I'm expecting to send the next version of the series later today, hope I'll get around to it :) Best Regards, Fiona _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel