mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 17:18:01 +03:00
libxl: remove enum libxlHwcapVersion
As well as the code probing for the version in libxlCapsInitHost. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
a8328f5222
commit
6b08d4b37d
@ -45,11 +45,6 @@ VIR_LOG_INIT("libxl.libxl_capabilities");
|
|||||||
#define LIBXL_X86_FEATURE_PAE_MASK (1 << 6)
|
#define LIBXL_X86_FEATURE_PAE_MASK (1 << 6)
|
||||||
#define LIBXL_X86_FEATURE_LM_MASK (1 << 29)
|
#define LIBXL_X86_FEATURE_LM_MASK (1 << 29)
|
||||||
|
|
||||||
enum libxlHwcapVersion {
|
|
||||||
LIBXL_HWCAP_V0 = 0, /* for Xen 4.4 .. 4.6 */
|
|
||||||
LIBXL_HWCAP_V1, /* for Xen 4.7 and up */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct guest_arch {
|
struct guest_arch {
|
||||||
virArch arch;
|
virArch arch;
|
||||||
int hvm;
|
int hvm;
|
||||||
@ -106,8 +101,7 @@ libxlCapsAddCPUID(virCPUData *data, virCPUx86CPUID *cpuid, ssize_t ncaps)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static virCPUData *
|
static virCPUData *
|
||||||
libxlCapsNodeData(virCPUDef *cpu, libxl_hwcap hwcap,
|
libxlCapsNodeData(virCPUDef *cpu, libxl_hwcap hwcap)
|
||||||
enum libxlHwcapVersion version G_GNUC_UNUSED)
|
|
||||||
{
|
{
|
||||||
ssize_t ncaps;
|
ssize_t ncaps;
|
||||||
virCPUData *cpudata = NULL;
|
virCPUData *cpudata = NULL;
|
||||||
@ -142,8 +136,7 @@ libxlCapsNodeData(virCPUDef *cpu, libxl_hwcap hwcap,
|
|||||||
* the X'th 32-bit word of hw_cap.
|
* the X'th 32-bit word of hw_cap.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
libxlCapsInitCPU(virCaps *caps, libxl_physinfo *phy_info,
|
libxlCapsInitCPU(virCaps *caps, libxl_physinfo *phy_info)
|
||||||
enum libxlHwcapVersion version G_GNUC_UNUSED)
|
|
||||||
{
|
{
|
||||||
virCPUData *data = NULL;
|
virCPUData *data = NULL;
|
||||||
virCPUDef *cpu = NULL;
|
virCPUDef *cpu = NULL;
|
||||||
@ -177,7 +170,7 @@ libxlCapsInitCPU(virCaps *caps, libxl_physinfo *phy_info,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
if (!(data = libxlCapsNodeData(cpu, phy_info->hw_cap, version)) ||
|
if (!(data = libxlCapsNodeData(cpu, phy_info->hw_cap)) ||
|
||||||
cpuDecode(cpu, data, NULL) < 0) {
|
cpuDecode(cpu, data, NULL) < 0) {
|
||||||
VIR_WARN("Failed to initialize host cpu features");
|
VIR_WARN("Failed to initialize host cpu features");
|
||||||
goto error;
|
goto error;
|
||||||
@ -196,8 +189,6 @@ libxlCapsInitCPU(virCaps *caps, libxl_physinfo *phy_info,
|
|||||||
static int
|
static int
|
||||||
libxlCapsInitHost(libxl_ctx *ctx, virCaps *caps)
|
libxlCapsInitHost(libxl_ctx *ctx, virCaps *caps)
|
||||||
{
|
{
|
||||||
const libxl_version_info *ver_info;
|
|
||||||
enum libxlHwcapVersion version;
|
|
||||||
libxl_physinfo phy_info;
|
libxl_physinfo phy_info;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
@ -208,14 +199,7 @@ libxlCapsInitHost(libxl_ctx *ctx, virCaps *caps)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ver_info = libxl_get_version_info(ctx)) == NULL) {
|
if (libxlCapsInitCPU(caps, &phy_info) < 0)
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Failed to get version info from libxenlight"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
version = (ver_info->xen_version_minor >= 7);
|
|
||||||
if (libxlCapsInitCPU(caps, &phy_info, version) < 0)
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virCapabilitiesSetNetPrefix(caps, LIBXL_GENERATED_PREFIX_XEN) < 0)
|
if (virCapabilitiesSetNetPrefix(caps, LIBXL_GENERATED_PREFIX_XEN) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user