libvirt-go.git
42 hours agoRevert "Add support for perf cache_l1d event" master
Daniel P. Berrange [Mon, 16 Jan 2017 17:26:24 +0000]
Revert "Add support for perf cache_l1d event"

This reverts commit 73c68e67965b65c920e93535bdef7020d79baf6c.

The corresponding libvirt public API was reverted

8 days agoAdd support for perf cache_l1d event
Daniel P. Berrange [Tue, 10 Jan 2017 10:47:37 +0000]
Add support for perf cache_l1d event

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

8 days agoFix check version for secret events API
Daniel P. Berrange [Tue, 10 Jan 2017 10:31:45 +0000]
Fix check version for secret events API

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

8 days agoAdd binding for secret event APIs
Daniel P. Berrange [Mon, 9 Jan 2017 17:46:19 +0000]
Add binding for secret event APIs

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

8 days agoAdd missing binding for storage pool refresh event
Daniel P. Berrange [Mon, 9 Jan 2017 17:45:43 +0000]
Add missing binding for storage pool refresh event

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

8 days agoAdd support for domain metadata change event
Daniel P. Berrange [Mon, 9 Jan 2017 17:27:58 +0000]
Add support for domain metadata change event

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

12 days agoRevert "Fix package name in docs s/libvirt/libvirt-go/"
Daniel P. Berrange [Thu, 5 Jan 2017 12:46:39 +0000]
Revert "Fix package name in docs s/libvirt/libvirt-go/"

This reverts commit a5bd97a14c35a49efe3690d0a5d7751626ddc5bc.

If they differ, the package name should indeed be the Go package
name, not the git repo base name.

12 days agoFix package name in docs s/libvirt/libvirt-go/
Daniel P. Berrange [Thu, 5 Jan 2017 12:39:47 +0000]
Fix package name in docs s/libvirt/libvirt-go/

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

2 weeks agoChange SetVcpus/SetVcpusFlags to use uint
Daniel P. Berrange [Tue, 3 Jan 2017 14:51:38 +0000]
Change SetVcpus/SetVcpusFlags to use uint

The underlying C API uses an 'unsigned int', so the Go layer
should use 'uint' not 'uint16', which would artifically limit
the binding.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAdd support for registering an event loop implementation
Daniel P. Berrange [Wed, 21 Dec 2016 11:29:58 +0000]
Add support for registering an event loop implementation

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAdd support for virStorageVolGetInfoFlags & associated constants
Daniel P. Berrange [Wed, 21 Dec 2016 11:29:06 +0000]
Add support for virStorageVolGetInfoFlags & associated constants

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoFix connect callback to take *Connect instead of Connect
Daniel P. Berrange [Tue, 20 Dec 2016 17:37:01 +0000]
Fix connect callback to take *Connect instead of Connect

All methods should take pointers to the main objects

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoEnsure we set parameter type correctly
Daniel P. Berrange [Tue, 20 Dec 2016 14:33:28 +0000]
Ensure we set parameter type correctly

When allocating a new virTypedParameter array we were forgetting
to initialize the parameter type, causing non-deterministic
failures

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoUse a fixed domain name in integration tests
Daniel P. Berrange [Tue, 20 Dec 2016 12:57:18 +0000]
Use a fixed domain name in integration tests

Instead of generating a random domain name based on the time,
use a fixed domain name, and add some logic to cleanup if
previous invokation left the domain running.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoFix leak of defined QEMU guests
Daniel P. Berrange [Tue, 20 Dec 2016 12:46:29 +0000]
Fix leak of defined QEMU guests

Some integration tests forgot to undefine the QEMU guest

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAdd test case to validate BlockCopy function
Daniel P. Berrange [Tue, 20 Dec 2016 12:22:03 +0000]
Add test case to validate BlockCopy function

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoRemove blacklist entries for some funcs we autodetect
Daniel P. Berrange [Tue, 20 Dec 2016 11:40:24 +0000]
Remove blacklist entries for some funcs we autodetect

