mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: testQemuCapsIterate: Pass suffix to callback
Right now users need to hardcode the suffix, which is not a big deal since they're the ones who passed it to testQemuCapsIterate() in the first place; however, since we're already passing most of the information to the callback and we're going to add more later on, it makes sense to be consistent and pass the suffix too. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
@@ -936,9 +936,16 @@ testQemuCapsIterate(const char *suffix,
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user