Hi!
I'm developing a Java port of the VMCI example and am going to release it to the Open Source community once finished. The port uses JNI to interact with the VMCI C-library and I have translated all the methods I need. Some functionality is working at the moment but unfortunately I am now stuck on a problem I don't see a solution to.
The following works:
1. Client on Host -
> Talk to -
> Server on VM (C impl)
2. Client on VM (C impl) -
> Talk to -
> Server on Host (Can only recieve not send response)
C impl = The example datagramApp written in C that follows with the VMCI library.
In example (1) above when using the C-implementation of the datagramApp application everything works as it should, the Java-client on the host can send and receive messages. In example (2) when using the Java-implementation of the datagramApp and running it as a server on the host and connecting to it with the C-implementation from within a VM, the server receives messages but can not send responses. (ErrorCode: (-2) - VMCI_ERROR_INVALID_ARGS).
If you still with me so far you may have noticed that my examples above haven't involved running my Java port from inside a VM, the reason for this is that I can't get passed the "VMCIResource_AddClientPrivileges" stage, I get (ErrorCode: (-7) - VMCI_ERROR_NO_ACCESS) both as client and server.
I have tested extensively and I'm pretty sure that it has something to do with the combination of the Java Virtual Machine, JNI, virtual environment and the C-library. It looks like JNI behaves somewhat strange in a virtual environment, I'm not sure though but it could explain why the error in example (2) only occurs inside a VM.
Any help is highly appreciated.
Here is the first version of the Java port of the VMCI-datagram example. The previous errors is fixed and this release is fully functional. The program is released under GPL v3. Please do change and use it, the next step could perhaps be to wrap it in an Socket and use it instead of IP based communication between the host and guest VMs. I know it's possible and it could be used to solve problems in that domain.
