2 * Copyright (C) 2016 Red Hat, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see
16 * <http://www.gnu.org/licenses/>.
21 #include "testutils.h"
24 #include "virthread.h"
25 #include "qemu/qemu_capabilities.h"
26 #define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW
27 #include "qemu/qemu_capspriv.h"
29 #define VIR_FROM_THIS VIR_FROM_NONE
33 eventLoop(void *opaque ATTRIBUTE_UNUSED
)
36 if (virEventRunDefaultImpl() < 0) {
37 fprintf(stderr
, "Failed to run event loop: %s\n",
38 virGetLastErrorMessage());
45 main(int argc
, char **argv
)
50 VIR_TEST_PRELOAD(abs_builddir
"/.libs/qemucapsprobemock.so");
53 fprintf(stderr
, "%s QEMU_binary\n", argv
[0]);
57 if (virThreadInitialize() < 0 ||
58 virInitialize() < 0) {
59 fprintf(stderr
, "Failed to initialize libvirt");
63 if (virEventRegisterDefaultImpl() < 0) {
64 fprintf(stderr
, "Failed to register event implementation: %s\n",
65 virGetLastErrorMessage());
69 if (virThreadCreate(&thread
, false, eventLoop
, NULL
) < 0)
72 if (!(caps
= virQEMUCapsNewForBinaryInternal(VIR_ARCH_NONE
, argv
[1], "/tmp",