Page 1 of 1

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

PostPosted: 11. May 2015, 20:13
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
https://forums.virtualbox.org/viewtopic ... 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.

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

PostPosted: 12. May 2015, 11:59
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.