Hello all,
is there posibility to read exitcode that program executed via VMRunProgramInGuest returns? I mean in Perl.
I found that there is a VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_EXIT_CODE but this is property of Job and job are not available in VIX Perl.
Have i chance to get exitcode in Perl?
You could bypass the Simple layer and go directly to the underling bindings.
Look in SImple.pm, and tweak it appropriately. Something like
sub myVMRunProgramInGuest($$$$$) {
my ($vm, $guestProgramName, $commandLineArgs, $options, $propertyListHandle) = @_;
my $err;
my $job;
my $exitCode;
$job = VMware::Vix::API::VM::RunProgramInGuest($vm, $guestProgramName,
$commandLineArgs,
$options,
$propertyListHandle,
undef, 0);
$err = VMware::Vix::API::Job::Wait($job, VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_EXIT_CODE,
$exitCode, VIX_PROPERTY_NONE);
VMware::Vix::API::API::ReleaseHandle($job);
return $err, $exitCode;
};
Thank you very much for your advice, but i still have problems, if i try to implement like you wrote, there was "failed to get property type" error, so i checked Constants.pm file and found out that there is no VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_EXIT_CODE constant,
if i substitute it directly with value 3018, returned exit code is not correct (always 1307).
Do you think that this is because of version?
no use anymore