]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_capabilities; Drop virQEMUCapsSetVAList
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 27 Mar 2019 16:19:37 +0000 (17:19 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 28 Mar 2019 08:54:23 +0000 (09:54 +0100)
commit087a74e16091a12f09f00466d2d73e3e9ff76a83
tree8e5d00963b250ca9ba402df149b4235f0eec39f5
parent598641f460fce981405bd9cf07e7d6a34deb37bd
qemu_capabilities; Drop virQEMUCapsSetVAList

There is one specific caller (testInfoSetArgs() in
qemuxml2argvtest.c) which expect the va_list argument to change
after returning from the virQEMUCapsSetVAList() function.
However, since we are passing plain va_list this is not
guaranteed. The man page of stdarg(3) says:

  If ap is passed to a function that uses va_arg(ap,type), then
  the value of ap is undefined after the return of that function.

(ap is a variable of type va_list)

I've seen this in action in fact: on i686 the qemuxml2argvtest
fails on the second test case because testInfoSetArgs() sees
ARG_QEMU_CAPS and calls virQEMUCapsSetVAList to process the
capabilities (in this case there's just one
QEMU_CAPS_SECCOMP_BLACKLIST). But since the changes are not
reflected in the caller, in the next iteration testInfoSetArgs()
sees the QEMU capability and not ARG_END.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
tests/qemuxml2argvtest.c