const char *inputDir;
const char *outputDir;
const char *archName;
+ const char *suffix;
const char *base;
int ret;
};
unsigned int fakeMicrocodeVersion = 0;
const char *p;
- if (virAsprintf(&repliesFile, "%s/%s.%s.replies",
- data->inputDir, data->base, data->archName) < 0 ||
+ if (virAsprintf(&repliesFile, "%s/%s.%s.%s",
+ data->inputDir, data->base,
+ data->archName, data->suffix) < 0 ||
virAsprintf(&capsFile, "%s/%s.%s.xml",
data->outputDir, data->base, data->archName) < 0)
goto cleanup;
doCapsTest(const char *inputDir,
const char *base,
const char *archName,
+ const char *suffix,
void *opaque)
{
testQemuDataPtr data = (testQemuDataPtr) opaque;
data->inputDir = inputDir;
data->base = base;
data->archName = archName;
+ data->suffix = suffix;
if (virTestRun(title, testQemuCaps, data) < 0)
data->ret = -1;
const char *outputDir;
const char *base;
const char *archName;
+ const char *suffix;
int ret;
};
data->outputDir, data->archName) < 0)
goto cleanup;
- if (virAsprintf(&capsFile, "%s/%s.%s.xml",
- data->inputDir, data->base, data->archName) < 0)
+ if (virAsprintf(&capsFile, "%s/%s.%s.%s",
+ data->inputDir, data->base,
+ data->archName, data->suffix) < 0)
goto cleanup;
if (virTestLoadFile(capsFile, &capsData) < 0)
doCapsTest(const char *inputDir,
const char *base,
const char *archName,
+ const char *suffix,
void *opaque)
{
testQemuDataPtr data = (testQemuDataPtr) opaque;
data->inputDir = inputDir;
data->base = base;
data->archName = archName;
+ data->suffix = suffix;
if (virTestRun(title, testQemuCapsXML, data) < 0)
data->ret = -1;
archName[0] = '\0';
archName++;
- /* Run the user-provided callback */
- if (callback(TEST_QEMU_CAPS_PATH, base, archName, opaque) < 0)
+ /* Run the user-provided callback.
+ *
+ * We skip the dot that, as verified earlier, starts the suffix
+ * to make it nicer to rebuild the original file name from inside
+ * the callback.
+ */
+ if (callback(TEST_QEMU_CAPS_PATH, base,
+ archName, suffix + 1, opaque) < 0) {
goto cleanup;
+ }
}
if (rc < 0)
typedef int (*testQemuCapsIterateCallback)(const char *inputDir,
const char *base,
const char *archName,
+ const char *suffix,
void *opaque);
int testQemuCapsIterate(const char *suffix,
testQemuCapsIterateCallback callback,