render / rpms / libvirt

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