Skip to content

API test framework

Avi Kivity kvm 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest14 patches 1 replyApplied
  2. v14 patches 125 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/14Makefile: add support for C++Makefile+3 -10 replies
2/14Improve autodepend includesMakefile config-x86-common.mak+1 -20 replies
3/14Add exception class for kernel errors (errno)api/exception.cc api/exception.hh+36 -00 replies
4/14Add try_main() for running a program under an exception handlerapi/exception.cc api/exception.hh+16 -00 replies
5/14Introduce a C++ wrapper for the kvm APIsapi/kvmxx.cc api/kvmxx.hh+268 -00 replies
6/14Add support for calling a function in guest modeapi/identity.cc api/identity.hh config-x86-common.mak+105 -00 replies
7/14Add sample test using the api test harnessapi/api-sample.cc config-x86-common.mak+36 -00 replies
8/14api: add support for KVM_SET_USER_MEMORY_REGION flags fieldapi/kvmxx.cc api/kvmxx.hh+5 -30 replies
9/14api: support KVM_GET_DIRTY_LOG ioctlapi/kvmxx.cc api/kvmxx.hh+9 -00 replies
10/14api: add memory map managementapi/memmap.cc api/memmap.hh+119 -00 replies
11/14Build tests with debug informationMakefile+1 -10 replies
12/14api: Add support for creating an identity map with a holeapi/api-sample.cc api/identity.cc api/identity.hh +1 more+40 -40 replies
13/14Introduce libapi.a to avoid long Makefile recipesconfig-x86-common.mak+6 -40 replies
14/14Add dirty log testapi/dirty-log.cc config-x86-common.mak+83 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH kvm-unit-tests v2 00/14] API test framework

This patchset adds an API test framework. Rather than driving kvm from qemu, we now have a way of calling the kvm API directly and observing the results. We can switch to guest mode and back at will and see any micro effects such as the result of executing particular instructions.

A first test is added, for commit edde99ce0 ("KVM: Write protect memory after slot swap"). This would be pretty hard to test for using the current qemu-driven tests, but detects 5 million failures in about two minutes on my machine.

As an experiment, the framework is coded in C++.

Avi Kivity (14):
Makefile: add support for C++
Improve autodepend includes

    v2: new
  Add exception class for kernel errors (errno)
    v2: new
  Add try_main() for running a program under an exception handler
    v2: new
  Introduce a C++ wrapper for the kvm APIs
    v2: throw std::exception exceptions, not ints, for libc failures
        better msr list management
  Add support for calling a function in guest mode
    v2: use tr1::function instead of boost::function
  Add sample test using the api test harness
  api: add support for KVM_SET_USER_MEMORY_REGION flags field
    v2: new
  api: support KVM_GET_DIRTY_LOG ioctl
    v2: new
  api: add memory map management
    v2: new
  Build tests with debug information
    v2: new
  api: Add support for creating an identity map with a hole
    v2: new
  Introduce libapi.a to avoid long Makefile recipes
    v2: new
  Add dirty log test
    v2: new
 Makefile              |    8 +-
 api/api-sample.cc     |   30 ++++++++
 api/dirty-log.cc      |   78 ++++++++++++++++++++
 api/exception.cc      |   33 ++++++++
 api/exception.hh      |   19 +++++
 api/identity.cc       |   95 ++++++++++++++++++++++++
 api/identity.hh       |   43 +++++++++++
 api/kvmxx.cc          |  194 +++++++++++++++++++++++++++++++++++++++++++++++++
 api/kvmxx.hh          |   85 +++++++++++++++++++++
 api/memmap.cc         |   76 +++++++++++++++++++
 api/memmap.hh         |   43 +++++++++++
 config-x86-common.mak |   15 ++++-
 12 files changed, 715 insertions(+), 4 deletions(-)
 create mode 100644 api/api-sample.cc
 create mode 100644 api/dirty-log.cc
 create mode 100644 api/exception.cc
 create mode 100644 api/exception.hh
 create mode 100644 api/identity.cc
 create mode 100644 api/identity.hh
 create mode 100644 api/kvmxx.cc
 create mode 100644 api/kvmxx.hh
 create mode 100644 api/memmap.cc
 create mode 100644 api/memmap.hh