Changeset 36630 in vbox for trunk/src/VBox
- Timestamp:
- Apr 8, 2011 6:41:51 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71093
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk
r34913 r36630 25 25 VBoxManage_SOURCES = \ 26 26 VBoxManage.cpp \ 27 28 27 VBoxManageHelp.cpp \ 28 $(if $(VBOX_WITH_GUEST_PROPS),VBoxManageGuestProp.cpp) \ 29 29 $(if $(VBOX_WITH_GUEST_CONTROL),VBoxManageGuestCtrl.cpp) 30 30 VBoxManage_LIBS += $(LIB_RUNTIME) … … 33 33 VBoxManage_DEFS.win = _WIN32_WINNT=0x0500 34 34 VBoxManage_SOURCES = \ 35 36 37 38 39 40 41 35 VBoxManage.cpp \ 36 VBoxInternalManage.cpp \ 37 VBoxManageControlVM.cpp \ 38 VBoxManageDebugVM.cpp \ 39 VBoxManageDHCPServer.cpp \ 40 VBoxManageDisk.cpp \ 41 $(if $(VBOX_WITH_GUEST_PROPS),VBoxManageGuestProp.cpp) \ 42 42 $(if $(VBOX_WITH_GUEST_CONTROL),VBoxManageGuestCtrl.cpp) \ 43 44 45 46 47 48 49 50 51 52 53 54 43 VBoxManageHelp.cpp \ 44 VBoxManageHostonly.cpp \ 45 VBoxManageAppliance.cpp \ 46 VBoxManageInfo.cpp \ 47 VBoxManageList.cpp \ 48 VBoxManageMetrics.cpp \ 49 VBoxManageMisc.cpp \ 50 VBoxManageModifyVM.cpp \ 51 VBoxManageSnapshot.cpp \ 52 VBoxManageStorageController.cpp \ 53 VBoxManageUSB.cpp \ 54 VBoxManageBandwidthControl.cpp 55 55 endif # !VBOX_ONLY_DOCS 56 56 57 57 VBoxManage_DEFS += \ 58 59 58 $(if $(VBOX_WITH_AHCI), VBOX_WITH_AHCI) \ 59 $(if $(VBOX_WITH_ALSA), VBOX_WITH_ALSA) \ 60 60 $(if $(VBOX_WITH_COPYTOGUEST),VBOX_WITH_COPYTOGUEST) \ 61 62 63 64 61 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000) \ 62 $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL) \ 63 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS) \ 64 $(if $(VBOX_WITH_HEADLESS), VBOX_WITH_HEADLESS) \ 65 65 $(if $(VBOX_WITH_HGCM), VBOX_WITH_HGCM) \ 66 66 $(if $(VBOX_WITH_HOSTNETIF_API), VBOX_WITH_HOSTNETIF_API) \ 67 67 $(if $(VBOX_WITH_NETFLT), VBOX_WITH_NETFLT) \ 68 69 70 71 72 68 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE) \ 69 $(if $(VBOX_WITH_SCSI), VBOX_WITH_SCSI) \ 70 $(if $(VBOX_WITH_SOLARIS_OSS), VBOX_WITH_SOLARIS_OSS) \ 71 $(if $(VBOX_WITH_VBOXSDL), VBOX_WITH_VBOXSDL) \ 72 $(if $(VBOX_WITH_VDE), VBOX_WITH_VDE) \ 73 73 $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL) \ 74 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO) 74 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO) \ 75 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH) 75 76 76 77 ifneq ($(KBUILD_TARGET),win) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r36279 r36630 151 151 " [--vram <vramsize in MB>]\n" 152 152 " [--acpi on|off]\n" 153 #ifdef VBOX_WITH_PCI_PASSTHROUGH 154 " [--attachpci 03:04.0]\n" 155 " [--attachpci 03:04.0@02:01.0]\n" 156 " [--detachpci 03:04.0]\n" 157 #endif 153 158 " [--ioapic on|off]\n" 154 159 " [--pae on|off]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r36114 r36630 29 29 30 30 #include <VBox/com/VirtualBox.h> 31 32 #ifdef VBOX_WITH_PCI_PASSTHROUGH 33 #include <VBox/pci.h> 34 #endif 31 35 32 36 #include <VBox/log.h> … … 1803 1807 } /* USB */ 1804 1808 1809 #ifdef VBOX_WITH_PCI_PASSTHROUGH 1810 /* Host PCI passthrough devices */ 1811 { 1812 SafeIfaceArray <IPciDeviceAttachment> assignments; 1813 rc = machine->COMGETTER(PciDeviceAssignments)(ComSafeArrayAsOutParam(assignments)); 1814 if (SUCCEEDED(rc)) 1815 { 1816 if (assignments.size() > 0 && (details != VMINFO_MACHINEREADABLE)) 1817 { 1818 RTPrintf("\nAttached physical PCI devices:\n\n"); 1819 } 1820 1821 for (size_t index = 0; index < assignments.size(); ++index) 1822 { 1823 ComPtr<IPciDeviceAttachment> Assignment = assignments[index]; 1824 char szHostPciAddress[32], szGuestPciAddress[32]; 1825 int32_t iHostPciAddress = -1, iGuestPciAddress = -1; 1826 Bstr DevName; 1827 1828 Assignment->COMGETTER(Name)(DevName.asOutParam()); 1829 Assignment->COMGETTER(HostAddress)(&iHostPciAddress); 1830 Assignment->COMGETTER(GuestAddress)(&iGuestPciAddress); 1831 PciBusAddress().fromLong(iHostPciAddress).format(szHostPciAddress, sizeof(szHostPciAddress)); 1832 PciBusAddress().fromLong(iGuestPciAddress).format(szGuestPciAddress, sizeof(szGuestPciAddress)); 1833 1834 if (details == VMINFO_MACHINEREADABLE) 1835 RTPrintf("AttachedHostPci=%s,%s\n", szHostPciAddress, szGuestPciAddress); 1836 else 1837 RTPrintf(" Host device %lS at %s attached as %s\n", DevName.raw(), szHostPciAddress, szGuestPciAddress); 1838 } 1839 1840 if (assignments.size() > 0 && (details != VMINFO_MACHINEREADABLE)) 1841 { 1842 RTPrintf("\n"); 1843 } 1844 } 1845 } 1846 /* Host PCI passthrough devices */ 1847 #endif 1848 1805 1849 /* 1806 1850 * Shared folders -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r36276 r36630 171 171 MODIFYVM_FAULT_TOLERANCE_SYNC_INTERVAL, 172 172 MODIFYVM_CPU_EXECTUION_CAP, 173 #ifdef VBOX_WITH_PCI_PASSTHROUGH 174 MODIFYVM_ATTACH_PCI, 175 MODIFYVM_DETACH_PCI, 176 #endif 173 177 MODIFYVM_CHIPSET 174 178 }; … … 299 303 { "--faulttolerancesyncinterval", MODIFYVM_FAULT_TOLERANCE_SYNC_INTERVAL, RTGETOPT_REQ_UINT32 }, 300 304 { "--chipset", MODIFYVM_CHIPSET, RTGETOPT_REQ_STRING }, 305 #ifdef VBOX_WITH_PCI_PASSTHROUGH 306 { "--attachpci", MODIFYVM_ATTACH_PCI, RTGETOPT_REQ_STRING }, 307 { "--detachpci", MODIFYVM_DETACH_PCI, RTGETOPT_REQ_STRING }, 308 #endif 301 309 }; 302 310 … … 306 314 } 307 315 316 /** Parse PCI address in format 01:02.03 and convert it to the numeric representation. */ 317 static int32_t parsePci(const char* szPciAddr) 318 { 319 char* pszNext = (char*)szPciAddr; 320 int rc; 321 uint8_t aVals[3] = {0, 0, 0}; 322 323 rc = RTStrToUInt8Ex(pszNext, &pszNext, 16, &aVals[0]); 324 if (RT_FAILURE(rc) || pszNext == NULL || *pszNext != ':') 325 return -1; 326 327 rc = RTStrToUInt8Ex(pszNext+1, &pszNext, 16, &aVals[1]); 328 if (RT_FAILURE(rc) || pszNext == NULL || *pszNext != '.') 329 return -1; 330 331 rc = RTStrToUInt8Ex(pszNext+1, &pszNext, 16, &aVals[2]); 332 if (RT_FAILURE(rc) || pszNext == NULL) 333 return -1; 334 335 return (aVals[0] << 8) | (aVals[1] << 3) | (aVals[2] << 0); 336 } 308 337 309 338 int handleModifyVM(HandlerArg *a) … … 2178 2207 break; 2179 2208 } 2180 2209 #ifdef VBOX_WITH_PCI_PASSTHROUGH 2210 case MODIFYVM_ATTACH_PCI: 2211 { 2212 const char* pAt = strchr(ValueUnion.psz, '@'); 2213 int32_t iHostAddr, iGuestAddr; 2214 2215 iHostAddr = parsePci(ValueUnion.psz); 2216 iGuestAddr = pAt != NULL ? parsePci(pAt + 1) : iHostAddr; 2217 2218 if (iHostAddr == -1 || iGuestAddr == -1) 2219 { 2220 errorArgument("Invalid --attachpci argument '%s' (valid: 'HB:HD.HF@GB:GD.GF' or just 'HB:HD.HF')", ValueUnion.psz); 2221 rc = E_FAIL; 2222 } 2223 else 2224 { 2225 CHECK_ERROR(machine, AttachHostPciDevice(iHostAddr, iGuestAddr, TRUE)); 2226 } 2227 2228 break; 2229 } 2230 case MODIFYVM_DETACH_PCI: 2231 { 2232 int32_t iHostAddr; 2233 2234 iHostAddr = parsePci(ValueUnion.psz); 2235 if (iHostAddr == -1) 2236 { 2237 errorArgument("Invalid --detachpci argument '%s' (valid: 'HB:HD.HF')", ValueUnion.psz); 2238 rc = E_FAIL; 2239 } 2240 else 2241 { 2242 CHECK_ERROR(machine, DetachHostPciDevice(iHostAddr)); 2243 } 2244 2245 break; 2246 } 2247 #endif 2181 2248 default: 2182 2249 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r36615 r36630 4704 4704 and most information will be delivered as IHostPciDevicePlugEvent 4705 4705 on IVirtualBox event source. 4706 <note>4707 Not yet implemented.4708 </note>4709 4706 4710 4707 <see>IHostPciDevicePlugEvent</see> … … 4738 4735 will be delivered. As currently we don't support hot device 4739 4736 unplug, IHostPciDevicePlugEvent event is delivered immediately. 4740 4741 <note>4742 Not yet implemented.4743 </note>4744 4737 4745 4738 <see>IHostPciDevicePlugEvent</see> -
trunk/src/VBox/Main/src-client/BusAssignmentManager.cpp
r36107 r36630 376 376 const DeviceAssignmentRule* rule = matchingRules[iRule]; 377 377 378 Address. iBus = rule->iBus;379 Address. iDevice = rule->iDevice;380 Address. iFn = rule->iFn;378 Address.miBus = rule->iBus; 379 Address.miDevice = rule->iDevice; 380 Address.miFn = rule->iFn; 381 381 382 382 if (checkAvailable(Address)) 383 383 return S_OK; 384 384 } 385 AssertMsg (false,("All possible candidate positions for %s exhausted\n", pszName));385 AssertMsgFailed(("All possible candidate positions for %s exhausted\n", pszName)); 386 386 387 387 return E_INVALIDARG; … … 490 490 return rc; 491 491 492 rc = InsertConfigInteger(pCfg, "PCIBusNo", GuestAddress. iBus);492 rc = InsertConfigInteger(pCfg, "PCIBusNo", GuestAddress.miBus); 493 493 if (FAILED(rc)) 494 494 return rc; 495 rc = InsertConfigInteger(pCfg, "PCIDeviceNo", GuestAddress. iDevice);495 rc = InsertConfigInteger(pCfg, "PCIDeviceNo", GuestAddress.miDevice); 496 496 if (FAILED(rc)) 497 497 return rc; 498 rc = InsertConfigInteger(pCfg, "PCIFunctionNo", GuestAddress. iFn);498 rc = InsertConfigInteger(pCfg, "PCIFunctionNo", GuestAddress.miFn); 499 499 if (FAILED(rc)) 500 500 return rc; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r36559 r36630 485 485 Assert(GuestPciAddress.valid()); 486 486 487 if (GuestPciAddress. iBus > 0)487 if (GuestPciAddress.miBus > 0) 488 488 { 489 489 int iBridgesMissed = 0; 490 int iBase = GuestPciAddress. iBus - 1;490 int iBase = GuestPciAddress.miBus - 1; 491 491 492 492 while (!BusMgr->hasPciDevice("ich9pcibridge", iBase) && iBase > 0) … … 547 547 548 548 InsertConfigInteger(pCfg, "DetachHostDriver", 1); 549 InsertConfigInteger(pCfg, "HostPCIBusNo", HostPciAddress. iBus);550 InsertConfigInteger(pCfg, "HostPCIDeviceNo", HostPciAddress. iDevice);551 InsertConfigInteger(pCfg, "HostPCIFunctionNo", HostPciAddress. iFn);549 InsertConfigInteger(pCfg, "HostPCIBusNo", HostPciAddress.miBus); 550 InsertConfigInteger(pCfg, "HostPCIDeviceNo", HostPciAddress.miDevice); 551 InsertConfigInteger(pCfg, "HostPCIFunctionNo", HostPciAddress.miFn); 552 552 553 553 GuestPciAddress.fromLong(guest); … … 557 557 return hrc; 558 558 559 InsertConfigInteger(pCfg, "GuestPCIBusNo", GuestPciAddress. iBus);560 InsertConfigInteger(pCfg, "GuestPCIDeviceNo", GuestPciAddress. iDevice);561 InsertConfigInteger(pCfg, "GuestPCIFunctionNo", GuestPciAddress. iFn);559 InsertConfigInteger(pCfg, "GuestPCIBusNo", GuestPciAddress.miBus); 560 InsertConfigInteger(pCfg, "GuestPCIDeviceNo", GuestPciAddress.miDevice); 561 InsertConfigInteger(pCfg, "GuestPCIFunctionNo", GuestPciAddress.miFn); 562 562 563 563 /* the Main driver */ … … 1880 1880 InsertConfigNode(pNetBootCfg, achBootIdx, &pNetBtDevCfg); 1881 1881 InsertConfigInteger(pNetBtDevCfg, "NIC", it->mInstance); 1882 InsertConfigInteger(pNetBtDevCfg, "PCIBusNo", it->mPciAddress. iBus);1883 InsertConfigInteger(pNetBtDevCfg, "PCIDeviceNo", it->mPciAddress. iDevice);1884 InsertConfigInteger(pNetBtDevCfg, "PCIFunctionNo", it->mPciAddress. iFn);1882 InsertConfigInteger(pNetBtDevCfg, "PCIBusNo", it->mPciAddress.miBus); 1883 InsertConfigInteger(pNetBtDevCfg, "PCIDeviceNo", it->mPciAddress.miDevice); 1884 InsertConfigInteger(pNetBtDevCfg, "PCIFunctionNo", it->mPciAddress.miFn); 1885 1885 } 1886 1886 } … … 2509 2509 { 2510 2510 BootNic aNic = llBootNics.front(); 2511 uint32_t u32NicPciAddr = (aNic.mPciAddress. iDevice << 16) | aNic.mPciAddress.iFn;2511 uint32_t u32NicPciAddr = (aNic.mPciAddress.miDevice << 16) | aNic.mPciAddress.miFn; 2512 2512 InsertConfigInteger(pCfg, "NicPciAddress", u32NicPciAddr); 2513 2513 } … … 2517 2517 if (BusMgr->findPciAddress("hda", 0, Address)) 2518 2518 { 2519 uint32_t u32AudioPciAddr = (Address. iDevice << 16) | Address.iFn;2519 uint32_t u32AudioPciAddr = (Address.miDevice << 16) | Address.miFn; 2520 2520 InsertConfigInteger(pCfg, "AudioPciAddress", u32AudioPciAddr); 2521 2521 } -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r36451 r36630 5933 5933 fireHostPciDevicePlugEvent(es, mid.raw(), false /* unplugged */, true /* success */, pAttach, NULL); 5934 5934 } 5935 5936 return S_OK; 5935 5936 return fRemoved ? S_OK : setError(VBOX_E_OBJECT_NOT_FOUND, 5937 tr("No host PCI device %08x attached"), 5938 hostAddress 5939 ); 5937 5940 } 5938 5941
Note:
See TracChangeset
for help on using the changeset viewer.