55 Commits

Author SHA1 Message Date
Geoff Hickey
5a6654f07a Generate libvirt constants from libvirt sources.
- Add a yacc-based parser and a hand-written lexer to read the
remote_protocol.x file from libvirt's sources.
- Use the new parser to generate the constants used to communicate with
libvirt.
2017-11-02 19:42:44 -04:00
Katrina Ellison Geltman
8b2644f7ff Merge pull request #47 from digitalocean/domainstate-const
Explicitly specify type of DomainState constants
2017-10-23 18:14:56 -04:00
Katrina Ellison Geltman
85330a67c6 Explicitly specify type of DomainState constants 2017-10-23 17:23:17 -04:00
Geoff Hickey
a339d0ac95 Handle TypedParamStrings (#46)
* Handle TypedParamStrings

Add handling for TypedParamStrings, which are different from the other
TypedParam... types in that the decoded value is variable-sized.
2017-09-15 10:48:46 -04:00
Geoff Hickey
c8e4b6a7b8 Add Get/SetBlockIoTune to go-libvirt API. (#45)
* Add Get/SetBlockIoTune to go-libvirt API.

This adds two libvirt entry points to the go-libvirt API:
virDomainSetBlockIoTune and virDomainGetBlockIoTune. These can be used
to control block device throttling for a VM.
2017-08-31 11:21:31 -04:00
Geoff Hickey
85dc33f30e Merge pull request #44 from digitalocean/gh/fix-compiler-warnings
fix a trio of compiler warnings
2017-08-01 17:24:15 -04:00
Geoff Hickey
1df4a7eec4 fix a trio of compiler warnings
Fix three compiler warnings caused by using format strings in calls to
testing.Error() and Fatal(). Switched to Errorf() and Fatalf().
2017-08-01 16:52:12 -04:00
Ben LeMasurier
975d5a18d5 Updates README (#43)
This updates the project README, removing the pre-production warning
and adding a note about the libvirt project's feelings surrounding
direct interaction with the RPC interface.
2017-06-22 10:04:46 -06:00
Amanda H. L. de Andrade
9ca7034516 Add DomainMemoryStats method (#38) (#39) 2017-06-02 11:28:20 -06:00
Alexander Polakov
c09ce7b21d Add Reboot and Reset methods (#37) 2017-05-04 11:30:22 -05:00
Alexander Polakov
208ef2aff1 Add Shutdown() method (#36)
* Add Shutdown() method
2017-05-04 10:39:45 -05:00
Alexander Polakov
d41d9eb855 Add DomainCreate method (#35)
* Adds DomainCreateWithFlags
2017-05-04 10:17:25 -05:00
Ben LeMasurier
b92ccddb00 Adds libvirt 3.1.0 integration test target (#34) 2017-04-19 10:00:23 -06:00
Ben LeMasurier
2609dd2697 Add Secrets() (#29)
This adds the `Secrets()` method, used to retrieve all secrets managed
by the libvirt daemon.
2017-01-19 20:40:31 -06:00
Ben LeMasurier
cfa567708b Adds StoragePool(), StoragePoolRefresh() (#28)
This adds two new methods:
- `StoragePool()`, used to lookup a storage pool by name.
- `StoragePoolRefresh()`, used to refresh a storage pool by name.
2017-01-09 14:54:30 -07:00
Ben LeMasurier
591f6798f1 Adds StoragePools() (#27)
* Adds StoragePools()

This adds the ability to list storage pools.
2017-01-06 15:58:27 -06:00
Michael Bruskov
85674d25f7 Add DefineXML() (#26) 2016-12-09 09:49:14 -07:00
Michael Bruskov
fe0f99a7c1 Add DomainState method. (#23)
Returns state of the domain.
2016-12-02 10:54:04 -07:00
Ben LeMasurier
953e83ac30 Merge pull request #19 from digitalocean/capabilities
Adds Capabilities()
2016-12-01 14:19:01 -07:00
Ben LeMasurier
5a1fe4c14a Adds Capabilities()
This adds a new method, Capabilities(), which returns an XML
definition of the hypervisor's system capabilities, much like
`virsh capabilities`.

I've only included integration tests for these two methods due to the
large amount of data returned by the capabilities call.
2016-12-01 14:09:24 -07:00
Ben LeMasurier
311150f931 Merge pull request #24 from digitalocean/dumpxml
Adds support for dumping domain XML
2016-12-01 11:48:52 -07:00
Ben LeMasurier
c6e0d02f28 Adds support for dumping domain XML
This adds support for dumping a domain's XML definition, akin to `virsh
dumpxml <domain>`. The returned data is quite large so I've included an
integration test rather than adding a huge blob of hex to `libvirttest`.
2016-11-30 19:31:45 -07:00
Ben LeMasurier
850adbae3f Merge pull request #20 from simar7/master
destroy: Add the ability to destroy a KVM domain.
2016-11-03 08:27:33 -06:00
Simarpreet Singh
693bffa997
destroy: Adding the ability to destroy a domain.
Signed-off-by: Simarpreet Singh <simar@linux.com>
2016-11-02 20:47:37 -07:00
Simarpreet Singh
e7178e25dc Merge pull request #3 from digitalocean/master
Merging from upstream

Signed-off-by: Simarpreet Singh <simar@linux.com>
2016-11-02 16:46:48 -07:00
Ben LeMasurier
3f7af99055 Merge pull request #18 from digitalocean/integration-tests
ci: install libvirt for integration testing
2016-10-26 11:20:45 -06:00
Ben LeMasurier
4ad0ae7f82 ci: install libvirt for integration testing
This modifies the travis-ci configuration to build and install libvirt
1.2.2 and 2.3.0 for integration testing. Simple integration tests have
been included for Connect() and Disconnect().
2016-10-20 14:53:29 -06:00
Simarpreet Singh
53bb4bc9da Merge pull request #1 from digitalocean/master
Merging from upstream

Acked-by: Simarpreet Singh <simar@opendns.com>
2016-10-07 13:45:54 -07:00
Matt Layher
00a2c05c46 Merge pull request #15 from digitalocean/readme-contributing-irc
CONTRIBUTING, README: add IRC channel information
2016-10-04 20:27:11 -04:00
Michael Koppmann
ef5716f8d6 Replaced scripts/golint.sh with built-in golint flag. (#17)
* Replaced scripts/golint.sh with built-in golint flag.

Fixes issue #16.

Should I delete the scripts/golint.sh?

* Added @mkoppmann to the AUTHORS file.

* Delete golint.sh as it is not needed anymore
2016-10-04 20:26:25 -04:00
Matt Layher
19eff0f260
CONTRIBUTING, README: add IRC channel information 2016-10-04 12:31:26 -04:00
Ben LeMasurier
f9fab20f58 Merge pull request #13 from digitalocean/undefine-domain
Add support for undefining a domain
2016-09-28 15:40:55 -06:00
Ben LeMasurier
d556125e20 Add support for undefining a domain 2016-09-28 15:37:06 -06:00
Ben LeMasurier
d473469e69 Merge pull request #11 from digitalocean/migrate-padding
migrate: insert required request structure padding
2016-09-28 11:26:01 -06:00
Ben LeMasurier
73ac0f5012
migrate: insert required request structure padding
Further testing reveals we need some additional padding on the request
passed to libvirt when performing migrations. I believe this is due to
the structure alignment normally provided automatically by the compiler.

In testing, this fixes an error I was seeing: "Unable to decode message
paylaod", returned from libvirt when performing migrations.
2016-09-28 11:07:03 -06:00
Matt Layher
754c709cd3 Merge pull request #9 from digitalocean/mdl-travis-go17
travis: use Go 1.7
2016-08-31 17:09:20 -04:00
Matt Layher
594b5ab909
travis: use Go 1.7 2016-08-31 16:58:56 -04:00
Matt Layher
016a7d47c3 Merge pull request #8 from cdrage/update-docs
Add note to constants
2016-08-31 16:34:22 -04:00
Charlie Drage
22e7211e58 Add cdrage to authors 2016-08-31 16:30:10 -04:00
Charlie Drage
4603ca308d Add note to constants
Adds a small note to the constants.go file for creating a new api call
within libvirt.go
2016-08-31 13:34:49 -04:00
Ben LeMasurier
0417eacbef Merge pull request #7 from digitalocean/migrations
Add support for domain migrations
2016-08-22 07:21:06 -06:00
Ben LeMasurier
128bc7d448
Add support for domain migrations
This adds basic support for domain migrations from one hypervisor to
another. Migration options, e.g., live, tunneled, compressed, etc..,
are specified by the constants described `constants.Migrate*`.

Two unknowns remain, Libvirt specifies `RemoteParameters` and `CookieIn`.
In testing both values are always set to 0 by `virsh` and the source
does not provide clear definitions of their purpose. For now, using
the same zero'd values used by `virsh` will be Good Enough.
2016-08-21 09:10:30 -06:00
r-medina
0b294fc010 Merge pull request #6 from digitalocean/rm/add-to-authors-file
added Ricky Medina to AUTHORS
2016-08-04 14:55:40 -04:00
ricky
ff0d37f436 added Ricky Medina to AUTHORS 2016-08-04 14:52:33 -04:00
r-medina
ff6bc69191 Merge pull request #5 from digitalocean/rm/add-migrate-set-speed
adding `virsh migrate-setspeed`
2016-08-04 14:36:44 -04:00
ricky
92abb8c314 adding virsh migrate-setspeed 2016-08-04 14:29:29 -04:00
Ben LeMasurier
a8acb825b1 Merge pull request #4 from digitalocean/qemu-errors
check for QEMU response errors
2016-07-19 10:53:51 -06:00
Ben LeMasurier
759a8c0337
check for QEMU response errors
When performing QEMU monitor commands, libvirt will return StatusOK even
when the underlying QEMU process fails to perform the command.

This modifies Run() to check for QEMU errors.

I'm not entirely happy with the hacky modifications to the test library
to handle this scenario. The test framework is in obvious need for a
complete refactor. For now this will have to work.
2016-07-19 10:40:47 -06:00
Ben LeMasurier
beeb8df345 Merge pull request #3 from digitalocean/report-card-link
README: fixes broken go report card link
2016-06-27 13:19:07 -06:00
Ben LeMasurier
fc88e157af Merge pull request #2 from digitalocean/fix-buffer-overwrite
fixes response overwrite bug
2016-06-27 13:19:02 -06:00