[pve-devel] [RFC storage 1/3] plugin: add method to get qemu blockdevice options for volume
Fiona Ebner
f.ebner at proxmox.com
Fri May 23 10:54:45 CEST 2025
Am 23.05.25 um 10:50 schrieb DERUMIER, Alexandre:
>>
>> 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.
>
> ok. (I'll also verify in qemu-server to deactivate_volumes, if vm
> command line generation is failing, as I think we only doing it in
> vm_start currently)
Good point! I guess it's better to also do the activation in qemu-server
then, so that we can match it up nicely without going over package
boundaries.
>> 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.
>
> sure,no problem!
>
> (maybe also add a check if the file exist before calling st->mode,
> because I got
>
> # got unexpected error: Can't call method "mode" on an undefined value
Ack, will add a check that stat() worked :)
Best Regards,
Fiona
More information about the pve-devel
mailing list