VirtualBox API 7 web service backwards compatibility

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
rami
Posts: 10
Joined: 8. Jul 2012, 20:53

VirtualBox API 7 web service backwards compatibility

Post by rami »

Hi.

When I compare vboxweb.wsdl between VirtualBoxSDK-6.1.42-155177 and VirtualBoxSDK-7.0.6-155176, I noticed some enum values have changed which seem like there would be some backwards compatibility issues.

For example, the MachineState enum has a new value: AbortedSaved.

However, it was not added to the end of the enum list (or explicitly set to a higher value than the previous/existing values).

So for example, when generating C# client code:

VirtualBox 6.1.42:

Code: Select all

    public enum MachineState
    {
        Null, // 0
        PoweredOff, // 1
        Saved, // 2
        Teleported, // 3
        Aborted, // 4
        Running, // 5
        Paused, // 6
        ...
    }

VirtualBox 7.0.6:

Code: Select all

    public enum MachineState
    {
        Null, // 0
        PoweredOff, // 1
        Saved, // 2
        Teleported, // 3
        Aborted, // 4
        AbortedSaved, // 5  <-- the new value
        Running, // 6 <-- this has changed
        Paused, // 7 <-- this has changed
        ...
    }
So the enum values of the old wsdl do not seem to be compatible with the enum values of the new wsdl.

This makes it harder to manage development environments with either VirtualBox 6.1.42 or 7.0.6 installed.

For example, if we have an older branch which uses the VirtualBox 6.1.42 SDK, and the new branch uses VirtualBox 7.0.6 SDK, it doesn't seem like we can work in both branches with VirtualBox 7 is installed.
Instead, it seems if we need to work with the older branch, we need to have VirtualBox 6 installed, and if we want to work with the newer branch, we need to have VirtualBox 7 installed.
Is that the expected behavior?

Any advice?

Thank you.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: VirtualBox API 7 web service backwards compatibility

Post by noteirak »

Hello Rami,
rami wrote: So the enum values of the old wsdl do not seem to be compatible with the enum values of the new wsdl.
That's correct, they are not. That's why those changes only happen in a new major release.
rami wrote: It seems if we need to work with the older branch, we need to have VirtualBox 6 installed, and if we want to work with the newer branch, we need to have VirtualBox 7 installed.
Is that the expected behavior?
Yes and that reflects on the system: it is not possible to have two different major versions of VirtualBox installed on one host.
rami wrote: Any advice?
My level is C# is very low so I can't give you a definitive answer but since C# is strongly aligned with Java, you may want to explore the equivalent area of Java's ClassLoaders.
For my Hyperbox project, I had to do exactly that: have different major versions of the SDK bundled in a single app. Using custom ClassLoader for each allowed to co-exist in the same runtime.
Another mechanism (if present in C#) would be to load a module/class on-demand and then eject it from memory. This is also usually done with some custom ClassLoader.

I don't know if this will solve it for you, or if it is possible to do something similar, but the limitation is intended, yes.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
EdLudwig
Posts: 6
Joined: 5. Aug 2022, 20:18

Re: VirtualBox API 7 web service backwards compatibility

Post by EdLudwig »

@noteirak, where I can I download your latest release of Hyperbox? None of the links in your posts work, and after doing some googling a round, I did find some pages on your site that work, but mostly even those links lead to nothing.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox API 7 web service backwards compatibility

Post by scottgus1 »

EdLudwig wrote:where I can I download your latest release of Hyperbox?
Seems that going through Noteirak's signature link to the Github page, then to the Releases link, gets to downloadable files.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: VirtualBox API 7 web service backwards compatibility

Post by noteirak »

All the repos are here: https://github.com/hyperbox/ but I wouldn't start deep diving in the code, there are an aweful lot Java-specific things including left over from when I tried to use the XPCOM lib instead of WebService.

But have you tried to simply auto-detect what is installed locally and then calling the WS library? It is what I do in the rewrite I started and is much easier to deal with.
See https://github.com/hyperbox/server/blob ... .java#L139
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply