Re: [libvirt PATCH v2 19/24] qemu_snapshot: remove revertdisks when creating new snapshot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 27, 2023 at 17:07:22 +0200, Pavel Hrdina wrote:
> When user creates a new snapshot after reverting to non-leaf snapshot we
> no longer need to store the temporary overlays as they will be part of
> the VM XMLs stored in the newly created snapshot.
> 
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---
>  src/qemu/qemu_snapshot.c | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
> index a206f015c4..2950ad7d77 100644
> --- a/src/qemu/qemu_snapshot.c
> +++ b/src/qemu/qemu_snapshot.c
> @@ -1652,6 +1652,23 @@ qemuSnapshotCreateWriteMetadata(virDomainObj *vm,
>  }
>  
>  
> +static void
> +qemuSnapshotClearRevertdisks(virDomainMomentObj *current)
> +{
> +    virDomainSnapshotDef *curdef = NULL;
> +
> +    if (!current)
> +        return;
> +
> +    curdef = virDomainSnapshotObjGetDef(current);
> +
> +    if (curdef->revertdisks) {
> +        g_clear_pointer(&curdef->revertdisks, g_free);

At least in one instance the structure's 'name' and 'src' fields are
filled with allocated pointers, so this looks like it will leak memory.

I also didn't find code which frees the 'reverdisks' field when the
snapshot definition is being freed.




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux