We had a query yesterday about the VDDK plugin and making it actually
obey the weird "Multithreading Considerations" rules in the VDDK
documentation
(
https://vdc-download.vmware.com/vmwb-repository/dcr-public/8f96698a-0e7b-...)
This patch is my attempt to implement this.
The idea is that the plugin starts a background thread and routes all
calls to certain VDDK functions through this thread, ensuring that the
"Multithreading Considerations" are obeyed.
It doesn't work. Because we start the background thread when the
plugin is loaded, when nbdkit forks the thread disappears. It's
possible that we need in nbdkit a supported way for plugins to create
background threads.
In any case the actual benefit of this patch is dubious. Closer
reading of the documentation indicates that VDDK does not allow full
parallel requests on single handles. The way we normally use VDDK
(eg. from virt-v2v) is that we only have a single connection open (and
therefore a single handle). So whether we'd gain any benefit in real
world cases seems unlikely.
We cannot enable multi-conn on writable VDDK handles because the
documentation gives us no indication that VDDK provides the required
guarantees, although we might consider enabling multi-conn for
readonly handles.
Rich.