2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library. If not, see
14 * <http://www.gnu.org/licenses/>.
21 # include "capabilities.h"
22 # include "virfilecache.h"
23 # include "domain_conf.h"
24 # include "qemu/qemu_capabilities.h"
25 # include "qemu/qemu_conf.h"
27 # define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata"
46 } testQemuInfoArgName
;
49 FLAG_EXPECT_FAILURE
= 1 << 0,
50 FLAG_EXPECT_PARSE_ERROR
= 1 << 1,
52 FLAG_REAL_CAPS
= 1 << 3,
53 FLAG_SKIP_LEGACY_CPUS
= 1 << 4,
60 virQEMUCapsPtr qemuCaps
;
61 const char *migrateFrom
;
64 unsigned int parseFlags
;
67 virCapsPtr
testQemuCapsInit(void);
68 virDomainXMLOptionPtr
testQemuXMLConfInit(void);
71 virQEMUCapsPtr
qemuTestParseCapabilitiesArch(virArch arch
,
72 const char *capsFile
);
73 virQEMUCapsPtr
qemuTestParseCapabilities(virCapsPtr caps
,
74 const char *capsFile
);
76 extern virCPUDefPtr cpuDefault
;
77 extern virCPUDefPtr cpuHaswell
;
78 extern virCPUDefPtr cpuPower8
;
79 extern virCPUDefPtr cpuPower9
;
81 void qemuTestSetHostArch(virCapsPtr caps
,
83 void qemuTestSetHostCPU(virCapsPtr caps
,
86 int qemuTestDriverInit(virQEMUDriver
*driver
);
87 void qemuTestDriverFree(virQEMUDriver
*driver
);
88 int qemuTestCapsCacheInsert(virFileCachePtr cache
,
91 int testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps
,
94 char *testQemuGetLatestCapsForArch(const char *arch
,
96 virHashTablePtr
testQemuGetLatestCaps(void);
98 typedef int (*testQemuCapsIterateCallback
)(const char *base
,
101 int testQemuCapsIterate(const char *suffix
,
102 testQemuCapsIterateCallback callback
,
105 int testQemuInfoSetArgs(struct testQemuInfo
*info
,
106 virHashTablePtr capslatest
, ...);
107 void testQemuInfoClear(struct testQemuInfo
*info
);