[pve-devel] [PATCH v3 qemu-server 08/11] blockdev: convert drive_mirror to blockdev_mirror

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jan 15 11:15:08 CET 2025


> Fiona Ebner <f.ebner at proxmox.com> hat am 15.01.2025 11:06 CET geschrieben:
> 
>  
> Am 15.01.25 um 10:51 schrieb Fabian Grünbichler:
> > 
> > basically what we have is the following situation:
> > 
> > - we have some input data (volid+snapname)
> > - we have a key derived from the input data (block node name)
> > - we have a value (block node)
> > - we need to be be able to map back the block node (name) to the input data
> 
> Oh, we need to map back too? But that can be done via filename in the
> block node, or not?

but that filename is the result of PVE::Storage::path which is not stable, so we can't compare that?

for snapshot operations, we need to find out "which block node is the one for the snapshot volume". we can't rely on the filename in the block graph for that, because how we map from volid+snapname to that filename might have changed on our end since that bock node was set up. so we need to find a way to map using (parts of) the block node name, which means
- having a naming scheme that allows to map back from node name to volid+snapname (i.e., the hashing scheme we are discussing ;))
- never re-using a block node for something other than what is encoded in its name (not sure if that possible?)

while an operation is ongoing, we can have $prefix-$hash-1 and $prefix-$hash-2 at the same time, and if we then end up with having just $prefix-$hash-2 after the operation that doesn't matter since we can reliably map that back via the $hash to volid+snapname.




More information about the pve-devel mailing list