fbe740
From a0a2e4eaa6ab0b6435286f9af6e7026f0000b9e5 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <a0a2e4eaa6ab0b6435286f9af6e7026f0000b9e5@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Mon, 16 Mar 2020 22:12:23 +0100
fbe740
Subject: [PATCH] qemublocktest: Fix and optimize fake image chain
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Set the 'id' field of the backing chain properly so that we can look
fbe740
up images, and initialize 6 images instead of 10 as we don't use more
fbe740
currently.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Eric Blake <eblake@redhat.com>
fbe740
(cherry picked from commit f8389505aae66e705046f5cbd9fe4ac10f1dee2e)
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1799013
fbe740
Message-Id: <c45885fd70242874545a5c8129bcb52022014112.1584391727.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 tests/qemublocktest.c | 3 ++-
fbe740
 1 file changed, 2 insertions(+), 1 deletion(-)
fbe740
fbe740
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
fbe740
index f48875e16d..6ccc2328b3 100644
fbe740
--- a/tests/qemublocktest.c
fbe740
+++ b/tests/qemublocktest.c
fbe740
@@ -636,6 +636,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx)
fbe740
    if (!(ret = virStorageSourceNew()))
fbe740
        abort();
fbe740
 
fbe740
+   ret->id = idx;
fbe740
    ret->type = VIR_STORAGE_TYPE_FILE;
fbe740
    ret->format = VIR_STORAGE_FILE_QCOW2;
fbe740
    ret->path = g_strdup_printf("/image%zu", idx);
fbe740
@@ -655,7 +656,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeChain(void)
fbe740
 
fbe740
     n = ret = testQemuBackupIncrementalBitmapCalculateGetFakeImage(1);
fbe740
 
fbe740
-    for (i = 2; i < 10; i++) {
fbe740
+    for (i = 2; i < 6; i++) {
fbe740
         n->backingStore = testQemuBackupIncrementalBitmapCalculateGetFakeImage(i);
fbe740
         n = n->backingStore;
fbe740
     }
fbe740
-- 
fbe740
2.25.1
fbe740