mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-08 16:54:49 +00:00
tests: libxl: do not run the emulator
Ever since commitc5a00350
the libxl parser invokes the emulator to probe which device model to use. Commitb90c4b5
introduced a workaround that used a stable path which was very likely to result in the answer matching the default. However the test is still affected by the host state and the binary gets invoked if present. Mock the libxlDomainGetEmulatorType function to stop wasting CPU cycles every time a 'make check' is run on a system with xen installed. For example xlconfigtest gets faster by 90 % Signed-off-by: Ján Tomko <jtomko@redhat.com> Fixes:b90c4b5f50
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
6c1889ed70
commit
a97e17c4e2
@ -50,4 +50,5 @@ libxlMakeDomainCapabilities(virDomainCapsPtr domCaps,
|
|||||||
size_t nfirmwares);
|
size_t nfirmwares);
|
||||||
|
|
||||||
int
|
int
|
||||||
libxlDomainGetEmulatorType(const virDomainDef *def);
|
libxlDomainGetEmulatorType(const virDomainDef *def)
|
||||||
|
G_GNUC_NO_INLINE;
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
# include "virfile.h"
|
# include "virfile.h"
|
||||||
# include "virsocket.h"
|
# include "virsocket.h"
|
||||||
|
# include "libxl/libxl_capabilities.h"
|
||||||
|
|
||||||
VIR_MOCK_IMPL_RET_VOID(xs_daemon_open,
|
VIR_MOCK_IMPL_RET_VOID(xs_daemon_open,
|
||||||
struct xs_handle *)
|
struct xs_handle *)
|
||||||
@ -123,4 +124,10 @@ VIR_MOCK_IMPL_RET_ARGS(stat, int,
|
|||||||
return real_stat(path, sb);
|
return real_stat(path, sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
libxlDomainGetEmulatorType(const virDomainDef *def G_GNUC_UNUSED)
|
||||||
|
{
|
||||||
|
return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* WITH_LIBXL && WITH_YAJL */
|
#endif /* WITH_LIBXL && WITH_YAJL */
|
||||||
|
Loading…
Reference in New Issue
Block a user