tests: Use 'format' layer nodename accessors in test code

The test code cares mostly about the actual layer nodenames thus,
appropriate accessors are used.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-10-16 15:55:25 +02:00
parent c888784a24
commit d63221a889
2 changed files with 6 additions and 6 deletions

View File

@ -241,7 +241,7 @@ testQemuDiskXMLToJSONFakeSecrets(virStorageSource *src)
srcpriv->encinfo[0] = g_new0(qemuDomainSecretInfo, 1);
srcpriv->encinfo[0]->alias = g_strdup_printf("%s-encalias",
NULLSTR(src->nodeformat));
qemuBlockStorageSourceGetFormatNodename(src));
srcpriv->enccount = 1;
}
@ -653,7 +653,7 @@ testQemuBitmapListPrint(const char *title,
for (; next; next = next->next) {
virStorageSource *src = next->data;
virBufferAsprintf(buf, "%s\n", src->nodeformat);
virBufferAsprintf(buf, "%s\n", qemuBlockStorageSourceGetFormatNodename(src));
}
}
@ -668,7 +668,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx)
ret->format = VIR_STORAGE_FILE_QCOW2;
ret->path = g_strdup_printf("/image%zu", idx);
qemuBlockStorageSourceSetStorageNodename(ret, g_strdup_printf("libvirt-%zu-storage", idx));
ret->nodeformat = g_strdup_printf("libvirt-%zu-format", idx);
qemuBlockStorageSourceSetFormatNodename(ret, g_strdup_printf("libvirt-%zu-format", idx));
return ret;
}
@ -741,7 +741,7 @@ testQemuBackupIncrementalBitmapCalculate(const void *opaque)
}
target = virStorageSourceNew();
target->nodeformat = g_strdup_printf("target_node");
qemuBlockStorageSourceSetFormatNodename(target, g_strdup_printf("target_node"));
if (qemuBackupDiskPrepareOneBitmapsChain(data->chain,
target,
@ -872,7 +872,7 @@ testQemuBlockBitmapBlockcopy(const void *opaque)
g_autoptr(virStorageSource) fakemirror = virStorageSourceNew();
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
fakemirror->nodeformat = g_strdup("mirror-format-node");
qemuBlockStorageSourceSetFormatNodename(fakemirror, g_strdup("mirror-format-node"));
expectpath = g_strdup_printf("%s/%s%s-out.json", abs_srcdir,
blockcopyPrefix, data->name);

View File

@ -2600,7 +2600,7 @@ testQemuMonitorJSONBlockdevReopen(const void *opaque)
src->format = VIR_STORAGE_FILE_QCOW2;
src->readonly = true;
src->nodeformat = g_strdup("test node");
qemuBlockStorageSourceSetFormatNodename(src, g_strdup("test node"));
qemuBlockStorageSourceSetStorageNodename(src, g_strdup("backing nodename"));
src->backingStore = virStorageSourceNew();