[PATCH v2 10/19] qemublocktest: Fix and optimize fake image chain

Peter Krempa posted 19 patches 5 years, 11 months ago
[PATCH v2 10/19] qemublocktest: Fix and optimize fake image chain
Posted by Peter Krempa 5 years, 11 months ago
Set the 'id' field of the backing chain properly so that we can look
up images and initialize 6 images instead of 10 as we don't use more
currently.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/qemublocktest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index 7b7948d4c6..a6b6376c7d 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -570,6 +570,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx)
    if (!(ret = virStorageSourceNew()))
        abort();

+   ret->id = idx;
    ret->type = VIR_STORAGE_TYPE_FILE;
    ret->format = VIR_STORAGE_FILE_QCOW2;
    ret->path = g_strdup_printf("/image%zu", idx);
@@ -589,7 +590,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeChain(void)

     n = ret = testQemuBackupIncrementalBitmapCalculateGetFakeImage(1);

-    for (i = 2; i < 10; i++) {
+    for (i = 2; i < 6; i++) {
         n->backingStore = testQemuBackupIncrementalBitmapCalculateGetFakeImage(i);
         n = n->backingStore;
     }
-- 
2.24.1

Re: [PATCH v2 10/19] qemublocktest: Fix and optimize fake image chain
Posted by Eric Blake 5 years, 11 months ago
On 3/11/20 7:55 AM, Peter Krempa wrote:
> Set the 'id' field of the backing chain properly so that we can look
> up images and initialize 6 images instead of 10 as we don't use more

s/images/images,/

> currently.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>   tests/qemublocktest.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org