[pve-devel] [PATCH 11/11] hostpci rework

Dietmar Maurer dietmar at proxmox.com
Thu Sep 8 09:40:17 CEST 2011


> -add MAX_HOSTPCI_DEVICES=2 (can be tuned later)
> 
> -change code to support 1 line by device
> hostpci0: ...
> hostpci1: ...
> 
> -add device id.
> 
> Need be be fixed:
> - check iommu support before adding devices
> - unmap device from host kernel driver before add

There is already some code to do that:

	my ($cmd, $vollist) = config_to_command ($storecfg, $vmid, $conf, $defaults, $migrate_uri);
	# host pci devices
	if (my $pcidl = $conf->{hostpci}) {
	    my @dl = split (/,/, $pcidl);
	    foreach my $dev (@dl) {
		$dev = lc($dev);
		my $info = pci_device_info("0000:$dev");
		die "no pci device info for device '$dev'\n" if !$info;
		die "can't unbind pci device '$dev'\n" if !pci_dev_bind_to_stub($info);
		die "can't reset pci device '$dev'\n" if !pci_dev_reset($info);
	    }
	}

You need to fix that first (handle the new syntax)

- Dietmar





More information about the pve-devel mailing list