~satchmo/libvmm

4f6af4b1452f0c082d59078b34c344ae9b3c1bf3 — Jason Phan 2 months ago 82fc204
virtio: Setup
M tests/meson.build => tests/meson.build +1 -0
@@ 1,4 1,5 @@
test_dep = dependency('catch2')

subdir('kvm')
subdir('virtio')
subdir('types')

A tests/virtio/device.cpp => tests/virtio/device.cpp +5 -0
@@ 0,0 1,5 @@
#define CATCH_CONFIG_MAIN

#include <catch2/catch.hpp>

#include "vmm/virtio/virtio.hpp"

A tests/virtio/meson.build => tests/virtio/meson.build +6 -0
@@ 0,0 1,6 @@
virtio_test_suite = {
  'Virtio device' : files('device.cpp'),
  'Virtio queue' : files('queue.cpp'),
}

test_suites += {'virtio': virtio_test_suite}

A tests/virtio/queue.cpp => tests/virtio/queue.cpp +5 -0
@@ 0,0 1,5 @@
#define CATCH_CONFIG_MAIN

#include <catch2/catch.hpp>

#include "vmm/virtio/virtio.hpp"

M vmm/meson.build => vmm/meson.build +6 -1
@@ 1,4 1,9 @@
public_headers = include_directories('types', 'kvm')
public_headers = include_directories(
  'types',
  'kvm',
  'virtio'
)

subdir('types')
subdir('kvm')
subdir('virtio')

A vmm/virtio/detail/device.hpp => vmm/virtio/detail/device.hpp +13 -0
@@ 0,0 1,13 @@
//
// device.hpp - Virtio device
//

#pragma once

namespace vmm::virtio::detail {

class VirtDevice
{
};

}  // namespace vmm::virtio::detail

A vmm/virtio/detail/meson.build => vmm/virtio/detail/meson.build +6 -0
@@ 0,0 1,6 @@
virtio_internal_headers = files(
  'device.hpp',
  'queue.hpp',
)

install_headers(virtio_internal_headers, subdir: 'vmm/virtio/detail')

A vmm/virtio/detail/queue.hpp => vmm/virtio/detail/queue.hpp +13 -0
@@ 0,0 1,13 @@
//
// queue.hpp - Virtio queue
//

#pragma once

namespace vmm::virtio::detail {

class VirtQueue
{
};

}  // namespace vmm::virtio::detail

A vmm/virtio/meson.build => vmm/virtio/meson.build +7 -0
@@ 0,0 1,7 @@
subdir('detail')

virtio_headers = files(
    'virtio.hpp',
)

install_headers(virtio_headers, subdir: 'vmm')

A vmm/virtio/virtio.hpp => vmm/virtio/virtio.hpp +15 -0
@@ 0,0 1,15 @@
//
// virtio.hpp - Public Virtio header
//

#pragma once

#include "vmm/virtio/detail/device.hpp"
#include "vmm/virtio/detail/queue.hpp"

namespace vmm::virtio {

using VirtDevice = vmm::virtio::detail::VirtDevice;
using VirtQueue = vmm::virtio::detail::VirtQueue;

}  // namespace vmm::virtio