Hi,
The following patch (against OSE SVN 22982) for VBoxManage will print
the path to the current VM save state file if such a state file exists
for the machine readable output of VBoxManage showvminfo.
Licensed under the MIT license (I also have submitted a signed
contributer form)
Regards,
James
Output: with saved state
VMState="saved"
VMStateChangeTime="2009-09-18T04:09:27.000000000"
VMStateFile="/vmuser/vmachines/Machines/1149/snapshots/{c52a2e52-a959-455a-9e85-4bfca4428290}.sav"
Output: without saved state
VMState="poweroff"
VMStateChangeTime="2009-09-18T04:10:27.000000000"
--
UTS CRICOS Provider Code: 00099F
DISCLAIMER: This email message and any accompanying attachments may contain
confidential information. If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments. If
you have received this message in error, please notify the sender
immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly, and
with authority, states them to be the views the University of Technology,
Sydney. Before opening any attachments, please check them for viruses and
defects.
Index: VBoxManageInfo.cpp
===================================================================
--- VBoxManageInfo.cpp (revision 23073)
+++ VBoxManageInfo.cpp (working copy)
@@ -407,10 +407,14 @@
RTTimeSpecSetMilli(&timeSpec, stateSince);
char pszTime[30] = {0};
RTTimeSpecToString(&timeSpec, pszTime, sizeof(pszTime));
+ Bstr stateFile;
+ machine->COMGETTER(StateFilePath)(stateFile.asOutParam());
if (details == VMINFO_MACHINEREADABLE)
{
RTPrintf("VMState=\"%s\"\n", pszState);
RTPrintf("VMStateChangeTime=\"%s\"\n", pszTime);
+ if (!stateFile.isEmpty())
+ RTPrintf("VMStateFile=\"%lS\"\n", stateFile.raw());
}
else
RTPrintf("State: %s (since %s)\n", pszState, pszTime);_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev