[libvirt PATCH v2 08/24] qemu_snapshot: introduce qemuSnapshotCreateQcow2Files

Peter Krempa pkrempa at redhat.com
Tue Jul 25 13:40:11 UTC 2023


On Tue, Jun 27, 2023 at 17:07:11 +0200, Pavel Hrdina wrote:
> Extract creation of qcow2 files for external snapshots to separate
> function as we will need it for external snapshot revert code.
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  src/qemu/qemu_snapshot.c | 67 +++++++++++++++++++++++++---------------
>  1 file changed, 42 insertions(+), 25 deletions(-)
> 
> diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
> index 8e1eb21b5d..227c201195 100644
> --- a/src/qemu/qemu_snapshot.c
> +++ b/src/qemu/qemu_snapshot.c
> @@ -181,35 +181,21 @@ qemuSnapshotDomainDefUpdateDisk(virDomainDef *domdef,
>  }
>  
>  
> -/* The domain is expected to be locked and inactive. */
>  static int
> -qemuSnapshotCreateInactiveInternal(virQEMUDriver *driver,
> -                                   virDomainObj *vm,
> -                                   virDomainMomentObj *snap)
> -{
> -    return qemuDomainSnapshotForEachQcow2(driver, vm->def, snap, "-c", false);
> -}
> -
> -
> -/* The domain is expected to be locked and inactive. */
> -static int
> -qemuSnapshotCreateInactiveExternal(virQEMUDriver *driver,
> -                                   virDomainObj *vm,
> -                                   virDomainMomentObj *snap,
> -                                   bool reuse)

Please document the arguments of the new helper.

> +qemuSnapshotCreateQcow2Files(virDomainObj *vm,
> +                             virDomainSnapshotDef *snapdef,
> +                             virBitmap *created,
> +                             bool reuse)

Reviewed-by: Peter Krempa <pkrempa at redhat.com>


More information about the libvir-list mailing list