
On 12/18/23 15:17, Michal Prívozník wrote:
On 12/18/23 12:02, Peter Krempa wrote:
'qemuExtVhostUserGPUPrepareDomain' breaks our design assumptions about the 'PrepareDomain' step which should not touch anything on the host.
This patchset for now fixes the symptom by mocking the function and poisons virFork and virCommandRun so that this doesn't happen in the future.
Proper fix will require splitting the vhost-user GPU prepare step to prepare the host-specific portion separately.
Peter Krempa (2): qemuxml2argvmock: Mock qemuExtVhostUserGPUPrepareDomain qemuxml2argvmock: Poison virCommandRun and virFork from test context
src/qemu/qemu_vhost_user_gpu.c | 4 ++++ src/qemu/qemu_vhost_user_gpu.h | 2 +- src/util/vircommand.h | 4 ++-- tests/qemuxml2argvmock.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
I was wondering why 'meson test --setup acccess' did not catch this and there are two reasons: 1) it doesn't check for exec(), 2) because of filewrapper, it's not really /usr/libexec/... we are trying to exec, rather than libvirt.git/tests/qemuvhostuserdata/usr/libexec/qemu/vhost-user/test-vhost-user-gpu which is just a shell script. I'll post patch for 1), might be worth removing the script from 2) too. Michal