mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
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 <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
41de7230ab
commit
f8389505aa
@ -640,6 +640,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx)
|
|||||||
if (!(ret = virStorageSourceNew()))
|
if (!(ret = virStorageSourceNew()))
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
|
ret->id = idx;
|
||||||
ret->type = VIR_STORAGE_TYPE_FILE;
|
ret->type = VIR_STORAGE_TYPE_FILE;
|
||||||
ret->format = VIR_STORAGE_FILE_QCOW2;
|
ret->format = VIR_STORAGE_FILE_QCOW2;
|
||||||
ret->path = g_strdup_printf("/image%zu", idx);
|
ret->path = g_strdup_printf("/image%zu", idx);
|
||||||
@ -659,7 +660,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeChain(void)
|
|||||||
|
|
||||||
n = ret = testQemuBackupIncrementalBitmapCalculateGetFakeImage(1);
|
n = ret = testQemuBackupIncrementalBitmapCalculateGetFakeImage(1);
|
||||||
|
|
||||||
for (i = 2; i < 10; i++) {
|
for (i = 2; i < 6; i++) {
|
||||||
n->backingStore = testQemuBackupIncrementalBitmapCalculateGetFakeImage(i);
|
n->backingStore = testQemuBackupIncrementalBitmapCalculateGetFakeImage(i);
|
||||||
n = n->backingStore;
|
n = n->backingStore;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user