We now auto-detect usage with a _cgo suffix, so can stop
blacklisting event register funcs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAdd event loop handler callback support
Daniel P. Berrange [Tue, 20 Dec 2016 11:38:37 +0000]
Add event loop handler callback support

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAdd stream event callback support
Daniel P. Berrange [Tue, 20 Dec 2016 09:56:27 +0000]
Add stream event callback support

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoRename CloseConnection to simply Close
Daniel P. Berrange [Mon, 19 Dec 2016 15:47:20 +0000]
Rename CloseConnection to simply Close

The go method names should match the C library names in general.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAdd support for new perf event constants
Daniel P. Berrange [Fri, 16 Dec 2016 12:01:53 +0000]
Add support for new perf event constants

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoTweak formatting of links to git repos to use list
Daniel P. Berrange [Fri, 16 Dec 2016 11:56:42 +0000]
Tweak formatting of links to git repos to use list

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAlso look for _cgo suffix when checking API support
Daniel P. Berrange [Fri, 16 Dec 2016 11:56:11 +0000]
Also look for _cgo suffix when checking API support

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAdd block quotes to README.md example snippets
Daniel P. Berrange [Fri, 16 Dec 2016 11:20:55 +0000]
Add block quotes to README.md example snippets

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoAdd stream sendall/recvall functions
Daniel P. Berrange [Thu, 15 Dec 2016 13:19:35 +0000]
Add stream sendall/recvall functions

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoRename stream Close to Finish to match the C API
Daniel P. Berrange [Thu, 15 Dec 2016 12:05:01 +0000]
Rename stream Close to Finish to match the C API

The Go binding seeks to match C API naming in general.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoRename stream Read/Write to Recv/Send to match the C API
Daniel P. Berrange [Thu, 15 Dec 2016 12:05:01 +0000]
Rename stream Read/Write to Recv/Send to match the C API

The Go binding seeks to match C API naming in general.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoUse appropriate flags enum type in all methods
Daniel P. Berrange [Wed, 14 Dec 2016 15:32:10 +0000]
Use appropriate flags enum type in all methods

A number of methods were still using flags uint32, instead of the
strongly typed enum type.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoA blank line is required after build conditional tags
Daniel P. Berrange [Wed, 14 Dec 2016 14:19:26 +0000]
A blank line is required after build conditional tags

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

4 weeks agoFix some docs typos
Daniel P. Berrange [Wed, 14 Dec 2016 14:11:02 +0000]
Fix some docs typos

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd new constants from 3.0.0 release
Daniel P. Berrange [Wed, 14 Dec 2016 12:10:53 +0000]
Add new constants from 3.0.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd some initial package level docs to introduce the binding
Daniel P. Berrange [Wed, 14 Dec 2016 11:53:36 +0000]
Add some initial package level docs to introduce the binding

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoUse /* ... */ instead of // for license comments
Daniel P. Berrange [Wed, 14 Dec 2016 11:12:33 +0000]
Use /* ... */ instead of // for license comments

Using // for license comments means they end up processed by
godoc, so use /* ... */ instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoFix API test to detect Compat symbols and other misc tweaks
Daniel P. Berrange [Wed, 14 Dec 2016 09:48:41 +0000]
Fix API test to detect Compat symbols and other misc tweaks

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoExpand README.md to describe contribution and testing more
Daniel P. Berrange [Wed, 14 Dec 2016 09:46:46 +0000]
Expand README.md to describe contribution and testing more

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoRename connection_test.go to connect_test.go
Daniel P. Berrange [Wed, 14 Dec 2016 09:34:25 +0000]
Rename connection_test.go to connect_test.go

Make the test name match the base filename.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoStandardize on naming of header file ifdef constants
Daniel P. Berrange [Wed, 14 Dec 2016 09:34:02 +0000]
Standardize on naming of header file ifdef constants

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd license header / copyright boilerplate to every file
Daniel P. Berrange [Wed, 14 Dec 2016 09:30:47 +0000]
Add license header / copyright boilerplate to every file

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd test case to validate API coverage level
Daniel P. Berrange [Mon, 28 Nov 2016 17:09:22 +0000]
Add test case to validate API coverage level

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoExpose VIR_DOMAIN_SEND_KEY_MAX_KEYS constant
Daniel P. Berrange [Tue, 13 Dec 2016 16:17:10 +0000]
Expose VIR_DOMAIN_SEND_KEY_MAX_KEYS constant

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd unsafe.Pointer casts needed for go 1.5 compat
Daniel P. Berrange [Tue, 13 Dec 2016 16:54:41 +0000]
Add unsafe.Pointer casts needed for go 1.5 compat

