2018-12-13 21:32:06 +08:00
|
|
|
/*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2008-05-17 00:51:30 +08:00
|
|
|
|
2019-06-19 00:13:14 +08:00
|
|
|
#pragma once
|
2018-12-13 21:32:06 +08:00
|
|
|
|
2019-06-19 00:13:14 +08:00
|
|
|
#ifdef WITH_QEMU
|
2018-12-13 21:32:06 +08:00
|
|
|
|
2019-06-19 00:13:14 +08:00
|
|
|
# include "capabilities.h"
|
|
|
|
# include "virfilecache.h"
|
|
|
|
# include "domain_conf.h"
|
|
|
|
# include "qemu/qemu_capabilities.h"
|
|
|
|
# include "qemu/qemu_conf.h"
|
2008-05-17 00:51:30 +08:00
|
|
|
|
2019-06-19 00:13:14 +08:00
|
|
|
# define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata"
|
2019-04-16 18:22:31 +08:00
|
|
|
|
2016-05-10 17:35:43 +08:00
|
|
|
enum {
|
|
|
|
GIC_NONE = 0,
|
|
|
|
GIC_V2,
|
|
|
|
GIC_V3,
|
|
|
|
GIC_BOTH,
|
|
|
|
};
|
|
|
|
|
2019-03-31 23:49:34 +08:00
|
|
|
typedef enum {
|
|
|
|
ARG_QEMU_CAPS,
|
|
|
|
ARG_GIC,
|
|
|
|
ARG_MIGRATE_FROM,
|
|
|
|
ARG_MIGRATE_FD,
|
|
|
|
ARG_FLAGS,
|
|
|
|
ARG_PARSEFLAGS,
|
|
|
|
ARG_CAPS_ARCH,
|
|
|
|
ARG_CAPS_VER,
|
|
|
|
ARG_END,
|
|
|
|
} testQemuInfoArgName;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
FLAG_EXPECT_FAILURE = 1 << 0,
|
|
|
|
FLAG_EXPECT_PARSE_ERROR = 1 << 1,
|
|
|
|
FLAG_FIPS = 1 << 2,
|
|
|
|
FLAG_REAL_CAPS = 1 << 3,
|
|
|
|
FLAG_SKIP_LEGACY_CPUS = 1 << 4,
|
2019-08-08 22:55:14 +08:00
|
|
|
FLAG_SLIRP_HELPER = 1 << 5,
|
2019-03-31 23:49:34 +08:00
|
|
|
} testQemuInfoFlags;
|
|
|
|
|
|
|
|
struct testQemuInfo {
|
|
|
|
const char *name;
|
|
|
|
char *infile;
|
|
|
|
char *outfile;
|
|
|
|
virQEMUCapsPtr qemuCaps;
|
|
|
|
const char *migrateFrom;
|
|
|
|
int migrateFd;
|
|
|
|
unsigned int flags;
|
|
|
|
unsigned int parseFlags;
|
2019-10-24 23:51:42 +08:00
|
|
|
virArch arch;
|
2019-03-31 23:49:34 +08:00
|
|
|
};
|
|
|
|
|
2008-05-17 00:51:30 +08:00
|
|
|
virCapsPtr testQemuCapsInit(void);
|
2013-04-01 02:03:42 +08:00
|
|
|
virDomainXMLOptionPtr testQemuXMLConfInit(void);
|
2014-06-27 22:39:27 +08:00
|
|
|
|
2018-04-04 15:17:52 +08:00
|
|
|
|
|
|
|
virQEMUCapsPtr qemuTestParseCapabilitiesArch(virArch arch,
|
|
|
|
const char *capsFile);
|
2016-06-15 20:35:18 +08:00
|
|
|
virQEMUCapsPtr qemuTestParseCapabilities(virCapsPtr caps,
|
|
|
|
const char *capsFile);
|
2015-03-24 00:19:28 +08:00
|
|
|
|
|
|
|
extern virCPUDefPtr cpuDefault;
|
|
|
|
extern virCPUDefPtr cpuHaswell;
|
2016-09-14 04:27:09 +08:00
|
|
|
extern virCPUDefPtr cpuPower8;
|
2017-05-17 22:39:16 +08:00
|
|
|
extern virCPUDefPtr cpuPower9;
|
2016-08-04 19:16:55 +08:00
|
|
|
|
|
|
|
void qemuTestSetHostArch(virCapsPtr caps,
|
|
|
|
virArch arch);
|
|
|
|
void qemuTestSetHostCPU(virCapsPtr caps,
|
|
|
|
virCPUDefPtr cpu);
|
2015-03-24 00:19:28 +08:00
|
|
|
|
2015-09-15 14:16:02 +08:00
|
|
|
int qemuTestDriverInit(virQEMUDriver *driver);
|
|
|
|
void qemuTestDriverFree(virQEMUDriver *driver);
|
2017-07-19 23:01:56 +08:00
|
|
|
int qemuTestCapsCacheInsert(virFileCachePtr cache,
|
2015-09-09 22:03:14 +08:00
|
|
|
virQEMUCapsPtr caps);
|
|
|
|
|
2016-05-10 17:35:43 +08:00
|
|
|
int testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps,
|
|
|
|
int gic);
|
2018-04-18 16:47:31 +08:00
|
|
|
|
2019-04-16 18:26:22 +08:00
|
|
|
char *testQemuGetLatestCapsForArch(const char *arch,
|
2018-04-18 16:47:31 +08:00
|
|
|
const char *suffix);
|
2019-04-01 00:43:44 +08:00
|
|
|
virHashTablePtr testQemuGetLatestCaps(void);
|
2018-04-18 16:47:31 +08:00
|
|
|
|
2019-10-22 21:34:10 +08:00
|
|
|
typedef int (*testQemuCapsIterateCallback)(const char *inputDir,
|
2019-10-22 22:08:10 +08:00
|
|
|
const char *prefix,
|
|
|
|
const char *version,
|
2019-03-07 22:54:55 +08:00
|
|
|
const char *archName,
|
2019-10-22 21:44:37 +08:00
|
|
|
const char *suffix,
|
2019-03-07 22:54:55 +08:00
|
|
|
void *opaque);
|
2019-04-16 18:33:14 +08:00
|
|
|
int testQemuCapsIterate(const char *suffix,
|
2019-03-07 22:54:55 +08:00
|
|
|
testQemuCapsIterateCallback callback,
|
|
|
|
void *opaque);
|
|
|
|
|
2019-03-31 23:49:34 +08:00
|
|
|
int testQemuInfoSetArgs(struct testQemuInfo *info,
|
|
|
|
virHashTablePtr capslatest, ...);
|
|
|
|
void testQemuInfoClear(struct testQemuInfo *info);
|
|
|
|
|
2019-06-19 00:13:14 +08:00
|
|
|
#endif
|