[vbox-dev] Result and exit code for [VBoxManage guestcontrol execute] without --wait flags
andreas.loeffler at oracle.com
Wed Sep 5 16:58:11 GMT 2012
thanks for your suggestions.
We're aware that VBoxManage at the moment doesn't do an optimal job at
the moment when it comes to exit codes, e.g. they're somewhat rarely
used besides 0. Also they often only indicate the bare minimum required
for getting a shell script to work.
However, if you need to do more advanced work I'd recommend using our
API instead of using VBoxManage as a client. There you have a much more
fine-grained control on what happened compared to plain old exit codes
returned by VBoxManage.
I'll think about the PID output on successful start and the exit code
handling; both sound like a useful improvement to me. For 4.1 we
probably won't touch the current behavior, but for the 4.2(.x) branch we
certainly can improve things a bit.
On 01.09.2012 20:29, Erik Leunissen wrote:
> When not using one of the flags --wait-stdout --wait-stderr or
> --wait-exit to "VBoxManage guestcontrol execute", the current[*]
> behaviour w.r.t. exit code and standard output is:
> a. nothing is written to stdout, unless the --verbose flag was specified
> on the command line.
> b. the exit code is invariably 1, indicating failure, even if the
> process was launched successfully.
> I'd like to propose to change this behaviour as follows:
> a. result on stdout is the PID of the newly launched process (just the
> number), without needing to pass the --verbose flag on the command line.
> b. exit code indicates success of program launch (exit code = 0), or
> some failure (exit code<> 0)
> Advantages (IMHO) over the current behaviour:
> - correct distinction between success and failure of program launch,
> where real failure cases can be handled specifically.
> - straightforward support for further programmatic control of the newly
> launched process through its PID
> Any comments, thoughts ... ?
> Erik Leunissen.
> [*] Version 4.1.18, Host: Linux OpenSuSE 11.4, Guest: Windows Vista
> vbox-dev mailing list
> vbox-dev at virtualbox.org
Kind regards / Mit freundlichen Grüßen
Andreas Löffler | VirtualBox Engineering
Senior Software Engineer | Oracle Virtualization
ORACLE Deutschland B.V. & Co. KG
D-71384 Weinstadt, Germany
Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz
Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher
More information about the vbox-dev