mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemucapabilitiesdata: Separate version from architecture with a '_'
Parsing a version where components are separated by dots, while other components are also separated by dots is a bit insane. Separate the version by an underscore. To achieve this we rename all the caps files and adjust the appropriate places formatting the path. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e1633a1b27
commit
75e606974b
@ -81,7 +81,7 @@ fillQemuCaps(virDomainCaps *domCaps,
|
||||
if (fakeHostCPU(domCaps->arch) < 0)
|
||||
return -1;
|
||||
|
||||
path = g_strdup_printf("%s/%s.%s.xml", TEST_QEMU_CAPS_PATH, name, arch);
|
||||
path = g_strdup_printf("%s/%s_%s.xml", TEST_QEMU_CAPS_PATH, name, arch);
|
||||
if (!(qemuCaps = qemuTestParseCapabilitiesArch(domCaps->arch, path)))
|
||||
return -1;
|
||||
|
||||
|
@ -224,7 +224,7 @@ iterateCapsFile(const char *inputDir,
|
||||
const char *suffix,
|
||||
void *opaque G_GNUC_UNUSED)
|
||||
{
|
||||
g_autofree char *repliesFile = g_strdup_printf("%s/%s_%s.%s.%s", inputDir, prefix, version, archName, suffix);
|
||||
g_autofree char *repliesFile = g_strdup_printf("%s/%s_%s_%s.%s", inputDir, prefix, version, archName, suffix);
|
||||
|
||||
return virTestRun(repliesFile, testCapsFile, repliesFile);
|
||||
}
|
||||
|
@ -78,10 +78,10 @@ testQemuCaps(const void *opaque)
|
||||
unsigned int fakeMicrocodeVersion = 0;
|
||||
const char *p;
|
||||
|
||||
repliesFile = g_strdup_printf("%s/%s_%s.%s.%s",
|
||||
repliesFile = g_strdup_printf("%s/%s_%s_%s.%s",
|
||||
data->inputDir, data->prefix, data->version,
|
||||
data->archName, data->suffix);
|
||||
capsFile = g_strdup_printf("%s/%s_%s.%s.xml",
|
||||
capsFile = g_strdup_printf("%s/%s_%s_%s.xml",
|
||||
data->outputDir, data->prefix, data->version,
|
||||
data->archName);
|
||||
|
||||
@ -142,7 +142,7 @@ testQemuCapsCopy(const void *opaque)
|
||||
g_autoptr(virQEMUCaps) copy = NULL;
|
||||
g_autofree char *actual = NULL;
|
||||
|
||||
capsFile = g_strdup_printf("%s/%s_%s.%s.xml",
|
||||
capsFile = g_strdup_printf("%s/%s_%s_%s.xml",
|
||||
data->outputDir, data->prefix, data->version,
|
||||
data->archName);
|
||||
|
||||
|
@ -124,7 +124,7 @@ testQemuCapsXML(const void *opaque)
|
||||
|
||||
xmlFile = g_strdup_printf("%s/caps.%s.xml", data->outputDir, data->archName);
|
||||
|
||||
capsFile = g_strdup_printf("%s/%s_%s.%s.%s",
|
||||
capsFile = g_strdup_printf("%s/%s_%s_%s.%s",
|
||||
data->inputDir, data->prefix, data->version,
|
||||
data->archName, data->suffix);
|
||||
|
||||
|
@ -832,15 +832,15 @@ testQemuCapsIterate(const char *suffix,
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Find the last dot */
|
||||
if (!(archName = strrchr(tmp, '.'))) {
|
||||
/* Find the underscore separating version from arch */
|
||||
if (!(archName = strchr(version, '_'))) {
|
||||
VIR_TEST_VERBOSE("malformed file name '%s'", ent->d_name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* The version number and the architecture name are separated by
|
||||
* a dot: overwriting that dot with \0 results in both being usable
|
||||
* as independent, null-terminated strings */
|
||||
* a underscore: overwriting that underscore with \0 results in both
|
||||
* being usable as independent, null-terminated strings */
|
||||
archName[0] = '\0';
|
||||
archName++;
|
||||
|
||||
@ -1011,7 +1011,7 @@ testQemuInfoInitArgs(struct testQemuInfo *info)
|
||||
|
||||
stripmachinealiases = true;
|
||||
} else {
|
||||
capsfile = g_strdup_printf("%s/caps_%s.%s.xml",
|
||||
capsfile = g_strdup_printf("%s/caps_%s_%s.xml",
|
||||
TEST_QEMU_CAPS_PATH,
|
||||
info->args.capsver,
|
||||
info->args.capsarch);
|
||||
|
Loading…
Reference in New Issue
Block a user