Go C Ruby C++
Latest commit 9730c83 Jan 16, 2017 @berrange berrange Revert "Add support for perf cache_l1d event"
This reverts commit 73c68e6.

The corresponding libvirt public API was reverted
Permalink
Failed to load latest commit information.
vagrant Vagrantfile: make sure qemu is installed, add SMP Oct 14, 2016
.gitignore Ignore editor temp / save files Dec 9, 2016
.travis.yml Update travis config to reflect current codebase setup Dec 13, 2016
FAQ.md faq: Add a FAQ template and encourage more entries Oct 19, 2016
LICENSE Add licence, add tests for api so far Aug 18, 2013
README.md Tweak formatting of links to git repos to use list Dec 16, 2016
api_test.go Add binding for secret event APIs Jan 9, 2017
callbacks.go Use /* ... */ instead of // for license comments Dec 14, 2016
callbacks_cfuncs.go Use /* ... */ instead of // for license comments Dec 14, 2016
callbacks_cfuncs.h Use /* ... */ instead of // for license comments Dec 14, 2016
connect.go Revert "Add support for perf cache_l1d event" Jan 16, 2017
connect_cfuncs.go Use /* ... */ instead of // for license comments Dec 14, 2016
connect_cfuncs.h Use /* ... */ instead of // for license comments Dec 14, 2016
connect_compat.go Use /* ... */ instead of // for license comments Dec 14, 2016
connect_compat.h Use /* ... */ instead of // for license comments Dec 14, 2016
connect_test.go Rename CloseConnection to simply Close Dec 19, 2016
doc.go Revert "Fix package name in docs s/libvirt/libvirt-go/" Jan 5, 2017
domain.go Revert "Add support for perf cache_l1d event" Jan 16, 2017
domain_compat.go Use /* ... */ instead of // for license comments Dec 14, 2016
domain_compat.h Revert "Add support for perf cache_l1d event" Jan 16, 2017
domain_events.go Add support for domain metadata change event Jan 9, 2017
domain_events_cfuncs.go Add support for domain metadata change event Jan 9, 2017
domain_events_cfuncs.h Add support for domain metadata change event Jan 9, 2017
domain_events_test.go Rename CloseConnection to simply Close Dec 19, 2016
domain_snapshot.go Use appropriate flags enum type in all methods Dec 14, 2016
domain_test.go Rename CloseConnection to simply Close Dec 19, 2016
error.go Use /* ... */ instead of // for license comments Dec 14, 2016
error_compat.h Use /* ... */ instead of // for license comments Dec 14, 2016
error_test.go Use /* ... */ instead of // for license comments Dec 14, 2016
events.go Add support for registering an event loop implementation Dec 21, 2016
events_cfuncs.go Add support for registering an event loop implementation Dec 21, 2016
events_cfuncs.h Add support for registering an event loop implementation Dec 21, 2016
integration_test.go Fix connect callback to take *Connect instead of Connect Dec 20, 2016
interface.go Use appropriate flags enum type in all methods Dec 14, 2016
interface_test.go Rename CloseConnection to simply Close Dec 19, 2016
libvirtd.conf Add tests for SASL user/password authentication Aug 19, 2016
network.go Use appropriate flags enum type in all methods Dec 14, 2016
network_compat.go Use /* ... */ instead of // for license comments Dec 14, 2016
network_compat.h Use /* ... */ instead of // for license comments Dec 14, 2016
network_events.go Use /* ... */ instead of // for license comments Dec 14, 2016
network_events_cfuncs.go Use /* ... */ instead of // for license comments Dec 14, 2016
network_events_cfuncs.h Use /* ... */ instead of // for license comments Dec 14, 2016
network_events_test.go Rename CloseConnection to simply Close Dec 19, 2016
network_test.go Rename CloseConnection to simply Close Dec 19, 2016
node_device.go Use /* ... */ instead of // for license comments Dec 14, 2016
node_device_compat.go Use /* ... */ instead of // for license comments Dec 14, 2016
node_device_compat.h Use /* ... */ instead of // for license comments Dec 14, 2016
node_device_events.go Use /* ... */ instead of // for license comments Dec 14, 2016
node_device_events_cfuncs.go Use /* ... */ instead of // for license comments Dec 14, 2016
node_device_events_cfuncs.h Use /* ... */ instead of // for license comments Dec 14, 2016
node_device_events_test.go Rename CloseConnection to simply Close Dec 19, 2016
nwfilter.go Use /* ... */ instead of // for license comments Dec 14, 2016
secret.go Add binding for secret event APIs Jan 9, 2017
secret_compat.go Fix check version for secret events API Jan 10, 2017
secret_compat.h Add binding for secret event APIs Jan 9, 2017
secret_events.go Add binding for secret event APIs Jan 9, 2017
secret_events_cfuncs.go Add binding for secret event APIs Jan 9, 2017
secret_events_cfuncs.h Add binding for secret event APIs Jan 9, 2017
storage_pool.go Use appropriate flags enum type in all methods Dec 14, 2016
storage_pool_compat.go Use /* ... */ instead of // for license comments Dec 14, 2016
storage_pool_compat.h Use /* ... */ instead of // for license comments Dec 14, 2016
storage_pool_events.go Add missing binding for storage pool refresh event Jan 9, 2017
storage_pool_events_cfuncs.go Add missing binding for storage pool refresh event Jan 9, 2017
storage_pool_events_cfuncs.h Add missing binding for storage pool refresh event Jan 9, 2017
storage_pool_events_test.go Rename CloseConnection to simply Close Dec 19, 2016
storage_pool_test.go Rename CloseConnection to simply Close Dec 19, 2016
storage_volume.go Add support for virStorageVolGetInfoFlags & associated constants Dec 21, 2016
storage_volume_compat.go Add support for virStorageVolGetInfoFlags & associated constants Dec 21, 2016
storage_volume_compat.h Add support for virStorageVolGetInfoFlags & associated constants Dec 21, 2016
storage_volume_test.go Rename CloseConnection to simply Close Dec 19, 2016
stream.go Add stream event callback support Dec 20, 2016
stream_cfuncs.go Add stream event callback support Dec 20, 2016
stream_cfuncs.h Add stream event callback support Dec 20, 2016
typedparams.go Ensure we set parameter type correctly Dec 20, 2016

