Commit Graph

6 Commits

Author SHA1 Message Date
Ben LeMasurier
1a220100bd
adds missing mutex around callback map (#54)
We were missing a mutex when retrieving the caller in callback().
Triggered a test failure here: https://travis-ci.org/digitalocean/go-libvirt/jobs/317051310
2017-12-15 12:56:47 -07:00
Ben LeMasurier
165035e03c
prevent connection write collisions (#52)
* prevent connection write collisions

When multiple calls are made on the same connection, it's possible for
the writes to collide with each other. This adds a write mutex when
communicating with the libvirt daemon.
2017-12-07 10:47:52 -07:00
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
Ben LeMasurier
e99de2e999
fixes response overwrite bug
This fixes a bug in truncated response payload handling. Payloads
requiring more than one call to `Read()` were overwiting the previous
Read()'s buffer contents. Because we know the response payload size, we
can simply call `io.ReadAll()` rather than looping over calls to
`Read()`.
2016-06-27 12:40:39 -06:00
Ben LeMasurier
65d878e075 Adds test package
This splits out the mock libvirt server for testing within
other packages. Constants from the main libvirt package
have been moved to a separate package, constants, for shared access.
2016-05-20 10:50:10 -06:00
Ben LeMasurier
2ccd33a8df Initial Commit 2016-05-19 19:40:34 -06:00