mirror of
git://git.proxmox.com/git/pve-qemu.git
synced 2024-12-22 17:35:52 +03:00
6503e6e08d
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
28 lines
496 B
Perl
Executable File
28 lines
496 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
use strict;
|
|
|
|
use JSON;
|
|
|
|
my $machines = [];
|
|
|
|
while (<STDIN>) {
|
|
if (/^\s*Supported machines are:/) {
|
|
next;
|
|
}
|
|
|
|
s/^\s+//;
|
|
my @machine = split(/\s+/);
|
|
next if $machine[0] !~ m/^pc-(i440fx|q35)-(.+)$/;
|
|
push @$machines, {
|
|
'id' => $machine[0],
|
|
'type' => $1,
|
|
'version' => $2,
|
|
};
|
|
}
|
|
|
|
die "no QEMU machine types detected from STDIN input" if scalar (@$machines) <= 0;
|
|
|
|
print to_json($machines, { utf8 => 1 }) or die "$!\n";
|