VM Functions and System devices.

This commit is contained in:
SimonFair
2025-04-05 22:08:43 +01:00
parent 932a1ed078
commit 37e03531de
8 changed files with 147 additions and 22 deletions
@@ -2257,6 +2257,18 @@ class Libvirt {
return ['pci' => $devs_pci, 'usb' => $devs_usb];
}
function domain_get_vm_pciids($domain) {
$hostdevs=$this->domain_get_host_devices_pci($domain);
$vmpcidevs=[];
foreach($hostdevs as $key => $dev) {
$vmpcidevs[$dev['id']] = [
'vendor_id' => ltrim($dev['vendor_id'], '0x'),
'device_id' => ltrim($dev['product_id'], '0x'),
];
}
return $vmpcidevs;
}
function get_nic_info($domain) {
$macs = $this->get_xpath($domain, "//domain/devices/interface/mac/@address", false);
if (!$macs) return $this->_set_last_error();