From: Peter Krempa Date: Mon, 2 Mar 2020 14:03:07 +0000 (+0100) Subject: qemublocktest: Fix and optimize fake image chain X-Git-Tag: v6.2.0-rc1~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8389505aae66e705046f5cbd9fe4ac10f1dee2e;p=thirdparty%2Flibvirt.git qemublocktest: Fix and optimize fake image chain 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 Reviewed-by: Eric Blake --- diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 7a2204787e..fa1ccc7e85 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -640,6 +640,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); @@ -659,7 +660,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; }