[RFC PATCH 10/16] tests: qemublock: Add test for checkpoint deletion bitmap merge
Eric Blake
eblake at redhat.com
Mon Jan 27 18:55:02 UTC 2020
On 1/9/20 12:21 PM, Peter Krempa wrote:
> Add test infrastructure and a basic test for bitmap deletion.
>
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
> tests/qemublocktest.c | 59 +++++++++++++++++++
> .../checkpointdelete/basic-noparent-out.json | 9 +++
> 2 files changed, 68 insertions(+)
> create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json
>
> +static int
> +testQemuCheckpointDeleteMerge(const void *opaque)
> +{
> + const struct testQemuCheckpointDeleteMergeData *data = opaque;
> + g_autofree char *actual = NULL;
> + g_autofree char *expectpath = NULL;
> + g_autoptr(virJSONValue) actions = NULL;
> + bool currentcheckpoint;
> +
> + expectpath = g_strdup_printf("%s/%s%s-out.json", abs_srcdir,
> + checkpointDeletePrefix, data->name);
> +
> + if (!(actions = virJSONValueNewArray()))
> + return -1;
> +
> + /* hack to get the 'current' state until the function stops accepting it */
> + currentcheckpoint = STREQ("current", data->deletebitmap);
> +
> + if (qemuCheckpointDiscardDiskBitmaps(data->chain,
> + data->deletebitmap,
> + data->parentbitmap,
> + currentcheckpoint,
> + actions) < 0) {
Are there patches planned later on to change this? Or is this comment
going to be an instance of technical debt for an unknown length of time?
At any rate, the test looks sane enough;
Reviewed-by: Eric Blake <eblake at redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
More information about the libvir-list
mailing list