MachineCloneVM::run() is 24KB of spaghetti code!

Discussions related to using the OSE version of VirtualBox.
Post Reply
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

MachineCloneVM::run() is 24KB of spaghetti code!

Post by Technologov »

24 kilobytes in one function, yay ! Now this is _really_ HUGE. (VirtualBox v5.0.0-BETA2)

Who ordered the big plate of spaghetti code ?
And probably buggy too. See here:

VBoxSVC backend lockup on linked clone with floppy
viewtopic.php?f=15&t=67499

I will try to debug this code and see if I can understand it and split it up into manageable chunks & functions.

Plan is to split the function, and all internal functions will go to "MachineImplCloneVMlib.cpp"

Other potential bugs:
+Plus, it begins cloning, before verifying, if target *.vbox file already exists or not. We end up with semi-working differencing images, in case of linked clones.
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: MachineCloneVM::run() is 24KB of spaghetti code!

Post by frank »

Debugging is appreciated but please don't expect that we will consider code-restructure contributions. The reason is that checking the correctness of such restructures is very difficult, therefore we rather do this ourselves.
Post Reply