search for: pluginpread

Displaying 2 results from an estimated 2 matches for "pluginpread".

Did you mean: plugin_pread
2020 Apr 10
0
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
...unsafe.Pointer) { + nbdkit.Debug("golang code running in the .close callback") + C.free(handle) +} + +//export pluginGetSize +func pluginGetSize(handle unsafe.Pointer) C.int64_t { + nbdkit.Debug("golang code running in the .get_size callback") + return 1024 * 1024 +} + +//export pluginPRead +func pluginPRead(handle unsafe.Pointer, buf []byte, count C.uint32_t, + offset C.uint64_t, flags C.uint32_t) C.int { + nbdkit.Debug("golang code running in the .pread callback") + // XXX + return 0 +} + +func init_plugin() { + plugin.name = C.CString("test") + plugin.open = (*[...
2020 Apr 10
3
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
...are a joke at the moment. We would really need a test which properly exercises threads / parallel client connections, so we can be sure that the nbdkit thread & golang goroutine models do not conflict in some way. (I don't think they do, but need to check). - Current test func pluginPRead() needs to be completed. - Documentation needs fixing. I didn't want to write too many docs until I know finally how plugins would work. Rich. [1] Reading the proposal here confirms my suspicions, since there is a much simpler, better and more obvious solution than what is proposed: htt...