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

Redirect QEMU standard error to Capstan #64

Closed wkozaczuk closed 6 years ago

wkozaczuk commented 6 years ago

Currently in case of QEMU error (which happens when composing an app on Mac OSX) capstan does not output any information and eventually quits with misleading error message:

Setting cmdline: /tools/cpiod.so --prefix /
Could not run QEMU VM. Try to set 'disable_kvm:true' in ~/.capstan/config.yaml
dial tcp [::1]:10000: getsockopt: connection refused

In reality QEMU does not start due to some deprecated or incorrect parameters. In order for user to see the errors output by QEMU to standard error capstan needs to redirect it to its standard error.

After the changes user can see exact error which is much better:

Setting cmdline: /tools/cpiod.so --prefix /
qemu-system-x86_64: -redir tcp:10000::10000: The -redir option is deprecated. Please use '-netdev user,hostfwd=...' instead.
qemu-system-x86_64: -drive file=<qemu_file>.qemu,if=none,id=hd0,aio=native,cache=unsafe: aio=native was specified, but is not supported in this build.
Could not run QEMU VM. Try to set 'disable_kvm:true' in ~/.capstan/config.yaml
dial tcp [::1]:10000: getsockopt: connection refused

Please note that the underlying problem is fixed in another followup pull request that I am ready to submit once this one is merged.

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

miha-plesko commented 6 years ago

Regarding the problem with QEMU that led you to implement this patch @wkozaczuk , could you please open an issue about it, providing some more information? I wasn't aware that Capstan has QEMU problems on Mac.

gberginc commented 6 years ago

@wkozaczuk thanks for this contribution!

Can you please update the commit message to comply with the proposal of @miha-plesko? Simple Redirect QEMU standard error to Capstan title will do. You may also choose to add the text from PR into the commit, but that is not that important.

I hope we are not asking too much, but we'd like to ensure that commits are traceable.

wkozaczuk commented 6 years ago

I will be sending next patch to fix the QEMU/OSx related issue that show up in standard error

gberginc commented 6 years ago

@wkozaczuk Sorry for being stubborn with this commit: thank you for changing the PR text, however what I was referring to was the actual commit title of this commit.

May I ask you to edit it (the same title as current PR title)?

wkozaczuk commented 6 years ago

@gberginc Done.

miha-plesko commented 6 years ago

@wkozaczuk I think the commit message body is still missing:

capture

Should be something like:

capture

wkozaczuk commented 6 years ago

I am sorry for my total misunderstanding of you originally wanted. I amended the commit - I hope it will work like a charm this time.

miha-plesko commented 6 years ago

Thanks for the contribution @wkozaczuk , it's much better now! 😄