Go 1.5 was not as good as determining type compatibility
for C API invokation with pointers, so needs to extra
casts.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoBlacklist testing of libvirt versions with close callback refcount bug
Daniel P. Berrange [Tue, 13 Dec 2016 16:45:30 +0000]
Blacklist testing of libvirt versions with close callback refcount bug

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAvoid use of CBytes API
Daniel P. Berrange [Tue, 13 Dec 2016 16:11:06 +0000]
Avoid use of CBytes API

The CBytes API was new in Go 1.7, so avoid it in order to maintain
compat with Go 1.5/1.6

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoMake some tests more robust wrt building with old libvirt
Daniel P. Berrange [Tue, 13 Dec 2016 16:04:22 +0000]
Make some tests more robust wrt building with old libvirt

The GetAllDomainStats and ListAllInterfaceAddresses methods
are only available with certain libvirt versions, so we must
cope with an error being raised.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoMake CPU stats test more robust
Daniel P. Berrange [Tue, 13 Dec 2016 16:03:04 +0000]
Make CPU stats test more robust

Not all environments setup cgroups, so we can't rely on being
able get domain CPU stats for LXC guests.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoFix leak of domain handles in several tests
Daniel P. Berrange [Tue, 13 Dec 2016 15:59:59 +0000]
Fix leak of domain handles in several tests

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoMake interface stats test more robust
Daniel P. Berrange [Tue, 13 Dec 2016 15:59:19 +0000]
Make interface stats test more robust

Check whether the 'default' virtual network exists and is
running before trying to use it.

Use a fixed vnet name to avoid clashes with other running
VMs on the host (if any).

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoSkip screenshot test on 2.5.0 libvirt
Daniel P. Berrange [Tue, 13 Dec 2016 15:49:58 +0000]
Skip screenshot test on 2.5.0 libvirt

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoDon't rely on pkg-config for libvirt-qemu
Daniel P. Berrange [Tue, 13 Dec 2016 15:19:40 +0000]
Don't rely on pkg-config for libvirt-qemu

The libvirt-qemu pkg-config file was only installed from
version 2.6.0 onwards.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoUpdate readme links for docs & travis ci
Daniel P. Berrange [Tue, 13 Dec 2016 15:12:59 +0000]
Update readme links for docs & travis ci

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoUpdate travis config to reflect current codebase setup
Daniel P. Berrange [Tue, 13 Dec 2016 15:05:55 +0000]
Update travis config to reflect current codebase setup

Remove build tags since they're no longer used, but add
tag to turn on integration test

Test oldest, newest and some middle versions

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.0 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.1 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.1 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.2 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.2 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.3 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.3 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.4 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.4 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.5 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.5 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.6 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.6 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.7 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.7 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.8 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.8 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.10 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.10 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.11 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.11 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.12 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.12 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.13 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.13 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.14 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.14 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.15 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.15 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.16 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.16 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.17 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.17 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.18 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.18 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.20 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.20 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.2.21 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.2.21 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.3.0 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.3.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.3.1 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.3.1 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.3.2 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.3.2 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.3.3 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.3.3 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.3.4 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.3.4 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 1.3.5 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 1.3.5 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 2.0.0 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 2.0.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 2.1.0 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 2.1.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 2.2.0 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 2.2.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 2.3.0 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 2.3.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd compat for 2.4.0 release
Daniel P. Berrange [Mon, 12 Dec 2016 15:33:46 +0000]
Add compat for 2.4.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoDon't export ErrNoError in namespace
Daniel P. Berrange [Mon, 12 Dec 2016 15:30:57 +0000]
Don't export ErrNoError in namespace

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd node device event binding
Daniel P. Berrange [Fri, 9 Dec 2016 17:42:49 +0000]
Add node device event binding

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd storage pool event binding
Daniel P. Berrange [Fri, 9 Dec 2016 17:39:07 +0000]
Add storage pool event binding

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoIgnore editor temp / save files
Daniel P. Berrange [Fri, 9 Dec 2016 17:34:42 +0000]
Ignore editor temp / save files

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd network event API binding
Daniel P. Berrange [Fri, 9 Dec 2016 17:33:32 +0000]
Add network event API binding

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoImplement remaining domain event types
Daniel P. Berrange [Fri, 9 Dec 2016 17:14:46 +0000]
Implement remaining domain event types

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoRewrite domain events to have type safe callbacks
Daniel P. Berrange [Fri, 9 Dec 2016 15:55:13 +0000]
Rewrite domain events to have type safe callbacks

