since usb devices do not have their own
"query" command in qmp, we have to use
qom-list /machines/peripheral
which essentially gets a list of peripheral devices of
the vm
there we only get the usb devices
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
}
}
+ # for usb devices there is no query-usb
+ # but we can iterate over the entries in
+ # qom-list path=/machine/peripheral
+ my $resperipheral = vm_mon_cmd($vmid, 'qom-list', path => '/machine/peripheral');
+ foreach my $per (@$resperipheral) {
+ if ($per->{name} =~ m/^usb\d+$/) {
+ $devices->{$per->{name}} = 1;
+ }
+ }
+
return $devices;
}