]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testQemuInfoSetArgs: Move argument fetching to the loop
authorPeter Krempa <pkrempa@redhat.com>
Tue, 17 Aug 2021 12:24:13 +0000 (14:24 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 18 Aug 2021 08:20:49 +0000 (10:20 +0200)
Since the last patch removed the hack which needed lookahead to see
whether all QEMU_CAPS_ were parsed we can move the fetching of the
arguments into the loop.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/testutilsqemu.c

index c86f7f2e392ee4e880437cc90064396dacc123c2..5ff373e9540473a24ecb48012821195f73d448de 100644 (file)
@@ -697,8 +697,7 @@ testQemuInfoSetArgs(struct testQemuInfo *info,
         abort();
 
     va_start(argptr, capslatest);
-    argname = va_arg(argptr, testQemuInfoArgName);
-    while (argname != ARG_END) {
+    while ((argname = va_arg(argptr, testQemuInfoArgName)) != ARG_END) {
         switch (argname) {
         case ARG_QEMU_CAPS:
             fakeCapsUsed = true;
@@ -740,8 +739,6 @@ testQemuInfoSetArgs(struct testQemuInfo *info,
             fprintf(stderr, "Unexpected test info argument");
             goto cleanup;
         }
-
-        argname = va_arg(argptr, testQemuInfoArgName);
     }
 
     if (!!capsarch ^ !!capsver) {