Instead of using a single function for event registration, add
a separate registration function per event type. This allows
us to define strongly typed callbacks for each event type,
and avoids the need to do ugly casts in callers callback
impls.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoRewrite connection auth method to be more flexible
Daniel P. Berrange [Fri, 9 Dec 2016 14:46:01 +0000]
Rewrite connection auth method to be more flexible

The NewConnectWithAuth method is hardcoded to only
support 2 credential types. Rewrite it to expose the
full callback facility from the C API

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoOnly pass a single callback when registering for close events
Daniel P. Berrange [Fri, 9 Dec 2016 11:50:52 +0000]
Only pass a single callback when registering for close events

The RegisterCloseCallback method takes two callbacks. This is
pointless as the caller can already use closures to trigger
multiple callbacks if desired.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoOnly pass a single callback when register domain events
Daniel P. Berrange [Fri, 9 Dec 2016 11:50:52 +0000]
Only pass a single callback when register domain events

The DomainEventRegisterAny method takes two callbacks. This is
pointless as the caller can already use closures to trigger
multiple callbacks if desired.

This also fixes the event callback signature to have no return
value, and returns an error from the register function.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoRe-arrange cfuncs / header file structure
Daniel P. Berrange [Fri, 9 Dec 2016 11:41:30 +0000]
Re-arrange cfuncs / header file structure

Instead of having a single 'cfuncs.go' and 'go_libvirt.h' which contain
all the C funtions, split them so that the C functions live alongside
the corresponding Go file. For example, C functions related to the
connect.go file live in connect_cfuncs.go and connect_cfuncs.h

Also add function prototypes for the Go functions being called to
allow type checking.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoMake it clear when falling back to generic error
Daniel P. Berrange [Wed, 7 Dec 2016 15:19:42 +0000]
Make it clear when falling back to generic error

If virGetLastError returns no error object, we currently
create a dummy error object. This code path should never
be hit unless there's a bug in the Go binding, or in the
libvirt library. So make it clear by giving an error
message.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

5 weeks agoAdd API for bulk domain stats listing
Daniel P. Berrange [Wed, 7 Dec 2016 11:25:49 +0000]
Add API for bulk domain stats listing

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

6 weeks agoAdd APIs for guest CPU data fetch/pin
Daniel P. Berrange [Tue, 6 Dec 2016 16:58:11 +0000]
Add APIs for guest CPU data fetch/pin

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

6 weeks agoFix flags to be last parameter in qemu monitor command
Daniel P. Berrange [Tue, 6 Dec 2016 13:49:17 +0000]
Fix flags to be last parameter in qemu monitor command

The flags parameter for the QemuMonitorCommand API was
reversed from that used in the C API. The enum constants
were also not typed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

6 weeks agoRewrite domain vCPU pin related methods
Daniel P. Berrange [Tue, 6 Dec 2016 13:44:50 +0000]
Rewrite domain vCPU pin related methods

Don't pass in the max host CPUs - calculate it automatically.
Also return a []bool bitmap instead of []int32 for cpu affinity
map for consistency with other methods reporting mapping

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

6 weeks agoChange GetState to return a pair of values, instead of array
Daniel P. Berrange [Tue, 6 Dec 2016 13:00:11 +0000]
Change GetState to return a pair of values, instead of array

Change GetState so it returns state and reason separately
instead of using an array, so state can be strongly typed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

6 weeks agoMove method into correct file based on primary object
Daniel P. Berrange [Mon, 5 Dec 2016 15:29:00 +0000]
Move method into correct file based on primary object

Some methods in domain_snapshot.go and secret.go should
actually be part of connect.go or domain.go, based on
the object they're registered against.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>