Revision 8754dc49 src/vm/VirtualMachine.cc
src/vm/VirtualMachine.cc | ||
---|---|---|
1202 | 1202 |
/* -------------------------------------------------------------------------- */ |
1203 | 1203 |
/* -------------------------------------------------------------------------- */ |
1204 | 1204 |
|
1205 |
static int check_pci_attributes(VectorAttribute * pci, string& error_str) |
|
1205 |
static int check_pci_attributes(VectorAttribute * pci, const string& default_bus, |
|
1206 |
string& error_str) |
|
1206 | 1207 |
{ |
1207 | 1208 |
static string attrs[] = {"VENDOR", "DEVICE", "CLASS"}; |
1208 | 1209 |
static int num_attrs = 3; |
1209 | 1210 |
|
1210 |
bool found = false; |
|
1211 |
string bus; |
|
1212 |
bool found = false; |
|
1211 | 1213 |
|
1212 | 1214 |
for (int i = 0; i < num_attrs; i++) |
1213 | 1215 |
{ |
... | ... | |
1231 | 1233 |
return -1; |
1232 | 1234 |
} |
1233 | 1235 |
|
1236 |
if ( HostSharePCI::set_pci_address(pci, default_bus) != 0 ) |
|
1237 |
{ |
|
1238 |
error_str = "Wrong BUS in PCI attribute"; |
|
1239 |
return -1; |
|
1240 |
} |
|
1241 |
|
|
1234 | 1242 |
return 0; |
1235 | 1243 |
} |
1236 | 1244 |
|
... | ... | |
1250 | 1258 |
obj_template->set(*it); |
1251 | 1259 |
} |
1252 | 1260 |
|
1261 |
Nebula& nd = Nebula::instance(); |
|
1262 |
string default_bus; |
|
1263 |
|
|
1264 |
nd.get_configuration_attribute("PCI_PASSTHROUGH_BUS", default_bus); |
|
1265 |
|
|
1253 | 1266 |
for (it = array_pci.begin(); it !=array_pci.end(); ++it) |
1254 | 1267 |
{ |
1255 |
if ( check_pci_attributes(*it, error_str) != 0 ) |
|
1268 |
if ( check_pci_attributes(*it, default_bus, error_str) != 0 )
|
|
1256 | 1269 |
{ |
1257 | 1270 |
return -1; |
1258 | 1271 |
} |
Also available in: Unified diff