Code Monkey home page Code Monkey logo

libbdvmi's Introduction

Libbdvmi

(c) 2015-2021 Bitdefender SRL

Usage

Please use Xen 4.6 or newer. To test the library, issue:

$ ./bootstrap
$ ./configure
$ make

This will build the library and the test under examples/.

To build the library with KVM support (if libkvmi is installed), issue:

$ ./configure --enable-kvmi

To see the test in action, run (as root):

# ./hookguest

in the examples/ subdirectory, then simply start a Xen domain up.

The application can be shut down at any time via ^C.

libbdvmi's People

Contributors

adlazar avatar mdontu-bd avatar ppircalabu-bd avatar razvan-cojocaru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libbdvmi's Issues

Can not make under xen 4.11

We use a 4.18 kernel with xen 4.11.
After bootstrap and configure completing successfully, the make call creates the following error:

bdvmixeneventmanager.cpp: In member function ‘virtual bool bdvmi::XenEventManager::enableMsrEvents(unsigned int, bool&)’:
bdvmixeneventmanager.cpp:187:57: error: too few arguments to function ‘int xc_monitor_mov_to_msr(xc_interface*, uint32_t, uint32_t, bool, bool)’
return ( xc_monitor_mov_to_msr( xci_, domain_, msr, 1 ) == 0 );
^
In file included from ../include/bdvmi/xencache.h:23,
from ../include/bdvmi/xendriver.h:27,
from bdvmixeneventmanager.cpp:17:
/usr/include/xenctrl.h:2043:5: note: declared here
int xc_monitor_mov_to_msr(xc_interface xch, uint32_t domain_id, uint32_t msr,
^~~~~~~~~~~~~~~~~~~~~
bdvmixeneventmanager.cpp: In member function ‘virtual bool bdvmi::XenEventManager::disableMsrEvents(unsigned int, bool&)’:
bdvmixeneventmanager.cpp:199:57: error: too few arguments to function ‘int xc_monitor_mov_to_msr(xc_interface
, uint32_t, uint32_t, bool, bool)’
return ( xc_monitor_mov_to_msr( xci_, domain_, msr, 0 ) == 0 );
^
In file included from ../include/bdvmi/xencache.h:23,
from ../include/bdvmi/xendriver.h:27,
from bdvmixeneventmanager.cpp:17:
/usr/include/xenctrl.h:2043:5: note: declared here
int xc_monitor_mov_to_msr(xc_interface *xch, uint32_t domain_id, uint32_t msr,
^~~~~~~~~~~~~~~~~~~~~
bdvmixeneventmanager.cpp: In member function ‘virtual void bdvmi::XenEventManager::waitForEvents()’:
bdvmixeneventmanager.cpp:566:38: error: ‘struct vm_event_mov_to_msr’ has no member named ‘value’; did you mean ‘new_value’?
req.u.mov_to_msr.value, action );
^~~~~
new_value
bdvmixeneventmanager.cpp:572:26: error: ‘struct vm_event_mov_to_msr’ has no member named ‘value’; did you mean ‘new_value’?
req.u.mov_to_msr.value;
^~~~~
new_value

g++: error: unrecognized command line option '-std=gnu++14'

# make
/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I../include   -I/include  -W -Wall -std=gnu++14 -DXC_WANT_COMPAT_MAP_FOREIGN_API -DXC_WANT_COMPAT_EVTCHN_API -DXC_WANT_COMPAT_DEVICEMODEL_API -MT backendfactory.lo -MD -MP -MF .deps/backendfactory.Tpo -c -o backendfactory.lo backendfactory.cpp

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/include -W -Wall -std=gnu++14 -DXC_WANT_COMPAT_MAP_FOREIGN_API -DXC_WANT_COMPAT_EVTCHN_API -DXC_WANT_COMPAT_DEVICEMODEL_API -MT backendfactory.lo -MD -MP -MF .deps/backendfactory.Tpo -c backendfactory.cpp 
g++: error: unrecognized command line option '-std=gnu++14'

configure state does not detect gnu++14 compatibility.

Problem building libbdvmi.

I am setting up the guest Ubuntu-22.04. I am trying to build libbdvmi and this is the error I am getting.

make  all-recursive
make[1]: Entering directory '/home/hvmi/gitrepos/libbdvmi/build'
Making all in src
make[2]: Entering directory '/home/hvmi/gitrepos/libbdvmi/build/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/hvmi/gitrepos/libbdvmi/build/src'
Making all in include
make[2]: Entering directory '/home/hvmi/gitrepos/libbdvmi/build/include'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/hvmi/gitrepos/libbdvmi/build/include'
Making all in examples
make[2]: Entering directory '/home/hvmi/gitrepos/libbdvmi/build/examples'
/bin/bash ../libtool  --tag=CXX   --mode=link g++ -std=gnu++14  -I/include  -W -Wall -DXC_WANT_COMPAT_MAP_FOREIGN_API -DXC_WANT_COMPAT_EVTCHN_API -DXC_WANT_COMPAT_DEVICEMODEL_API -O2  -L/lib -Wl,-rpath,/lib  -o hookguest hookguest.o ../src/libbdvmi.la -ldl -lxenstore -lxenctrl 
libtool: link: g++ -std=gnu++14 -I/include -W -Wall -DXC_WANT_COMPAT_MAP_FOREIGN_API -DXC_WANT_COMPAT_EVTCHN_API -DXC_WANT_COMPAT_DEVICEMODEL_API -O2 -Wl,-rpath -Wl,/lib -o .libs/hookguest hookguest.o  -L/lib ../src/.libs/libbdvmi.so -ldl -lxenstore -lxenctrl -pthread
/usr/bin/ld: ../src/.libs/libbdvmi.so: undefined reference to `kvmi_set_ept_page_conv'
/usr/bin/ld: ../src/.libs/libbdvmi.so: undefined reference to `kvmi_get_ept_page_conv'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:397: hookguest] Error 1
make[2]: Leaving directory '/home/hvmi/gitrepos/libbdvmi/build/examples'
make[1]: *** [Makefile:468: all-recursive] Error 1
make[1]: Leaving directory '/home/hvmi/gitrepos/libbdvmi/build'
make: *** [Makefile:377: all] Error 2

I don't know what to do. Can you please help me resolve this issue? I didn't find any help online about this. I have checked build/src/.lib/ folder for libbdvmi.so and I found it. By the way these are the steps I followed(Same as mentioned int he documentation).

sudo apt install libboost-all-dev libxen-dev pkg-config uuid-dev
git clone https://github.com/bitdefender/libbdvmi.git
cd libbdvmi
./bootstrap
mkdir build
cd build
../configure --prefix=/usr/local --enable-kvmi --enable-optimize
make
sudo make install

KVM build error

I am attempting to deploy HVMI using the installation instructions provided of which a step is to install the libbdkvmi library. When running make it errors out with the following error..

./../src/kvmdriver.cpp: In member function ‘virtual uint32_t bdvmi::KvmDriver::startTime()’:
../../src/kvmdriver.cpp:1256:32: error: ‘secs’ was not declared in this scope
 1256 |  return static_cast<uint32_t>( secs );

Upon further inspection, it appears although a value is passed on function call, there is no definition that the function takes any parameters.

Definition :

uint32_t KvmDriver::startTime()
{
        return static_cast<uint32_t>( secs );
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.