[PATCH 12/13] virDomainSnapshotAlignDisks: refactor extension to all disks

Ján Tomko jtomko at redhat.com
Wed Sep 23 15:43:14 UTC 2020


On a Wednesday in 2020, Peter Krempa wrote:
>Last step of the algorithm in virDomainSnapshotAlignDisks is to extend
>the array of disks to all VM's disk and provide defaults. This was done
>by extending the array, adding defaults at the end and then sorting it.
>This requires the 'idx' variable and also a separate sorting function.
>
>If we store the pointer to existing snapshot disk definitions in a hash
>table and create a new array of snapshot disk definitions, we can fill
>the new array directly by either copying the definition from the old
>array or adding the default.
>
>This avoids the sorting step and thus even the need to store the index
>of the domain disk altogether.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/conf/snapshot_conf.c | 48 +++++++++++++++-------------------------
> 1 file changed, 18 insertions(+), 30 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200923/e2666e05/attachment-0001.sig>


More information about the libvir-list mailing list