[vbox-dev] IPerformanceCollector problem with VirtualBox PHP vboxServiceWrappers (v 3.1.0 and 3.1.2)

James Lucas jimmy at secsme.org.au
Sun Jan 17 05:31:22 GMT 2010


Hi Joseph,

I'll go though what you have given me here however a quick look tell me that all
of these issues should be fixed. I submitted a updated version to Ulrich
mid-december (and again at the start of the year) however I've just checked and
it has not been committed to SVN.

I'll verify on the working copy at work and then send through a updated version
of the xsl file and also a generated version for 3.1.2, I'll CC this list in
the hope it can make it into the 3.1.4 release when that occurs.

- James

Quoting Joseph Smith <joseph1962smith at yahoo.com>:

> Hi James,
> I have uncovered a problem with the IPerformanceCollector class
> (queryMetricsData method) that casuses a fatal error.
> I am including the vbox-dev community as I believe the change I recommend
> below might help someone else.
> First ... I am actually still using version 3.1.0 (I don't like to jump on
> the latest releases too quickly unless there are serious probs that force me
> to).
> Anyway ... I encountered a problem with ver 3.1.0 where that version was
> trying to instantiate the abstract class 'VBox_ManagedObjectCollection'
> rather than the 'IPerformanceMetricCollection' class.  To work around this, I
> corrected this today in my local copy by changing from the abstract class to
> the 'IPerformanceMetricCollection' and all was
>  well.
> So I decided to go ahead and upgrade to ver 3.1.2.  Since the APIs did not
> change too much ... I decided to take the chance and do a quick test by using
> the 3.1.2 vboxServiceWrappers against my version 3.1.0 VirtualBox environment
> (again ... I don't like rushing into upgrading and figured the diff was not
> too big ...).
> In doing this ... I have found a problem with version 3.1.2
> vboxServiceWrappers.php.
> In version 3.1.2, the queryMetricsData method, when returning the result set,
> attempts to instantiate an invalid collection (Line #6102):   'new
> $unknownCollection'.  This object is not defined and as a result is causing
> an error.  Interestingly, the name of the variable in the signature is called
> 'unknown' ... so I think that might be part of the problem.
> Like in ver 3.1.0, I believe the correct object to instantiate is
>  IPerformanceMetricCollection. 
> I made that adjustment and as you might expect, that prevented the PHP fatal
> error.  This however uncovered another problem.  The return statement for ver
> 3.1.2 is not correct (does not match the API documentation).  Each of the
> return data elements are being type-cast incorrectly.  Ver 3.1.0 did have the
> correct type-cast.
> Ver 3.1.2 (with my IPerformanceMetricCollection change) has the
> following:return array((int)$response->returnval,
> (string)$response->returnMetricNames, new IPerformanceMetricCollection
> ($this->connection, $response->returnObjects),
> (string)$response->returnUnits, (int)$response->returnScales,
> (int)$response->returnSequenceNumbers, (int)$response->returnDataIndices,
> (int)$response->returnDataLengths);
> I believe it should be:return array((array)$response->returnval,
>  (array)$response->returnMetricNames, new IPerformanceMetricCollection
> ($this->connection, (array)$response->returnObjects),
> (array)$response->returnUnits, (array)$response->returnScales,
> (array)$response->returnSequenceNumbers, (array)$response->returnDataIndices,
> (array)$response->returnDataLengths);
> Notice ... the typecast for all the returned data elements are arrays and not
> string or int.
> 
> Thanks,Joe
> 
> 
> 
>       


--
UTS CRICOS Provider Code:  00099F
DISCLAIMER: This email message and any accompanying attachments may contain
confidential information.  If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments.  If
you have received this message in error, please notify the sender
immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly, and
with authority, states them to be the views the University of Technology,
Sydney. Before opening any attachments, please check them for viruses and
defects.




More information about the vbox-dev mailing list