Suggestion: Snapshot showvminfo ,Suggestion for sub parameters of [-- machineadable].

Here you can provide suggestions on how to improve the product, website, etc.
Post Reply
HaotongYang
Posts: 32
Joined: 25. Aug 2021, 21:39

Suggestion: Snapshot showvminfo ,Suggestion for sub parameters of [-- machineadable].

Post by HaotongYang »

VBoxManage showvminfo <uuid | vmname> [--machinereadable]
Contains the [-- machineadable] parameter;

however.
VBoxManage snapshot <uuid|vmname> showvminfo <snapshot-name>
There is no [-- machineadable]. It is unfriendly for third-party software to read this information.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Suggestion: Snapshot showvminfo ,Suggestion for sub parameters of [-- machineadable].

Post by mpack »

I don't see it.

The former is a reporting function, hence the "machine readable" option for the report.

The latter is a command (verb), not a reporting function.
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Suggestion: Snapshot showvminfo ,Suggestion for sub parameters of [-- machineadable].

Post by fth0 »

mpack wrote: 30. Jun 2023, 15:46 The latter is a command (verb), not a reporting function.
Sorry, but you're wrong here. Both commands give more or less the same information, just for different states of the VM, so the request is sensible IMHO.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Suggestion: Snapshot showvminfo ,Suggestion for sub parameters of [-- machineadable].

Post by mpack »

Oh, I see. One shows info for the VM, the other shows info for a snapshot. I mostly stopped reading after "VBoxManage snapshot" since I considered that a verb.

So yes, I agree it's a sensible request. In fact I'd be kinda surprised if the same code wasn't responsible for rendering the same info in both cases. It seems so obvious that you'd just pass a pointer to an info struct.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Suggestion: Snapshot showvminfo ,Suggestion for sub parameters of [-- machineadable].

Post by scottgus1 »

This is an interesting suggestion!

However, the difference between regular output and machinereadable output do not look that different to me from a script-driven parsing standpoint. Machinereadable would be good for both regular and snapshot showvminfo's, but regular output is quite usable by itself.

In machinereadable, you'd split each line output of the command on the =, and the first part is the data type, the second is the data.

In "humanreadable", you'd split on the :, the first part is the data type. Trim the second part of leading spaces to get the data.

I don't see anything in either output that wouldn't be beyond typical VBscript string manipulation. Note that machinereadable still requires string manipulation, unless the programming language has a datatype=data reader built-in. And if VBscript can do it, it's likely any programming language could do it. (DOS batch files might be a little harder to do it in, but I suspect it could still be done on either output.)
HaotongYang
Posts: 32
Joined: 25. Aug 2021, 21:39

Re: Suggestion: Snapshot showvminfo ,Suggestion for sub parameters of [-- machineadable].

Post by HaotongYang »

I understand, then I can only modify the third-party software code to achieve the purpose I want :shock:
Post Reply