Changeset 36107 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Feb 28, 2011 6:24:32 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70264
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/BusAssignmentManager.cpp
r35368 r36107 219 219 struct PciDeviceRecord 220 220 { 221 char szDevName[32]; 221 char szDevName[32]; 222 PciBusAddress HostAddress; 223 224 PciDeviceRecord(const char* pszName, PciBusAddress aHostAddress) 225 { 226 RTStrCopy(this->szDevName, sizeof(szDevName), pszName); 227 this->HostAddress = aHostAddress; 228 } 222 229 223 230 PciDeviceRecord(const char* pszName) 224 231 { 225 RTStrCopy( szDevName, sizeof(szDevName), pszName);232 RTStrCopy(this->szDevName, sizeof(szDevName), pszName); 226 233 } 227 234 … … 255 262 HRESULT init(ChipsetType_T chipsetType); 256 263 257 HRESULT record(const char* pszName, PciBusAddress& Address);264 HRESULT record(const char* pszName, PciBusAddress& GuestAddress, PciBusAddress HostAddress); 258 265 HRESULT autoAssign(const char* pszName, PciBusAddress& Address); 259 266 bool checkAvailable(PciBusAddress& Address); … … 271 278 } 272 279 273 HRESULT BusAssignmentManager::State::record(const char* pszName, PciBusAddress& Address )274 { 275 PciDeviceRecord devRec(pszName );280 HRESULT BusAssignmentManager::State::record(const char* pszName, PciBusAddress& Address, PciBusAddress HostAddress) 281 { 282 PciDeviceRecord devRec(pszName, HostAddress); 276 283 277 284 /* Remember address -> device mapping */ … … 399 406 dev.createObject(); 400 407 com::Bstr devname(it->second.szDevName); 401 dev->init(NULL, devname, -1, it->first.asLong(), FALSE); 408 dev->init(NULL, devname, 409 it->second.HostAddress.valid() ? it->second.HostAddress.asLong() : -1, 410 it->first.asLong(), it->second.HostAddress.valid()); 402 411 result.setElement(iIndex++, dev); 403 412 } … … 449 458 } 450 459 451 HRESULT BusAssignmentManager::assignPciDevice(const char* pszDevName, PCFGMNODE pCfg, 452 PciBusAddress& Address, bool fAddressRequired) 460 HRESULT BusAssignmentManager::assignPciDeviceImpl(const char* pszDevName, 461 PCFGMNODE pCfg, 462 PciBusAddress& GuestAddress, 463 PciBusAddress HostAddress, 464 bool fGuestAddressRequired) 453 465 { 454 466 HRESULT rc = S_OK; 455 467 456 if (! Address.valid())457 rc = pState->autoAssign(pszDevName, Address);468 if (!GuestAddress.valid()) 469 rc = pState->autoAssign(pszDevName, GuestAddress); 458 470 else 459 471 { 460 bool fAvailable = pState->checkAvailable( Address);472 bool fAvailable = pState->checkAvailable(GuestAddress); 461 473 462 474 if (!fAvailable) 463 475 { 464 if (f AddressRequired)476 if (fGuestAddressRequired) 465 477 rc = E_ACCESSDENIED; 466 478 else 467 rc = pState->autoAssign(pszDevName, Address);479 rc = pState->autoAssign(pszDevName, GuestAddress); 468 480 } 469 481 } … … 472 484 return rc; 473 485 474 Assert( Address.valid() && pState->checkAvailable(Address));475 476 rc = pState->record(pszDevName, Address);486 Assert(GuestAddress.valid() && pState->checkAvailable(GuestAddress)); 487 488 rc = pState->record(pszDevName, GuestAddress, HostAddress); 477 489 if (FAILED(rc)) 478 490 return rc; 479 491 480 rc = InsertConfigInteger(pCfg, "PCIBusNo", 492 rc = InsertConfigInteger(pCfg, "PCIBusNo", GuestAddress.iBus); 481 493 if (FAILED(rc)) 482 494 return rc; 483 rc = InsertConfigInteger(pCfg, "PCIDeviceNo", 495 rc = InsertConfigInteger(pCfg, "PCIDeviceNo", GuestAddress.iDevice); 484 496 if (FAILED(rc)) 485 497 return rc; 486 rc = InsertConfigInteger(pCfg, "PCIFunctionNo", 498 rc = InsertConfigInteger(pCfg, "PCIFunctionNo", GuestAddress.iFn); 487 499 if (FAILED(rc)) 488 500 return rc; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r36082 r36107 532 532 GuestPciAddress.fromLong(guest); 533 533 Assert(GuestPciAddress.valid()); 534 hrc = BusMgr->assign PciDevice("pciraw", pInst, GuestPciAddress, true);534 hrc = BusMgr->assignHostPciDevice("pciraw", pInst, HostPciAddress, GuestPciAddress, true); 535 535 if (hrc != S_OK) 536 536 return hrc;
Note:
See TracChangeset
for help on using the changeset viewer.