[vbox-dev] vboxServiceWrappers.php - Good and Bad news ...

Joseph Smith joseph1962smith at yahoo.com
Sun Mar 28 06:16:04 PDT 2010


Hi James/vbox'ers,
I have upgraded to the latest release of VirtualBox (3.1.6) and I am also using the latest version of the vboxServiceWrappers.php from the 3.1.6 build.
Seems all your changes have successfully made it in and all is great ... well ... except for one item: IPerformanceCollectorCollection.
This is, as you might remember the tricky case where the queryMetricsData method returns an array of data one of which is a collection of objects.
In the most recent version, you have made a few changes that introduce some problems.
In the latest version, you have defaulted the _interfaceName element of the VBox_ManagedObjectCollection class to null rather than 'VBox_ManagedObject' as you did before.  Since the queryMetricsData method cannot determine the class (seems vboxwebsrv is not setting it?), the VBox_ManagedObjectCollection class attempts to instantiate a new object using an empty class name which results in the following error:
PHP Fatal error:  Class name must be a valid object or a string in /home/jvcd/lib/vboxServiceWrappers.php on line 97.

As there is no longer the method 'setInterfaceName', (I was not using it before), I am unable to 'force' the class ...
I'm OK with any approach you take (changing the default _interfaceName or adding a setInterfaceName method).  Personally I prefer the setInterfaceMethod.
To work around the problem ... I've re-added the setInterfaceName on my local copy ...  Then once the queryMetricsData result is returned, I use the setInterfaceName method to set the class name to ''VBox_ManagedObject'.
In reality, for the objects returned by the queryMetricsData, all that is required is the 'handle'.  This is necessary so that if multiple statistics are returned for multiple machines (more efficient that way), you will be able to determine which stats are for which machine.
I've attached a trace-dump ... note at the bottom of the trace you will see the _interfaceName element is empty:
        [handles:protected] => Array            (                [0] => ccf984b29176e999-00000000000000c7                [1] => ccf984b29176e999-00000000000000c7                [2] => ccf984b29176e999-00000000000000c7                [3] => ccf984b29176e999-00000000000000c7                [4] => ccf984b29176e999-00000000000000c7                [5] => ccf984b29176e999-00000000000000c7                [6] => ccf984b29176e999-00000000000000c7            )        [_interfaceName:protected] => 


Thanks,Joe






      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100328/a6da616c/attachment-0001.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IPerformanceCollector.trace.txt
Url: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100328/a6da616c/attachment-0001.txt 


More information about the vbox-dev mailing list