VirtualBox

Ticket #12073 (new defect)

Opened 22 months ago

Last modified 3 months ago

VBoxManage showvminfo --machinereadable XXX has inconsistent output format

Reported by: gsp Owned by:
Priority: major 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

comment:1 Changed 12 months ago by frank

Many valid points. The "merged in a strange way" is mentioned in #13176 and will be fixed in the next maintenance release.

comment:2 Changed 3 months ago by coroos

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.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use