mikelangelo-project / capstan

Capstan, a tool for packaging and running your application on OSv.
http://osv.io/capstan/
Other
19 stars 7 forks source link

Adjust QEMU configuration logic to allow capstan run on OSX #66

Closed wkozaczuk closed 6 years ago

wkozaczuk commented 6 years ago

Changed hypervisor/qemu/qemu.go to use hostfwd instead of deprecated redir option and aio=threads for OSx so that capstan can be used on OSx.

Signed-off-by: Waldemar Kozaczuk jwkozaczuk@gmail.com

wkozaczuk commented 6 years ago

@miha-plesko @gberginc I cleaned the code as suggested.

Yes on OSX the aio=native does not seem supported. Even with qemu 2.10 one gets following message:

qemu-system-x86_64: -drive file=.qemu,if=none,id=hd0,aio=native,cache=unsafe: aio=native was specified, but is not supported in this build.

In general capstan on Mac works fine with these corrections and can be used to compose images. However qemu does not perform well when running/testing apps. It turns out that VirtualBox is much faster. For example I was able to fully boot OSv with elasticsearch with java in 7 seconds in VirtualBox. Same image takes almost 60 seconds to fully boot with Qemu on OSX - it seems virtual storage device is very slow maybe because of aio=threads.

miha-plesko commented 6 years ago

Thanks, I was asking because I was thinking whether we should set aio=threads for all platforms, not just darwin. But with your explanation it sounds like this would just bring a performance drop, so let's leave it for darwin only.

I'm merging the PR, thank you for your contribution.