Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

travis: use libkvmi repo #32

Merged
merged 5 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ language: c

# install libkvmi for all tests
before_install:
# install in /tmp/kvm to avoid breaking astyle test
- git clone https://github.com/KVM-VMI/kvm --branch kvmi --depth 1 /tmp/kvm
- pushd /tmp/kvm/tools/kvm/kvmi
# install in /tmp/libkvmi to avoid breaking astyle test
- git clone https://github.com/bitdefender/libkvmi --branch kvmi-v6 /tmp/libkvmi
- pushd /tmp/libkvmi
- ./bootstrap
- ./configure
- make
- sudo make install
- popd
- rm -rf kvm
- rm -rf /tmp/libkvmi

jobs:
include:
Expand Down
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ libvmi_libvmi_la_CFLAGS= -fvisibility=hidden $(GLIB_CFLAGS) $(JSONC_CFLAGS)
libvmi_libvmi_la_LDFLAGS= $(GLIB_LIBS) $(JSONC_LIBS) -no-undefined
libvmi_libvmi_la_LDFLAGS+= -version-info $(VERSION)

if WITH_KVM
libvmi_libvmi_la_CFLAGS += $(LIBKVMI_CFLAGS)
endif

if ENABLE_CONFIGFILE
config_h_sources = libvmi/config/config_parser.h
config_c_sources = libvmi/config/grammar.y libvmi/config/lexicon.l
Expand Down
30 changes: 0 additions & 30 deletions cmake/modules/FindLibkvmi.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ PKG_CHECK_MODULES([JSONC], [json-c], [have_jsonc='yes'], [have_jsonc='no'])
AC_DEFINE([ENABLE_KVM_LEGACY], [1],
[Define to 1 to enable legacy KVM driver support.])
[else]
AC_CHECK_HEADER([kvmi/libkvmi.h], [],
PKG_CHECK_MODULES([LIBKVMI], [libkvmi], [],
[AC_MSG_ERROR([No libkvmi headers found. Install the library or
enable the legacy KVM driver with --enable-kvm-legacy])])
[fi]
Expand Down
5 changes: 4 additions & 1 deletion libvmi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,13 @@ if (ENABLE_KVM)
endif ()
else ()
# KVM driver based on KVMi series, API is exposed via libkvmi
find_package(Libkvmi)
pkg_search_module(Libkvmi libkvmi)
if (NOT Libkvmi_FOUND)
set(ENABLE_KVM OFF CACHE BOOL "Build KVM driver" FORCE)
message(WARNING "Cannot find libkvmi: disabling KVM driver")
else ()
message("Found libkvmi headers: ${Libkvmi_INCLUDE_DIRS}")
target_include_directories(vmi_shared PRIVATE ${Libkvmi_INCLUDE_DIRS})
endif ()
endif ()
target_include_directories(vmi_shared PRIVATE ${JSON-C_INCLUDE_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion libvmi/driver/kvm/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <glib/gstdio.h>
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
#include <kvmi/libkvmi.h>
#include <libkvmi.h>

#include "private.h"
#include "msr-index.h"
Expand Down
9 changes: 5 additions & 4 deletions libvmi/driver/kvm/kvm_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@
#ifndef KVM_PRIVATE_H
#define KVM_PRIVATE_H

// config.h is parsed in private.h (ENABLE_KVM_LEGACY)
#include "private.h"

#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
#ifndef ENABLE_KVM_LEGACY
# include <kvmi/libkvmi.h>
# include <libkvmi.h>
# include "libkvmi_wrapper.h"
#endif


#include "private.h"
#include "libvirt_wrapper.h"
#include "libkvmi_wrapper.h"

typedef struct kvm_instance {
virConnectPtr conn;
Expand Down
4 changes: 3 additions & 1 deletion libvmi/driver/kvm/libkvmi_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
#define LIBKVMI_WRAPPER_H

#include <stdint.h>
#include <kvmi/libkvmi.h>
#include <libkvmi.h>

#include "private.h"

struct kvm_instance;

// wrapper struct
typedef struct {

Expand Down
2 changes: 1 addition & 1 deletion libvmi/driver/kvm/libvirt_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* along with LibVMI. If not, see <http://www.gnu.org/licenses/>.
*/

#include <config.h>
#include <libvirt/libvirt.h>
#include <dlfcn.h>

#include "libvmi.h"
#include "private.h"

struct kvm_instance;

Expand Down