For machines that do not have any snapshots, these commands will currently
cause a crash in VBoxManage:
VBoxManage snapshot "machine_with_no_snapshots" restorecurrent
VBoxManage snapshot "machine_with_no_snapshots" edit --current --name
'new_name'
See the attached patch for a fix.
Index: VBoxManageSnapshot.cpp
===================================================================
--- VBoxManageSnapshot.cpp (revision 58256)
+++ VBoxManageSnapshot.cpp (working copy)
@@ -501,6 +501,11 @@
if (fRestoreCurrent)
{
CHECK_ERROR_BREAK(sessionMachine,
COMGETTER(CurrentSnapshot)(pSnapshot.asOutParam()));
+ if (pSnapshot.isNull())
+ {
+ RTPrintf("This machine does not have any snapshots\n");
+ return RTEXITCODE_FAILURE;
+ }
}
else
{
@@ -541,6 +546,11 @@
|| !strcmp(a->argv[2], "-current"))
{
CHECK_ERROR_BREAK(sessionMachine,
COMGETTER(CurrentSnapshot)(pSnapshot.asOutParam()));
+ if (pSnapshot.isNull())
+ {
+ RTPrintf("This machine does not have any snapshots\n");
+ return RTEXITCODE_FAILURE;
+ }
}
else
{
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev