Skip to content
/ webvirtd Public

System libvirt control daemon for the webvirt project

License

Notifications You must be signed in to change notification settings

kevr/webvirtd

Repository files navigation

webvirtd

lint build tests license

System libvirt control daemon for the webvirt project

Configuration

To compile webvirtd, it must first be configured using meson:

## Release build
$ meson setup --buildtype release -Dtests=false builddir

## Development build
$ meson setup --buildtype debug -Db_coverage=true builddir

## Development build without binary
$ meson setup --buildtype debug -Db_coverage=true -Dbinary=false builddir

Compilation

After configuration, users can build the project using ninja or samu:

$ (ninja|samu) -C builddir

Installation

To install the project, run the install target after compilation:

$ meson -C builddir install --skip-subprojects

Note: --skip-subprojects is recommended here, as subprojects are built statically and do not need to be housed within the root filesystem. In addition, these subproject installations can conflict with Linux distribution packages which install the same projects.

What the meson install target does:

  1. Installs systemd services to {prefix}/lib/systemd/system
  2. Creates the webvirt user utilized by the systemd service

Before continuing, you should configure libvirt user access.

Running

The webvirtd binary contacts libvirtd using the qemu+ssh protocol. Therefore, libvirtd access depends on authentication provided by SSH.

See libvirt user access for details on configuring libvirtd access control.

Development

In development, webvirtd can be run directly by any user:

$ ./builddir/src/webvirtd --help

Users should ensure that --socket used with webvirtd and WEBVIRTD_SOCKET used with webvirt_api are matched, and that webvirt_api has permission to converse with webvirtd's socket.

Production

In production, webvirtd should be run using the systemd services provided by install:

## Enable at boot and start the service
# systemctl enable --now webvirtd.service

The unix socket deployed by webvirtd.service resides at /var/run/webvirtd/webvirtd.sock. To access the unix socket, the accessing user must be in the webvirt group:

# gpasswd -a some_user webvirt
# sudo -u some_user curl \
    --unix-socket /var/run/webvirtd/webvirtd.sock \
    http://localhost/users/test/domains/

API Documentation

Read the API documentation at SwaggerHub: https://app.swaggerhub.com/apis-docs/kevr/webvirtd

Licensing

This project operates under the Apache 2.0 LICENSE along with an Apache 2.0 NOTICE which contains attributions of work.

About

System libvirt control daemon for the webvirt project

Resources

License

Stars

Watchers

Forks

Packages

No packages published