Opened 12 years ago
Closed 5 years ago
#12073 closed defect (obsolete)
VBoxManage showvminfo --machinereadable XXX has inconsistent output format
Reported by: | gsp | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 4.2.16 |
Keywords: | machinereadable | Cc: | |
Guest type: | all | Host type: | Linux |
Description
The output of VBoxManage showvminfo --machinereadable is not as easy to parse as it should.
To reproduce:
VBoxManage showvminfo --machinereadable SomeVM | less
some of the values which are integers show with quotas, some not:
cpus=4 sockSnd="64"
most of the keywords show without quotas, some with:
VMStateChangeTime="2013-09-04T08:07:24.020000000" "IDE-Controller-1-1"="none"
some items are merged in a strange way:
Time offset=0rtcuseutc="off"
Boolean values should show without quotas to distinct them from strings:
lpt2="off"
Quotas and newlines in user-editable text should be replaced by the proper escape-sequences:
description="Multiline Description with "quotas""
Keywords should be language-neutral (don't localize):
"Disketten-Controller-0-1"="none"
Please consider to make the output valid JSON, this is much easier to parse (http://www.json.org)
Change History (3)
comment:1 by , 11 years ago
comment:2 by , 10 years ago
The problem with strings is present in descriptions ("description" and 'SnapshotDescription") in my case. The problem is that in all cases the description is dumped in raw form:
if (details == VMINFO_MACHINEREADABLE)
RTPrintf("description=\"%ls\"\n", description.raw());
I use some awk to process the output of showvminfo to produce bash aliases, and the eval croaks if the description contains multiple lines.
In reality everything printed as a string there should be passed through an escapifier that outputs \r\n\b\t\", etc., most notably the descriptions.
comment:3 by , 5 years ago
Resolution: | → obsolete |
---|---|
Status: | new → closed |
Many valid points. The "merged in a strange way" is mentioned in #13176 and will be fixed in the next maintenance release.