PULL REQUESTS ARE IGNORED. Read-only mirror of https://libvirt.org/git/?p=libvirt-go.git
Clone or download
berrange Add back compat constants for iothreads
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Latest commit fcf300c Nov 22, 2018
Permalink
Type Name Latest commit message Commit time
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
.gitpublish git: add config file telling git-publish how to send patches Apr 24, 2018
.travis.yml Update travis conf for sasl config Aug 30, 2017
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 Split QEMU code into a separate file for conditional build Apr 25, 2017
api_test.go error: remove GetLastError() function Jul 23, 2018
callbacks.go Use "Wrapper" or "Helper" as suffix for C functions Jul 23, 2018
callbacks_wrapper.go make the XXX_wrapper.h header files self-contained Jul 23, 2018
callbacks_wrapper.h Use "Wrapper" or "Helper" as suffix for C functions Jul 23, 2018
common_test.go Only register event loop once in test suite Jun 1, 2018
connect.go connect: add missing references on domain object in stats records Jul 23, 2018
connect_compat.h connect: move wrapper functions out of compat header Jul 23, 2018
connect_test.go Avoid clashing path with default storage pool Sep 4, 2018
connect_wrapper.go connect: use 'unsigned int' instead of 'uint' Jul 25, 2018
connect_wrapper.h connect: use 'unsigned int' instead of 'uint' Jul 25, 2018
doc.go Expose the 'Ref' methods on objects Feb 9, 2017
domain.go Add virDomainSetIOThreadParams binding Nov 21, 2018
domain_compat.h Add back compat constants for iothreads Nov 21, 2018
domain_events.go events: fix error reporting thread safety Jul 23, 2018
domain_events_test.go Only register event loop once in test suite Jun 1, 2018
domain_events_wrapper.go events: fix error reporting thread safety Jul 23, 2018
domain_events_wrapper.h events: fix error reporting thread safety Jul 23, 2018
domain_snapshot.go domain snapshot: fix error reporting thread safety Jul 23, 2018
domain_snapshot_wrapper.go domain snapshot: fix error reporting thread safety Jul 23, 2018
domain_snapshot_wrapper.h domain snapshot: fix error reporting thread safety Jul 23, 2018
domain_test.go Fix various printf format mistakes Jan 17, 2018
domain_wrapper.go Add virDomainSetIOThreadParams binding Nov 21, 2018
domain_wrapper.h Add virDomainSetIOThreadParams binding Nov 21, 2018
error.go error: make GetNotImplementedError private Jul 23, 2018
error_compat.h Add nwfilter binding APIs Jun 26, 2018
events.go events: fix error reporting thread safety Jul 23, 2018
events_wrapper.go events: fix error reporting thread safety Jul 23, 2018
events_wrapper.h events: fix error reporting thread safety Jul 23, 2018
integration_test.go Only register event loop once in test suite Jun 1, 2018
interface.go interface: fix error reporting thread safety Jul 23, 2018
interface_test.go Rename CloseConnection to simply Close Dec 19, 2016
interface_wrapper.go interface: fix error reporting thread safety Jul 23, 2018
interface_wrapper.h interface: fix error reporting thread safety Jul 23, 2018
libvirtd.conf Add tests for SASL user/password authentication Aug 19, 2016
libvirtd.sasl Switch sasl to digest-md5 since Ubuntu lacks scram-sha-1 Aug 30, 2017
lxc.go error: make GetNotImplementedError private Jul 23, 2018
lxc_wrapper.go lxc: fix error reporting thread safety Jul 23, 2018
lxc_wrapper.h lxc: fix error reporting thread safety Jul 23, 2018
network.go error: make GetNotImplementedError private Jul 23, 2018
network_compat.h network: move wrapper functions out of compat header Jul 23, 2018
network_events.go error: make GetNotImplementedError private Jul 23, 2018
network_events_test.go Only register event loop once in test suite Jun 1, 2018
network_events_wrapper.go events: fix error reporting thread safety Jul 23, 2018
network_events_wrapper.h events: fix error reporting thread safety Jul 23, 2018
network_test.go Rename CloseConnection to simply Close Dec 19, 2016
network_wrapper.go network: fix error reporting thread safety Jul 23, 2018
network_wrapper.h network: fix error reporting thread safety Jul 23, 2018
node_device.go node device: fix error reporting thread safety Jul 23, 2018
node_device_compat.h node device: move wrapper functions out of compat header Jul 23, 2018
node_device_events.go error: make GetNotImplementedError private Jul 23, 2018
node_device_events_test.go Only register event loop once in test suite Jun 1, 2018
node_device_events_wrapper.go events: fix error reporting thread safety Jul 23, 2018
node_device_events_wrapper.h events: fix error reporting thread safety Jul 23, 2018
node_device_wrapper.go node device: fix error reporting thread safety Jul 23, 2018
node_device_wrapper.h node device: fix error reporting thread safety Jul 23, 2018
nwfilter.go nwfilter: fix error reporting thread safety Jul 23, 2018
nwfilter_binding.go error: make GetNotImplementedError private Jul 23, 2018
nwfilter_binding_compat.h nwfilter binding: move wrapper functions out of compat header Jul 23, 2018
nwfilter_binding_wrapper.go nwfilter binding: fix error reporting thread safety Jul 23, 2018
nwfilter_binding_wrapper.h nwfilter binding: fix error reporting thread safety Jul 23, 2018
nwfilter_wrapper.go nwfilter: fix error reporting thread safety Jul 23, 2018
nwfilter_wrapper.h nwfilter: fix error reporting thread safety Jul 23, 2018
qemu.go error: make GetNotImplementedError private Jul 23, 2018
qemu_compat.h qemu: move wrapper functions out of compat header Jul 23, 2018
qemu_wrapper.go qemu: fix error reporting thread safety Jul 23, 2018
qemu_wrapper.h qemu: fix error reporting thread safety Jul 23, 2018
secret.go secret: fix error reporting thread safety Jul 23, 2018
secret_compat.h secret: move wrapper functions out of compat header Jul 23, 2018
secret_events.go error: make GetNotImplementedError private Jul 23, 2018
secret_events_wrapper.go events: fix error reporting thread safety Jul 23, 2018
secret_events_wrapper.h events: fix error reporting thread safety Jul 23, 2018
secret_wrapper.go secret: fix error reporting thread safety Jul 23, 2018
secret_wrapper.h secret: fix error reporting thread safety Jul 23, 2018
storage_pool.go storage pool: fix error reporting thread safety Jul 23, 2018
storage_pool_compat.h storage pool: move wrapper functions out of compat header Jul 23, 2018
storage_pool_events.go error: make GetNotImplementedError private Jul 23, 2018
storage_pool_events_test.go Only register event loop once in test suite Jun 1, 2018
storage_pool_events_wrapper.go events: fix error reporting thread safety Jul 23, 2018
storage_pool_events_wrapper.h events: fix error reporting thread safety Jul 23, 2018
storage_pool_test.go Avoid clashing path with default storage pool Sep 4, 2018
storage_pool_wrapper.go storage pool: fix error reporting thread safety Jul 23, 2018
storage_pool_wrapper.h storage pool: fix error reporting thread safety Jul 23, 2018
storage_volume.go error: make GetNotImplementedError private Jul 23, 2018
storage_volume_compat.h storage volume: move wrapper functions out of compat header Jul 23, 2018
storage_volume_test.go Rename CloseConnection to simply Close Dec 19, 2016
storage_volume_wrapper.go storage vol: fix error reporting thread safety Jul 23, 2018
storage_volume_wrapper.h storage vol: fix error reporting thread safety Jul 23, 2018
stream.go error: make GetNotImplementedError private Jul 23, 2018
stream_compat.h stream: move wrapper functions out of compat header Jul 23, 2018
stream_wrapper.go stream: fix error reporting thread safety Jul 23, 2018
stream_wrapper.h stream: fix error reporting thread safety Jul 23, 2018
typedparams.go Fix encoding of typed parameters which are not set Mar 8, 2017
typedparams_test.go Fix encoding of typed parameters which are not set Mar 8, 2017

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.

By default the binding will support APIs in libvirt.so, libvirt-qemu.so and libvirt-lxc.so. Coverage for the latter two libraries can be dropped from the build using build tags 'without_qemu' or 'without_lxc' respectively.

Development status

The Go API is considered to be production ready and aims to be kept stable across future versions. Note, however, that the following changes may apply to future versions:

  • Existing structs can be augmented with new fields, but no existing fields will be changed / removed. New fields are needed when libvirt defines new typed parameters for various methods

  • Any method with an 'flags uint32' parameter will have its parameter type changed to a specific typedef, if & when the libvirt API defines constants for the flags. To avoid breakage, always pass a literal '0' to any 'flags uint32' parameter, since this will auto-cast to any future typedef that is introduced.

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.