README.md

libvirt-go Build Status GoDoc

Go bindings for libvirt.

Make sure to have libvirt-dev package (or the development files otherwise somewhere in your include path)

Version Support

The libvirt go package provides API coverage for libvirt versions from 1.2.0 onwards, through conditional compilation of newer APIs.

Documentation

Contributing

The libvirt project aims to add support for new APIs to libvirt-go as soon as they are added to the main libvirt C library. If you are submitting changes to the libvirt C library API, please submit a libvirt-go change at the same time.

Bug fixes and other improvements to the libvirt-go library are welcome at any time. The preferred submission method is to use git send-email to submit patches to the libvir-list@redhat.com mailing list. eg. to send a single patch

git send-email --to libvir-list@redhat.com --subject-prefix "PATCH go" \ --smtp-server=$HOSTNAME -1

Or to send all patches on the current branch, against master

git send-email --to libvir-list@redhat.com --subject-prefix "PATCH go" \ --smtp-server=$HOSTNAME --no-chain-reply-to --cover-letter --annotate \ master..

Note the master GIT repository is at

The following automatic read-only mirrors are available as a convenience to allow contributors to "fork" the repository:

While you can send pull-requests to these mirrors, they will be re-submitted via emai to the mailing list for review before being merged, unless they are trivial/obvious bug fixes.

Testing

The core API unit tests are all written to use the built-in test driver (test:///default), so they have no interaction with the host OS environment.

Coverage of libvirt C library APIs / constants is verified using automated tests. These can be run by passing the 'api' build tag. eg go test -tags api

For areas where the test driver lacks functionality, it is possible to use the QEMU or LXC drivers to exercise code. Such tests must be part of the 'integration_test.go' file though, which is only run when passing the 'integration' build tag. eg go test -tags integration

In order to run the unit tests, libvirtd should be configured to allow your user account read-write access with no passwords. This can be easily done using polkit config files

# cat > /etc/polkit-1/localauthority/50-local.d/50-libvirt.pkla  <<EOF
[Passwordless libvirt access]
Identity=unix-group:berrange
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes
EOF

(Replace 'berrange' with your UNIX user name).

One of the integration tests also requires that libvirtd is listening for TCP connections on localhost, with sasl auth This can be setup by editing /etc/libvirt/libvirtd.conf to set

  listen_tls=0
  listen_tcp=1
  auth_tcp=sasl
  listen_addr="127.0.0.1"

and then start libvirtd with the --listen flag (this can be set in /etc/sysconfig/libvirtd to make it persistent).

Then create a sasl user

   saslpasswd2 -a libvirt user

and enter "pass" as the password.

Alternatively a Vagrantfile, requiring use of virtualbox, is included to run the integration tests:

  • cd ./vagrant
  • vagrant up to provision the virtual machine
  • vagrant ssh to login to the virtual machine

Once inside, sudo su - and go test -tags integration libvirt.