Changeset 42748 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 10, 2012 9:33:34 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r42551 r42748 74 74 } 75 75 76 static void listMedia(const ComPtr<IVirtualBox> aVirtualBox, 77 const com::SafeIfaceArray<IMedium> &aMedia, 78 const char *pszParentUUIDStr) 76 77 /** 78 * List network interfaces information (bridged/host only). 79 * 80 * @returns See produceList. 81 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 82 */ 83 static HRESULT listNetworkInterfaces(const ComPtr<IVirtualBox> pVirtualBox, 84 bool fIsBridged) 79 85 { 80 86 HRESULT rc; 87 ComPtr<IHost> host; 88 CHECK_ERROR(pVirtualBox, COMGETTER(Host)(host.asOutParam())); 89 com::SafeIfaceArray<IHostNetworkInterface> hostNetworkInterfaces; 90 #if defined(VBOX_WITH_NETFLT) 91 if (fIsBridged) 92 CHECK_ERROR(host, FindHostNetworkInterfacesOfType(HostNetworkInterfaceType_Bridged, 93 ComSafeArrayAsOutParam(hostNetworkInterfaces))); 94 else 95 CHECK_ERROR(host, FindHostNetworkInterfacesOfType(HostNetworkInterfaceType_HostOnly, 96 ComSafeArrayAsOutParam(hostNetworkInterfaces))); 97 #else 98 CHECK_ERROR(host, COMGETTER(NetworkInterfaces)(ComSafeArrayAsOutParam(hostNetworkInterfaces))); 99 #endif 100 for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i) 101 { 102 ComPtr<IHostNetworkInterface> networkInterface = hostNetworkInterfaces[i]; 103 #ifndef VBOX_WITH_HOSTNETIF_API 104 Bstr interfaceName; 105 networkInterface->COMGETTER(Name)(interfaceName.asOutParam()); 106 RTPrintf("Name: %ls\n", interfaceName.raw()); 107 Guid interfaceGuid; 108 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 109 RTPrintf("GUID: %ls\n\n", Bstr(interfaceGuid.toString()).raw()); 110 #else /* VBOX_WITH_HOSTNETIF_API */ 111 Bstr interfaceName; 112 networkInterface->COMGETTER(Name)(interfaceName.asOutParam()); 113 RTPrintf("Name: %ls\n", interfaceName.raw()); 114 Bstr interfaceGuid; 115 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 116 RTPrintf("GUID: %ls\n", interfaceGuid.raw()); 117 BOOL bDHCPEnabled; 118 networkInterface->COMGETTER(DHCPEnabled)(&bDHCPEnabled); 119 RTPrintf("DHCP: %s\n", bDHCPEnabled ? "Enabled" : "Disabled"); 120 121 Bstr IPAddress; 122 networkInterface->COMGETTER(IPAddress)(IPAddress.asOutParam()); 123 RTPrintf("IPAddress: %ls\n", IPAddress.raw()); 124 Bstr NetworkMask; 125 networkInterface->COMGETTER(NetworkMask)(NetworkMask.asOutParam()); 126 RTPrintf("NetworkMask: %ls\n", NetworkMask.raw()); 127 Bstr IPV6Address; 128 networkInterface->COMGETTER(IPV6Address)(IPV6Address.asOutParam()); 129 RTPrintf("IPV6Address: %ls\n", IPV6Address.raw()); 130 ULONG IPV6NetworkMaskPrefixLength; 131 networkInterface->COMGETTER(IPV6NetworkMaskPrefixLength)(&IPV6NetworkMaskPrefixLength); 132 RTPrintf("IPV6NetworkMaskPrefixLength: %d\n", IPV6NetworkMaskPrefixLength); 133 Bstr HardwareAddress; 134 networkInterface->COMGETTER(HardwareAddress)(HardwareAddress.asOutParam()); 135 RTPrintf("HardwareAddress: %ls\n", HardwareAddress.raw()); 136 HostNetworkInterfaceMediumType_T Type; 137 networkInterface->COMGETTER(MediumType)(&Type); 138 RTPrintf("MediumType: %s\n", getHostIfMediumTypeText(Type)); 139 HostNetworkInterfaceStatus_T Status; 140 networkInterface->COMGETTER(Status)(&Status); 141 RTPrintf("Status: %s\n", getHostIfStatusText(Status)); 142 Bstr netName; 143 networkInterface->COMGETTER(NetworkName)(netName.asOutParam()); 144 RTPrintf("VBoxNetworkName: %ls\n\n", netName.raw()); 145 #endif 146 } 147 return rc; 148 } 149 150 151 /** 152 * List host information. 153 * 154 * @returns See produceList. 155 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 156 */ 157 static HRESULT listHostInfo(const ComPtr<IVirtualBox> pVirtualBox) 158 { 159 HRESULT rc; 160 ComPtr<IHost> Host; 161 CHECK_ERROR(pVirtualBox, COMGETTER(Host)(Host.asOutParam())); 162 163 RTPrintf("Host Information:\n\n"); 164 165 LONG64 u64UtcTime = 0; 166 CHECK_ERROR(Host, COMGETTER(UTCTime)(&u64UtcTime)); 167 RTTIMESPEC timeSpec; 168 char szTime[32]; 169 RTPrintf("Host time: %s\n", RTTimeSpecToString(RTTimeSpecSetMilli(&timeSpec, u64UtcTime), szTime, sizeof(szTime))); 170 171 ULONG processorOnlineCount = 0; 172 CHECK_ERROR(Host, COMGETTER(ProcessorOnlineCount)(&processorOnlineCount)); 173 RTPrintf("Processor online count: %lu\n", processorOnlineCount); 174 ULONG processorCount = 0; 175 CHECK_ERROR(Host, COMGETTER(ProcessorCount)(&processorCount)); 176 RTPrintf("Processor count: %lu\n", processorCount); 177 ULONG processorSpeed = 0; 178 Bstr processorDescription; 179 for (ULONG i = 0; i < processorCount; i++) 180 { 181 CHECK_ERROR(Host, GetProcessorSpeed(i, &processorSpeed)); 182 if (processorSpeed) 183 RTPrintf("Processor#%u speed: %lu MHz\n", i, processorSpeed); 184 else 185 RTPrintf("Processor#%u speed: unknown\n", i, processorSpeed); 186 CHECK_ERROR(Host, GetProcessorDescription(i, processorDescription.asOutParam())); 187 RTPrintf("Processor#%u description: %ls\n", i, processorDescription.raw()); 188 } 189 190 ULONG memorySize = 0; 191 CHECK_ERROR(Host, COMGETTER(MemorySize)(&memorySize)); 192 RTPrintf("Memory size: %lu MByte\n", memorySize); 193 194 ULONG memoryAvailable = 0; 195 CHECK_ERROR(Host, COMGETTER(MemoryAvailable)(&memoryAvailable)); 196 RTPrintf("Memory available: %lu MByte\n", memoryAvailable); 197 198 Bstr operatingSystem; 199 CHECK_ERROR(Host, COMGETTER(OperatingSystem)(operatingSystem.asOutParam())); 200 RTPrintf("Operating system: %ls\n", operatingSystem.raw()); 201 202 Bstr oSVersion; 203 CHECK_ERROR(Host, COMGETTER(OSVersion)(oSVersion.asOutParam())); 204 RTPrintf("Operating system version: %ls\n", oSVersion.raw()); 205 return rc; 206 } 207 208 209 /** 210 * List media information. 211 * 212 * @returns See produceList. 213 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 214 */ 215 static HRESULT listMedia(const ComPtr<IVirtualBox> pVirtualBox, 216 const com::SafeIfaceArray<IMedium> &aMedia, 217 const char *pszParentUUIDStr) 218 { 219 HRESULT rc = S_OK; 81 220 for (size_t i = 0; i < aMedia.size(); ++i) 82 221 { … … 154 293 { 155 294 ComPtr<IMachine> machine; 156 CHECK_ERROR( aVirtualBox, FindMachine(machineIds[j], machine.asOutParam()));295 CHECK_ERROR(pVirtualBox, FindMachine(machineIds[j], machine.asOutParam())); 157 296 ASSERT(machine); 158 297 Bstr name; … … 184 323 { 185 324 // depth first listing of child media 186 listMedia(aVirtualBox, children, Utf8Str(uuid).c_str()); 187 } 188 } 325 rc = listMedia(pVirtualBox, children, Utf8Str(uuid).c_str()); 326 } 327 } 328 329 return rc; 330 } 331 332 333 /** 334 * List virtual image backends. 335 * 336 * @returns See produceList. 337 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 338 */ 339 static HRESULT listHddBackends(const ComPtr<IVirtualBox> pVirtualBox) 340 { 341 HRESULT rc; 342 ComPtr<ISystemProperties> systemProperties; 343 CHECK_ERROR(pVirtualBox, COMGETTER(SystemProperties)(systemProperties.asOutParam())); 344 com::SafeIfaceArray<IMediumFormat> mediumFormats; 345 CHECK_ERROR(systemProperties, COMGETTER(MediumFormats)(ComSafeArrayAsOutParam(mediumFormats))); 346 347 RTPrintf("Supported hard disk backends:\n\n"); 348 for (size_t i = 0; i < mediumFormats.size(); ++i) 349 { 350 /* General information */ 351 Bstr id; 352 CHECK_ERROR(mediumFormats[i], COMGETTER(Id)(id.asOutParam())); 353 354 Bstr description; 355 CHECK_ERROR(mediumFormats[i], 356 COMGETTER(Id)(description.asOutParam())); 357 358 ULONG caps; 359 CHECK_ERROR(mediumFormats[i], 360 COMGETTER(Capabilities)(&caps)); 361 362 RTPrintf("Backend %u: id='%ls' description='%ls' capabilities=%#06x extensions='", 363 i, id.raw(), description.raw(), caps); 364 365 /* File extensions */ 366 com::SafeArray <BSTR> fileExtensions; 367 com::SafeArray <DeviceType_T> deviceTypes; 368 CHECK_ERROR(mediumFormats[i], 369 DescribeFileExtensions(ComSafeArrayAsOutParam(fileExtensions), ComSafeArrayAsOutParam(deviceTypes))); 370 for (size_t j = 0; j < fileExtensions.size(); ++j) 371 { 372 RTPrintf("%ls (%s)", Bstr(fileExtensions[j]).raw(), getDeviceTypeText(deviceTypes[j])); 373 if (j != fileExtensions.size()-1) 374 RTPrintf(","); 375 } 376 RTPrintf("'"); 377 378 /* Configuration keys */ 379 com::SafeArray <BSTR> propertyNames; 380 com::SafeArray <BSTR> propertyDescriptions; 381 com::SafeArray <DataType_T> propertyTypes; 382 com::SafeArray <ULONG> propertyFlags; 383 com::SafeArray <BSTR> propertyDefaults; 384 CHECK_ERROR(mediumFormats[i], 385 DescribeProperties(ComSafeArrayAsOutParam(propertyNames), 386 ComSafeArrayAsOutParam(propertyDescriptions), 387 ComSafeArrayAsOutParam(propertyTypes), 388 ComSafeArrayAsOutParam(propertyFlags), 389 ComSafeArrayAsOutParam(propertyDefaults))); 390 391 RTPrintf(" properties=("); 392 if (propertyNames.size() > 0) 393 { 394 for (size_t j = 0; j < propertyNames.size(); ++j) 395 { 396 RTPrintf("\n name='%ls' desc='%ls' type=", 397 Bstr(propertyNames[j]).raw(), Bstr(propertyDescriptions[j]).raw()); 398 switch (propertyTypes[j]) 399 { 400 case DataType_Int32: RTPrintf("int"); break; 401 case DataType_Int8: RTPrintf("byte"); break; 402 case DataType_String: RTPrintf("string"); break; 403 } 404 RTPrintf(" flags=%#04x", propertyFlags[j]); 405 RTPrintf(" default='%ls'", Bstr(propertyDefaults[j]).raw()); 406 if (j != propertyNames.size()-1) 407 RTPrintf(", "); 408 } 409 } 410 RTPrintf(")\n"); 411 } 412 return rc; 413 } 414 415 416 /** 417 * List USB devices attached to the host. 418 * 419 * @returns See produceList. 420 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 421 */ 422 static HRESULT listUsbHost(const ComPtr<IVirtualBox> &pVirtualBox) 423 { 424 HRESULT rc; 425 ComPtr<IHost> Host; 426 CHECK_ERROR_RET(pVirtualBox, COMGETTER(Host)(Host.asOutParam()), 1); 427 428 SafeIfaceArray<IHostUSBDevice> CollPtr; 429 CHECK_ERROR_RET(Host, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(CollPtr)), 1); 430 431 RTPrintf("Host USB Devices:\n\n"); 432 433 if (CollPtr.size() == 0) 434 { 435 RTPrintf("<none>\n\n"); 436 } 437 else 438 { 439 for (size_t i = 0; i < CollPtr.size(); ++i) 440 { 441 ComPtr <IHostUSBDevice> dev = CollPtr[i]; 442 443 /* Query info. */ 444 Bstr id; 445 CHECK_ERROR_RET(dev, COMGETTER(Id)(id.asOutParam()), 1); 446 USHORT usVendorId; 447 CHECK_ERROR_RET(dev, COMGETTER(VendorId)(&usVendorId), 1); 448 USHORT usProductId; 449 CHECK_ERROR_RET(dev, COMGETTER(ProductId)(&usProductId), 1); 450 USHORT bcdRevision; 451 CHECK_ERROR_RET(dev, COMGETTER(Revision)(&bcdRevision), 1); 452 USHORT usPort; 453 CHECK_ERROR_RET(dev, COMGETTER(Port)(&usPort), 1); 454 USHORT usVersion; 455 CHECK_ERROR_RET(dev, COMGETTER(Version)(&usVersion), 1); 456 USHORT usPortVersion; 457 CHECK_ERROR_RET(dev, COMGETTER(PortVersion)(&usPortVersion), 1); 458 459 RTPrintf("UUID: %s\n" 460 "VendorId: %#06x (%04X)\n" 461 "ProductId: %#06x (%04X)\n" 462 "Revision: %u.%u (%02u%02u)\n" 463 "Port: %u\n" 464 "USB version/speed: %u/%u\n", 465 Utf8Str(id).c_str(), 466 usVendorId, usVendorId, usProductId, usProductId, 467 bcdRevision >> 8, bcdRevision & 0xff, 468 bcdRevision >> 8, bcdRevision & 0xff, 469 usPort, usVersion, usPortVersion); 470 471 /* optional stuff. */ 472 Bstr bstr; 473 CHECK_ERROR_RET(dev, COMGETTER(Manufacturer)(bstr.asOutParam()), 1); 474 if (!bstr.isEmpty()) 475 RTPrintf("Manufacturer: %ls\n", bstr.raw()); 476 CHECK_ERROR_RET(dev, COMGETTER(Product)(bstr.asOutParam()), 1); 477 if (!bstr.isEmpty()) 478 RTPrintf("Product: %ls\n", bstr.raw()); 479 CHECK_ERROR_RET(dev, COMGETTER(SerialNumber)(bstr.asOutParam()), 1); 480 if (!bstr.isEmpty()) 481 RTPrintf("SerialNumber: %ls\n", bstr.raw()); 482 CHECK_ERROR_RET(dev, COMGETTER(Address)(bstr.asOutParam()), 1); 483 if (!bstr.isEmpty()) 484 RTPrintf("Address: %ls\n", bstr.raw()); 485 486 /* current state */ 487 USBDeviceState_T state; 488 CHECK_ERROR_RET(dev, COMGETTER(State)(&state), 1); 489 const char *pszState = "?"; 490 switch (state) 491 { 492 case USBDeviceState_NotSupported: 493 pszState = "Not supported"; 494 break; 495 case USBDeviceState_Unavailable: 496 pszState = "Unavailable"; 497 break; 498 case USBDeviceState_Busy: 499 pszState = "Busy"; 500 break; 501 case USBDeviceState_Available: 502 pszState = "Available"; 503 break; 504 case USBDeviceState_Held: 505 pszState = "Held"; 506 break; 507 case USBDeviceState_Captured: 508 pszState = "Captured"; 509 break; 510 default: 511 ASSERT(false); 512 break; 513 } 514 RTPrintf("Current State: %s\n\n", pszState); 515 } 516 } 517 return rc; 518 } 519 520 521 /** 522 * List USB filters. 523 * 524 * @returns See produceList. 525 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 526 */ 527 static HRESULT listUsbFilters(const ComPtr<IVirtualBox> &pVirtualBox) 528 { 529 HRESULT rc; 530 531 RTPrintf("Global USB Device Filters:\n\n"); 532 533 ComPtr<IHost> host; 534 CHECK_ERROR_RET(pVirtualBox, COMGETTER(Host)(host.asOutParam()), 1); 535 536 SafeIfaceArray<IHostUSBDeviceFilter> coll; 537 CHECK_ERROR_RET(host, COMGETTER(USBDeviceFilters)(ComSafeArrayAsOutParam(coll)), 1); 538 539 if (coll.size() == 0) 540 { 541 RTPrintf("<none>\n\n"); 542 } 543 else 544 { 545 for (size_t index = 0; index < coll.size(); ++index) 546 { 547 ComPtr<IHostUSBDeviceFilter> flt = coll[index]; 548 549 /* Query info. */ 550 551 RTPrintf("Index: %zu\n", index); 552 553 BOOL active = FALSE; 554 CHECK_ERROR_RET(flt, COMGETTER(Active)(&active), 1); 555 RTPrintf("Active: %s\n", active ? "yes" : "no"); 556 557 USBDeviceFilterAction_T action; 558 CHECK_ERROR_RET(flt, COMGETTER(Action)(&action), 1); 559 const char *pszAction = "<invalid>"; 560 switch (action) 561 { 562 case USBDeviceFilterAction_Ignore: 563 pszAction = "Ignore"; 564 break; 565 case USBDeviceFilterAction_Hold: 566 pszAction = "Hold"; 567 break; 568 default: 569 break; 570 } 571 RTPrintf("Action: %s\n", pszAction); 572 573 Bstr bstr; 574 CHECK_ERROR_RET(flt, COMGETTER(Name)(bstr.asOutParam()), 1); 575 RTPrintf("Name: %ls\n", bstr.raw()); 576 CHECK_ERROR_RET(flt, COMGETTER(VendorId)(bstr.asOutParam()), 1); 577 RTPrintf("VendorId: %ls\n", bstr.raw()); 578 CHECK_ERROR_RET(flt, COMGETTER(ProductId)(bstr.asOutParam()), 1); 579 RTPrintf("ProductId: %ls\n", bstr.raw()); 580 CHECK_ERROR_RET(flt, COMGETTER(Revision)(bstr.asOutParam()), 1); 581 RTPrintf("Revision: %ls\n", bstr.raw()); 582 CHECK_ERROR_RET(flt, COMGETTER(Manufacturer)(bstr.asOutParam()), 1); 583 RTPrintf("Manufacturer: %ls\n", bstr.raw()); 584 CHECK_ERROR_RET(flt, COMGETTER(Product)(bstr.asOutParam()), 1); 585 RTPrintf("Product: %ls\n", bstr.raw()); 586 CHECK_ERROR_RET(flt, COMGETTER(SerialNumber)(bstr.asOutParam()), 1); 587 RTPrintf("Serial Number: %ls\n\n", bstr.raw()); 588 } 589 } 590 return rc; 591 } 592 593 594 /** 595 * List system properties. 596 * 597 * @returns See produceList. 598 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 599 */ 600 static HRESULT listSystemProperties(const ComPtr<IVirtualBox> &pVirtualBox) 601 { 602 ComPtr<ISystemProperties> systemProperties; 603 pVirtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); 604 605 Bstr str; 606 ULONG ulValue; 607 LONG64 i64Value; 608 609 pVirtualBox->COMGETTER(APIVersion)(str.asOutParam()); 610 RTPrintf("API version: %ls\n", str.raw()); 611 612 systemProperties->COMGETTER(MinGuestRAM)(&ulValue); 613 RTPrintf("Minimum guest RAM size: %u Megabytes\n", ulValue); 614 systemProperties->COMGETTER(MaxGuestRAM)(&ulValue); 615 RTPrintf("Maximum guest RAM size: %u Megabytes\n", ulValue); 616 systemProperties->COMGETTER(MinGuestVRAM)(&ulValue); 617 RTPrintf("Minimum video RAM size: %u Megabytes\n", ulValue); 618 systemProperties->COMGETTER(MaxGuestVRAM)(&ulValue); 619 RTPrintf("Maximum video RAM size: %u Megabytes\n", ulValue); 620 systemProperties->COMGETTER(MinGuestCPUCount)(&ulValue); 621 RTPrintf("Minimum guest CPU count: %u\n", ulValue); 622 systemProperties->COMGETTER(MaxGuestCPUCount)(&ulValue); 623 RTPrintf("Maximum guest CPU count: %u\n", ulValue); 624 systemProperties->COMGETTER(InfoVDSize)(&i64Value); 625 RTPrintf("Virtual disk limit (info): %lld Bytes\n", i64Value); 626 systemProperties->COMGETTER(SerialPortCount)(&ulValue); 627 RTPrintf("Maximum Serial Port count: %u\n", ulValue); 628 systemProperties->COMGETTER(ParallelPortCount)(&ulValue); 629 RTPrintf("Maximum Parallel Port count: %u\n", ulValue); 630 systemProperties->COMGETTER(MaxBootPosition)(&ulValue); 631 RTPrintf("Maximum Boot Position: %u\n", ulValue); 632 systemProperties->GetMaxNetworkAdapters(ChipsetType_PIIX3, &ulValue); 633 RTPrintf("Maximum PIIX3 Network Adapter count: %u\n", ulValue); 634 systemProperties->GetMaxNetworkAdapters(ChipsetType_ICH9, &ulValue); 635 RTPrintf("Maximum ICH9 Network Adapter count: %u\n", ulValue); 636 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_IDE, &ulValue); 637 RTPrintf("Maximum PIIX3 IDE Controllers: %u\n", ulValue); 638 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_IDE, &ulValue); 639 RTPrintf("Maximum ICH9 IDE Controllers: %u\n", ulValue); 640 systemProperties->GetMaxPortCountForStorageBus(StorageBus_IDE, &ulValue); 641 RTPrintf("Maximum IDE Port count: %u\n", ulValue); 642 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_IDE, &ulValue); 643 RTPrintf("Maximum Devices per IDE Port: %u\n", ulValue); 644 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_SATA, &ulValue); 645 RTPrintf("Maximum PIIX3 SATA Controllers: %u\n", ulValue); 646 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_SATA, &ulValue); 647 RTPrintf("Maximum ICH9 SATA Controllers: %u\n", ulValue); 648 systemProperties->GetMaxPortCountForStorageBus(StorageBus_SATA, &ulValue); 649 RTPrintf("Maximum SATA Port count: %u\n", ulValue); 650 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_SATA, &ulValue); 651 RTPrintf("Maximum Devices per SATA Port: %u\n", ulValue); 652 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_SCSI, &ulValue); 653 RTPrintf("Maximum PIIX3 SCSI Controllers: %u\n", ulValue); 654 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_SCSI, &ulValue); 655 RTPrintf("Maximum ICH9 SCSI Controllers: %u\n", ulValue); 656 systemProperties->GetMaxPortCountForStorageBus(StorageBus_SCSI, &ulValue); 657 RTPrintf("Maximum SCSI Port count: %u\n", ulValue); 658 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_SCSI, &ulValue); 659 RTPrintf("Maximum Devices per SCSI Port: %u\n", ulValue); 660 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_SAS, &ulValue); 661 RTPrintf("Maximum SAS PIIX3 Controllers: %u\n", ulValue); 662 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_SAS, &ulValue); 663 RTPrintf("Maximum SAS ICH9 Controllers: %u\n", ulValue); 664 systemProperties->GetMaxPortCountForStorageBus(StorageBus_SAS, &ulValue); 665 RTPrintf("Maximum SAS Port count: %u\n", ulValue); 666 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_SAS, &ulValue); 667 RTPrintf("Maximum Devices per SAS Port: %u\n", ulValue); 668 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_Floppy, &ulValue); 669 RTPrintf("Maximum PIIX3 Floppy Controllers:%u\n", ulValue); 670 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_Floppy, &ulValue); 671 RTPrintf("Maximum ICH9 Floppy Controllers: %u\n", ulValue); 672 systemProperties->GetMaxPortCountForStorageBus(StorageBus_Floppy, &ulValue); 673 RTPrintf("Maximum Floppy Port count: %u\n", ulValue); 674 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_Floppy, &ulValue); 675 RTPrintf("Maximum Devices per Floppy Port: %u\n", ulValue); 676 systemProperties->COMGETTER(DefaultMachineFolder)(str.asOutParam()); 677 RTPrintf("Default machine folder: %ls\n", str.raw()); 678 systemProperties->COMGETTER(VRDEAuthLibrary)(str.asOutParam()); 679 RTPrintf("VRDE auth library: %ls\n", str.raw()); 680 systemProperties->COMGETTER(WebServiceAuthLibrary)(str.asOutParam()); 681 RTPrintf("Webservice auth. library: %ls\n", str.raw()); 682 systemProperties->COMGETTER(DefaultVRDEExtPack)(str.asOutParam()); 683 RTPrintf("Remote desktop ExtPack: %ls\n", str.raw()); 684 systemProperties->COMGETTER(LogHistoryCount)(&ulValue); 685 RTPrintf("Log history count: %u\n", ulValue); 686 systemProperties->COMGETTER(AutostartDatabasePath)(str.asOutParam()); 687 RTPrintf("Autostart database path: %ls\n", str.raw()); 688 systemProperties->COMGETTER(DefaultAdditionsISO)(str.asOutParam()); 689 RTPrintf("Default Guest Additions ISO: %ls\n", str.raw()); 690 return S_OK; 189 691 } 190 692 … … 194 696 * 195 697 * @returns See produceList. 196 * @param rptrVirtualBoxReference to the IVirtualBox smart pointer.197 */ 198 static HRESULT listExtensionPacks(const ComPtr<IVirtualBox> & rptrVirtualBox)698 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 699 */ 700 static HRESULT listExtensionPacks(const ComPtr<IVirtualBox> &pVirtualBox) 199 701 { 200 702 ComObjPtr<IExtPackManager> ptrExtPackMgr; 201 CHECK_ERROR2_RET( rptrVirtualBox, COMGETTER(ExtensionPackManager)(ptrExtPackMgr.asOutParam()), hrcCheck);703 CHECK_ERROR2_RET(pVirtualBox, COMGETTER(ExtensionPackManager)(ptrExtPackMgr.asOutParam()), hrcCheck); 202 704 203 705 SafeIfaceArray<IExtPack> extPacks; … … 209 711 { 210 712 /* Read all the properties. */ 211 Bstr 713 Bstr bstrName; 212 714 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Name)(bstrName.asOutParam()), hrc = hrcCheck; bstrName.setNull()); 213 Bstr 715 Bstr bstrDesc; 214 716 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Description)(bstrDesc.asOutParam()), hrc = hrcCheck; bstrDesc.setNull()); 215 Bstr 717 Bstr bstrVersion; 216 718 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Version)(bstrVersion.asOutParam()), hrc = hrcCheck; bstrVersion.setNull()); 217 ULONG 719 ULONG uRevision; 218 720 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Revision)(&uRevision), hrc = hrcCheck; uRevision = 0); 219 Bstr 721 Bstr bstrEdition; 220 722 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Edition)(bstrEdition.asOutParam()), hrc = hrcCheck; bstrEdition.setNull()); 221 Bstr 723 Bstr bstrVrdeModule; 222 724 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(VRDEModule)(bstrVrdeModule.asOutParam()),hrc=hrcCheck; bstrVrdeModule.setNull()); 223 BOOL 725 BOOL fUsable; 224 726 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Usable)(&fUsable), hrc = hrcCheck; fUsable = FALSE); 225 Bstr 727 Bstr bstrWhy; 226 728 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(WhyUnusable)(bstrWhy.asOutParam()), hrc = hrcCheck; bstrWhy.setNull()); 227 729 … … 256 758 * 257 759 * @returns See produceList. 258 * @param rptrVirtualBoxReference to the IVirtualBox smart pointer.259 */ 260 static HRESULT listGroups(const ComPtr<IVirtualBox> & rptrVirtualBox)760 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 761 */ 762 static HRESULT listGroups(const ComPtr<IVirtualBox> &pVirtualBox) 261 763 { 262 764 SafeArray<BSTR> groups; 263 CHECK_ERROR2_RET( rptrVirtualBox, COMGETTER(MachineGroups)(ComSafeArrayAsOutParam(groups)), hrcCheck);765 CHECK_ERROR2_RET(pVirtualBox, COMGETTER(MachineGroups)(ComSafeArrayAsOutParam(groups)), hrcCheck); 264 766 265 767 for (size_t i = 0; i < groups.size(); i++) … … 307 809 * @param enmList The list to produce. 308 810 * @param fOptLong Long (@c true) or short list format. 309 * @param rptrVirtualBoxReference to the IVirtualBox smart pointer.310 */ 311 static HRESULT produceList(enum enmListType enmCommand, bool fOptLong, const ComPtr<IVirtualBox> & rptrVirtualBox)811 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 812 */ 813 static HRESULT produceList(enum enmListType enmCommand, bool fOptLong, const ComPtr<IVirtualBox> &pVirtualBox) 312 814 { 313 815 HRESULT rc = S_OK; … … 324 826 */ 325 827 com::SafeIfaceArray<IMachine> machines; 326 rc = rptrVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines));828 rc = pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines)); 327 829 if (SUCCEEDED(rc)) 328 830 { … … 333 835 { 334 836 if (machines[i]) 335 rc = showVMInfo( rptrVirtualBox, machines[i], fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT);837 rc = showVMInfo(pVirtualBox, machines[i], fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT); 336 838 } 337 839 } … … 345 847 */ 346 848 com::SafeIfaceArray<IMachine> machines; 347 rc = rptrVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines));849 rc = pVirtualBox->COMGETTER(Machines)(ComSafeArrayAsOutParam(machines)); 348 850 com::SafeArray<MachineState_T> states; 349 851 if (SUCCEEDED(rc)) 350 rc = rptrVirtualBox->GetMachineStates(ComSafeArrayAsInParam(machines), ComSafeArrayAsOutParam(states));852 rc = pVirtualBox->GetMachineStates(ComSafeArrayAsInParam(machines), ComSafeArrayAsOutParam(states)); 351 853 if (SUCCEEDED(rc)) 352 854 { … … 366 868 case MachineState_Paused: 367 869 case MachineState_TeleportingPausedVM: 368 rc = showVMInfo( rptrVirtualBox, machines[i], fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT);870 rc = showVMInfo(pVirtualBox, machines[i], fOptLong ? VMINFO_STANDARD : VMINFO_COMPACT); 369 871 break; 370 872 } … … 378 880 { 379 881 com::SafeIfaceArray<IGuestOSType> coll; 380 rc = rptrVirtualBox->COMGETTER(GuestOSTypes)(ComSafeArrayAsOutParam(coll));882 rc = pVirtualBox->COMGETTER(GuestOSTypes)(ComSafeArrayAsOutParam(coll)); 381 883 if (SUCCEEDED(rc)) 382 884 { … … 412 914 { 413 915 ComPtr<IHost> host; 414 CHECK_ERROR( rptrVirtualBox, COMGETTER(Host)(host.asOutParam()));916 CHECK_ERROR(pVirtualBox, COMGETTER(Host)(host.asOutParam())); 415 917 com::SafeIfaceArray<IMedium> coll; 416 918 CHECK_ERROR(host, COMGETTER(DVDDrives)(ComSafeArrayAsOutParam(coll))); … … 434 936 { 435 937 ComPtr<IHost> host; 436 CHECK_ERROR( rptrVirtualBox, COMGETTER(Host)(host.asOutParam()));938 CHECK_ERROR(pVirtualBox, COMGETTER(Host)(host.asOutParam())); 437 939 com::SafeIfaceArray<IMedium> coll; 438 940 CHECK_ERROR(host, COMGETTER(FloppyDrives)(ComSafeArrayAsOutParam(coll))); … … 453 955 } 454 956 455 /** @todo function. */456 957 case kListBridgedInterfaces: 457 958 #if defined(VBOX_WITH_NETFLT) 458 959 case kListHostOnlyInterfaces: 459 960 #endif 460 { 461 ComPtr<IHost> host; 462 CHECK_ERROR(rptrVirtualBox, COMGETTER(Host)(host.asOutParam())); 463 com::SafeIfaceArray<IHostNetworkInterface> hostNetworkInterfaces; 464 #if defined(VBOX_WITH_NETFLT) 465 if (enmCommand == kListBridgedInterfaces) 466 CHECK_ERROR(host, FindHostNetworkInterfacesOfType(HostNetworkInterfaceType_Bridged, 467 ComSafeArrayAsOutParam(hostNetworkInterfaces))); 468 else 469 CHECK_ERROR(host, FindHostNetworkInterfacesOfType(HostNetworkInterfaceType_HostOnly, 470 ComSafeArrayAsOutParam(hostNetworkInterfaces))); 471 #else 472 CHECK_ERROR(host, COMGETTER(NetworkInterfaces)(ComSafeArrayAsOutParam(hostNetworkInterfaces))); 473 #endif 474 for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i) 475 { 476 ComPtr<IHostNetworkInterface> networkInterface = hostNetworkInterfaces[i]; 477 #ifndef VBOX_WITH_HOSTNETIF_API 478 Bstr interfaceName; 479 networkInterface->COMGETTER(Name)(interfaceName.asOutParam()); 480 RTPrintf("Name: %ls\n", interfaceName.raw()); 481 Guid interfaceGuid; 482 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 483 RTPrintf("GUID: %ls\n\n", Bstr(interfaceGuid.toString()).raw()); 484 #else /* VBOX_WITH_HOSTNETIF_API */ 485 Bstr interfaceName; 486 networkInterface->COMGETTER(Name)(interfaceName.asOutParam()); 487 RTPrintf("Name: %ls\n", interfaceName.raw()); 488 Bstr interfaceGuid; 489 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 490 RTPrintf("GUID: %ls\n", interfaceGuid.raw()); 491 BOOL bDHCPEnabled; 492 networkInterface->COMGETTER(DHCPEnabled)(&bDHCPEnabled); 493 RTPrintf("DHCP: %s\n", bDHCPEnabled ? "Enabled" : "Disabled"); 494 495 Bstr IPAddress; 496 networkInterface->COMGETTER(IPAddress)(IPAddress.asOutParam()); 497 RTPrintf("IPAddress: %ls\n", IPAddress.raw()); 498 Bstr NetworkMask; 499 networkInterface->COMGETTER(NetworkMask)(NetworkMask.asOutParam()); 500 RTPrintf("NetworkMask: %ls\n", NetworkMask.raw()); 501 Bstr IPV6Address; 502 networkInterface->COMGETTER(IPV6Address)(IPV6Address.asOutParam()); 503 RTPrintf("IPV6Address: %ls\n", IPV6Address.raw()); 504 ULONG IPV6NetworkMaskPrefixLength; 505 networkInterface->COMGETTER(IPV6NetworkMaskPrefixLength)(&IPV6NetworkMaskPrefixLength); 506 RTPrintf("IPV6NetworkMaskPrefixLength: %d\n", IPV6NetworkMaskPrefixLength); 507 Bstr HardwareAddress; 508 networkInterface->COMGETTER(HardwareAddress)(HardwareAddress.asOutParam()); 509 RTPrintf("HardwareAddress: %ls\n", HardwareAddress.raw()); 510 HostNetworkInterfaceMediumType_T Type; 511 networkInterface->COMGETTER(MediumType)(&Type); 512 RTPrintf("MediumType: %s\n", getHostIfMediumTypeText(Type)); 513 HostNetworkInterfaceStatus_T Status; 514 networkInterface->COMGETTER(Status)(&Status); 515 RTPrintf("Status: %s\n", getHostIfStatusText(Status)); 516 Bstr netName; 517 networkInterface->COMGETTER(NetworkName)(netName.asOutParam()); 518 RTPrintf("VBoxNetworkName: %ls\n\n", netName.raw()); 519 #endif 520 } 521 break; 522 } 523 524 /** @todo function. */ 961 rc = listNetworkInterfaces(pVirtualBox, enmCommand == kListBridgedInterfaces); 962 break; 963 525 964 case kListHostInfo: 965 rc = listHostInfo(pVirtualBox); 966 break; 967 968 case kListHostCpuIDs: 526 969 { 527 970 ComPtr<IHost> Host; 528 CHECK_ERROR(rptrVirtualBox, COMGETTER(Host)(Host.asOutParam())); 529 530 RTPrintf("Host Information:\n\n"); 531 532 LONG64 u64UtcTime = 0; 533 CHECK_ERROR(Host, COMGETTER(UTCTime)(&u64UtcTime)); 534 RTTIMESPEC timeSpec; 535 char szTime[32]; 536 RTPrintf("Host time: %s\n", RTTimeSpecToString(RTTimeSpecSetMilli(&timeSpec, u64UtcTime), szTime, sizeof(szTime))); 537 538 ULONG processorOnlineCount = 0; 539 CHECK_ERROR(Host, COMGETTER(ProcessorOnlineCount)(&processorOnlineCount)); 540 RTPrintf("Processor online count: %lu\n", processorOnlineCount); 541 ULONG processorCount = 0; 542 CHECK_ERROR(Host, COMGETTER(ProcessorCount)(&processorCount)); 543 RTPrintf("Processor count: %lu\n", processorCount); 544 ULONG processorSpeed = 0; 545 Bstr processorDescription; 546 for (ULONG i = 0; i < processorCount; i++) 547 { 548 CHECK_ERROR(Host, GetProcessorSpeed(i, &processorSpeed)); 549 if (processorSpeed) 550 RTPrintf("Processor#%u speed: %lu MHz\n", i, processorSpeed); 551 else 552 RTPrintf("Processor#%u speed: unknown\n", i, processorSpeed); 553 CHECK_ERROR(Host, GetProcessorDescription(i, processorDescription.asOutParam())); 554 RTPrintf("Processor#%u description: %ls\n", i, processorDescription.raw()); 555 } 556 557 ULONG memorySize = 0; 558 CHECK_ERROR(Host, COMGETTER(MemorySize)(&memorySize)); 559 RTPrintf("Memory size: %lu MByte\n", memorySize); 560 561 ULONG memoryAvailable = 0; 562 CHECK_ERROR(Host, COMGETTER(MemoryAvailable)(&memoryAvailable)); 563 RTPrintf("Memory available: %lu MByte\n", memoryAvailable); 564 565 Bstr operatingSystem; 566 CHECK_ERROR(Host, COMGETTER(OperatingSystem)(operatingSystem.asOutParam())); 567 RTPrintf("Operating system: %ls\n", operatingSystem.raw()); 568 569 Bstr oSVersion; 570 CHECK_ERROR(Host, COMGETTER(OSVersion)(oSVersion.asOutParam())); 571 RTPrintf("Operating system version: %ls\n", oSVersion.raw()); 572 break; 573 } 574 575 case kListHostCpuIDs: 576 { 577 ComPtr<IHost> Host; 578 CHECK_ERROR(rptrVirtualBox, COMGETTER(Host)(Host.asOutParam())); 971 CHECK_ERROR(pVirtualBox, COMGETTER(Host)(Host.asOutParam())); 579 972 580 973 RTPrintf("Host CPUIDs:\n\nLeaf no. EAX EBX ECX EDX\n"); … … 602 995 } 603 996 604 /** @todo function. */605 997 case kListHddBackends: 606 { 607 ComPtr<ISystemProperties> systemProperties; 608 CHECK_ERROR(rptrVirtualBox, COMGETTER(SystemProperties)(systemProperties.asOutParam())); 609 com::SafeIfaceArray<IMediumFormat> mediumFormats; 610 CHECK_ERROR(systemProperties, COMGETTER(MediumFormats)(ComSafeArrayAsOutParam(mediumFormats))); 611 612 RTPrintf("Supported hard disk backends:\n\n"); 613 for (size_t i = 0; i < mediumFormats.size(); ++i) 614 { 615 /* General information */ 616 Bstr id; 617 CHECK_ERROR(mediumFormats[i], COMGETTER(Id)(id.asOutParam())); 618 619 Bstr description; 620 CHECK_ERROR(mediumFormats[i], 621 COMGETTER(Id)(description.asOutParam())); 622 623 ULONG caps; 624 CHECK_ERROR(mediumFormats[i], 625 COMGETTER(Capabilities)(&caps)); 626 627 RTPrintf("Backend %u: id='%ls' description='%ls' capabilities=%#06x extensions='", 628 i, id.raw(), description.raw(), caps); 629 630 /* File extensions */ 631 com::SafeArray <BSTR> fileExtensions; 632 com::SafeArray <DeviceType_T> deviceTypes; 633 CHECK_ERROR(mediumFormats[i], 634 DescribeFileExtensions(ComSafeArrayAsOutParam(fileExtensions), ComSafeArrayAsOutParam(deviceTypes))); 635 for (size_t j = 0; j < fileExtensions.size(); ++j) 636 { 637 RTPrintf("%ls (%s)", Bstr(fileExtensions[j]).raw(), getDeviceTypeText(deviceTypes[j])); 638 if (j != fileExtensions.size()-1) 639 RTPrintf(","); 640 } 641 RTPrintf("'"); 642 643 /* Configuration keys */ 644 com::SafeArray <BSTR> propertyNames; 645 com::SafeArray <BSTR> propertyDescriptions; 646 com::SafeArray <DataType_T> propertyTypes; 647 com::SafeArray <ULONG> propertyFlags; 648 com::SafeArray <BSTR> propertyDefaults; 649 CHECK_ERROR(mediumFormats[i], 650 DescribeProperties(ComSafeArrayAsOutParam(propertyNames), 651 ComSafeArrayAsOutParam(propertyDescriptions), 652 ComSafeArrayAsOutParam(propertyTypes), 653 ComSafeArrayAsOutParam(propertyFlags), 654 ComSafeArrayAsOutParam(propertyDefaults))); 655 656 RTPrintf(" properties=("); 657 if (propertyNames.size() > 0) 658 { 659 for (size_t j = 0; j < propertyNames.size(); ++j) 660 { 661 RTPrintf("\n name='%ls' desc='%ls' type=", 662 Bstr(propertyNames[j]).raw(), Bstr(propertyDescriptions[j]).raw()); 663 switch (propertyTypes[j]) 664 { 665 case DataType_Int32: RTPrintf("int"); break; 666 case DataType_Int8: RTPrintf("byte"); break; 667 case DataType_String: RTPrintf("string"); break; 668 } 669 RTPrintf(" flags=%#04x", propertyFlags[j]); 670 RTPrintf(" default='%ls'", Bstr(propertyDefaults[j]).raw()); 671 if (j != propertyNames.size()-1) 672 RTPrintf(", "); 673 } 674 } 675 RTPrintf(")\n"); 676 } 677 break; 678 } 998 rc = listHddBackends(pVirtualBox); 999 break; 679 1000 680 1001 case kListHdds: 681 1002 { 682 1003 com::SafeIfaceArray<IMedium> hdds; 683 CHECK_ERROR( rptrVirtualBox, COMGETTER(HardDisks)(ComSafeArrayAsOutParam(hdds)));684 listMedia(rptrVirtualBox, hdds, "base");1004 CHECK_ERROR(pVirtualBox, COMGETTER(HardDisks)(ComSafeArrayAsOutParam(hdds))); 1005 rc = listMedia(pVirtualBox, hdds, "base"); 685 1006 break; 686 1007 } … … 689 1010 { 690 1011 com::SafeIfaceArray<IMedium> dvds; 691 CHECK_ERROR( rptrVirtualBox, COMGETTER(DVDImages)(ComSafeArrayAsOutParam(dvds)));692 listMedia(rptrVirtualBox, dvds, NULL);1012 CHECK_ERROR(pVirtualBox, COMGETTER(DVDImages)(ComSafeArrayAsOutParam(dvds))); 1013 rc = listMedia(pVirtualBox, dvds, NULL); 693 1014 break; 694 1015 } … … 697 1018 { 698 1019 com::SafeIfaceArray<IMedium> floppies; 699 CHECK_ERROR(rptrVirtualBox, COMGETTER(FloppyImages)(ComSafeArrayAsOutParam(floppies))); 700 listMedia(rptrVirtualBox, floppies, NULL); 701 break; 702 } 703 704 /** @todo function. */ 1020 CHECK_ERROR(pVirtualBox, COMGETTER(FloppyImages)(ComSafeArrayAsOutParam(floppies))); 1021 rc = listMedia(pVirtualBox, floppies, NULL); 1022 break; 1023 } 1024 705 1025 case kListUsbHost: 706 { 707 ComPtr<IHost> Host; 708 CHECK_ERROR_RET(rptrVirtualBox, COMGETTER(Host)(Host.asOutParam()), 1); 709 710 SafeIfaceArray<IHostUSBDevice> CollPtr; 711 CHECK_ERROR_RET(Host, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(CollPtr)), 1); 712 713 RTPrintf("Host USB Devices:\n\n"); 714 715 if (CollPtr.size() == 0) 716 { 717 RTPrintf("<none>\n\n"); 718 } 719 else 720 { 721 for (size_t i = 0; i < CollPtr.size(); ++i) 722 { 723 ComPtr <IHostUSBDevice> dev = CollPtr[i]; 724 725 /* Query info. */ 726 Bstr id; 727 CHECK_ERROR_RET(dev, COMGETTER(Id)(id.asOutParam()), 1); 728 USHORT usVendorId; 729 CHECK_ERROR_RET(dev, COMGETTER(VendorId)(&usVendorId), 1); 730 USHORT usProductId; 731 CHECK_ERROR_RET(dev, COMGETTER(ProductId)(&usProductId), 1); 732 USHORT bcdRevision; 733 CHECK_ERROR_RET(dev, COMGETTER(Revision)(&bcdRevision), 1); 734 USHORT usPort; 735 CHECK_ERROR_RET(dev, COMGETTER(Port)(&usPort), 1); 736 USHORT usVersion; 737 CHECK_ERROR_RET(dev, COMGETTER(Version)(&usVersion), 1); 738 USHORT usPortVersion; 739 CHECK_ERROR_RET(dev, COMGETTER(PortVersion)(&usPortVersion), 1); 740 741 RTPrintf("UUID: %s\n" 742 "VendorId: %#06x (%04X)\n" 743 "ProductId: %#06x (%04X)\n" 744 "Revision: %u.%u (%02u%02u)\n" 745 "Port: %u\n" 746 "USB version/speed: %u/%u\n", 747 Utf8Str(id).c_str(), 748 usVendorId, usVendorId, usProductId, usProductId, 749 bcdRevision >> 8, bcdRevision & 0xff, 750 bcdRevision >> 8, bcdRevision & 0xff, 751 usPort, usVersion, usPortVersion); 752 753 /* optional stuff. */ 754 Bstr bstr; 755 CHECK_ERROR_RET(dev, COMGETTER(Manufacturer)(bstr.asOutParam()), 1); 756 if (!bstr.isEmpty()) 757 RTPrintf("Manufacturer: %ls\n", bstr.raw()); 758 CHECK_ERROR_RET(dev, COMGETTER(Product)(bstr.asOutParam()), 1); 759 if (!bstr.isEmpty()) 760 RTPrintf("Product: %ls\n", bstr.raw()); 761 CHECK_ERROR_RET(dev, COMGETTER(SerialNumber)(bstr.asOutParam()), 1); 762 if (!bstr.isEmpty()) 763 RTPrintf("SerialNumber: %ls\n", bstr.raw()); 764 CHECK_ERROR_RET(dev, COMGETTER(Address)(bstr.asOutParam()), 1); 765 if (!bstr.isEmpty()) 766 RTPrintf("Address: %ls\n", bstr.raw()); 767 768 /* current state */ 769 USBDeviceState_T state; 770 CHECK_ERROR_RET(dev, COMGETTER(State)(&state), 1); 771 const char *pszState = "?"; 772 switch (state) 773 { 774 case USBDeviceState_NotSupported: 775 pszState = "Not supported"; 776 break; 777 case USBDeviceState_Unavailable: 778 pszState = "Unavailable"; 779 break; 780 case USBDeviceState_Busy: 781 pszState = "Busy"; 782 break; 783 case USBDeviceState_Available: 784 pszState = "Available"; 785 break; 786 case USBDeviceState_Held: 787 pszState = "Held"; 788 break; 789 case USBDeviceState_Captured: 790 pszState = "Captured"; 791 break; 792 default: 793 ASSERT(false); 794 break; 795 } 796 RTPrintf("Current State: %s\n\n", pszState); 797 } 798 } 799 break; 800 } 801 802 /** @todo function. */ 1026 rc = listUsbHost(pVirtualBox); 1027 break; 1028 803 1029 case kListUsbFilters: 804 { 805 RTPrintf("Global USB Device Filters:\n\n"); 806 807 ComPtr<IHost> host; 808 CHECK_ERROR_RET(rptrVirtualBox, COMGETTER(Host)(host.asOutParam()), 1); 809 810 SafeIfaceArray<IHostUSBDeviceFilter> coll; 811 CHECK_ERROR_RET(host, COMGETTER(USBDeviceFilters)(ComSafeArrayAsOutParam(coll)), 1); 812 813 if (coll.size() == 0) 814 { 815 RTPrintf("<none>\n\n"); 816 } 817 else 818 { 819 for (size_t index = 0; index < coll.size(); ++index) 820 { 821 ComPtr<IHostUSBDeviceFilter> flt = coll[index]; 822 823 /* Query info. */ 824 825 RTPrintf("Index: %zu\n", index); 826 827 BOOL active = FALSE; 828 CHECK_ERROR_RET(flt, COMGETTER(Active)(&active), 1); 829 RTPrintf("Active: %s\n", active ? "yes" : "no"); 830 831 USBDeviceFilterAction_T action; 832 CHECK_ERROR_RET(flt, COMGETTER(Action)(&action), 1); 833 const char *pszAction = "<invalid>"; 834 switch (action) 835 { 836 case USBDeviceFilterAction_Ignore: 837 pszAction = "Ignore"; 838 break; 839 case USBDeviceFilterAction_Hold: 840 pszAction = "Hold"; 841 break; 842 default: 843 break; 844 } 845 RTPrintf("Action: %s\n", pszAction); 846 847 Bstr bstr; 848 CHECK_ERROR_RET(flt, COMGETTER(Name)(bstr.asOutParam()), 1); 849 RTPrintf("Name: %ls\n", bstr.raw()); 850 CHECK_ERROR_RET(flt, COMGETTER(VendorId)(bstr.asOutParam()), 1); 851 RTPrintf("VendorId: %ls\n", bstr.raw()); 852 CHECK_ERROR_RET(flt, COMGETTER(ProductId)(bstr.asOutParam()), 1); 853 RTPrintf("ProductId: %ls\n", bstr.raw()); 854 CHECK_ERROR_RET(flt, COMGETTER(Revision)(bstr.asOutParam()), 1); 855 RTPrintf("Revision: %ls\n", bstr.raw()); 856 CHECK_ERROR_RET(flt, COMGETTER(Manufacturer)(bstr.asOutParam()), 1); 857 RTPrintf("Manufacturer: %ls\n", bstr.raw()); 858 CHECK_ERROR_RET(flt, COMGETTER(Product)(bstr.asOutParam()), 1); 859 RTPrintf("Product: %ls\n", bstr.raw()); 860 CHECK_ERROR_RET(flt, COMGETTER(SerialNumber)(bstr.asOutParam()), 1); 861 RTPrintf("Serial Number: %ls\n\n", bstr.raw()); 862 } 863 } 864 break; 865 } 866 867 /** @todo function. */ 1030 rc = listUsbFilters(pVirtualBox); 1031 break; 1032 868 1033 case kListSystemProperties: 869 { 870 ComPtr<ISystemProperties> systemProperties; 871 rptrVirtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); 872 873 Bstr str; 874 ULONG ulValue; 875 LONG64 i64Value; 876 877 rptrVirtualBox->COMGETTER(APIVersion)(str.asOutParam()); 878 RTPrintf("API version: %ls\n", str.raw()); 879 880 systemProperties->COMGETTER(MinGuestRAM)(&ulValue); 881 RTPrintf("Minimum guest RAM size: %u Megabytes\n", ulValue); 882 systemProperties->COMGETTER(MaxGuestRAM)(&ulValue); 883 RTPrintf("Maximum guest RAM size: %u Megabytes\n", ulValue); 884 systemProperties->COMGETTER(MinGuestVRAM)(&ulValue); 885 RTPrintf("Minimum video RAM size: %u Megabytes\n", ulValue); 886 systemProperties->COMGETTER(MaxGuestVRAM)(&ulValue); 887 RTPrintf("Maximum video RAM size: %u Megabytes\n", ulValue); 888 systemProperties->COMGETTER(MinGuestCPUCount)(&ulValue); 889 RTPrintf("Minimum guest CPU count: %u\n", ulValue); 890 systemProperties->COMGETTER(MaxGuestCPUCount)(&ulValue); 891 RTPrintf("Maximum guest CPU count: %u\n", ulValue); 892 systemProperties->COMGETTER(InfoVDSize)(&i64Value); 893 RTPrintf("Virtual disk limit (info): %lld Bytes\n", i64Value); 894 systemProperties->COMGETTER(SerialPortCount)(&ulValue); 895 RTPrintf("Maximum Serial Port count: %u\n", ulValue); 896 systemProperties->COMGETTER(ParallelPortCount)(&ulValue); 897 RTPrintf("Maximum Parallel Port count: %u\n", ulValue); 898 systemProperties->COMGETTER(MaxBootPosition)(&ulValue); 899 RTPrintf("Maximum Boot Position: %u\n", ulValue); 900 systemProperties->GetMaxNetworkAdapters(ChipsetType_PIIX3, &ulValue); 901 RTPrintf("Maximum PIIX3 Network Adapter count: %u\n", ulValue); 902 systemProperties->GetMaxNetworkAdapters(ChipsetType_ICH9, &ulValue); 903 RTPrintf("Maximum ICH9 Network Adapter count: %u\n", ulValue); 904 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_IDE, &ulValue); 905 RTPrintf("Maximum PIIX3 IDE Controllers: %u\n", ulValue); 906 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_IDE, &ulValue); 907 RTPrintf("Maximum ICH9 IDE Controllers: %u\n", ulValue); 908 systemProperties->GetMaxPortCountForStorageBus(StorageBus_IDE, &ulValue); 909 RTPrintf("Maximum IDE Port count: %u\n", ulValue); 910 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_IDE, &ulValue); 911 RTPrintf("Maximum Devices per IDE Port: %u\n", ulValue); 912 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_SATA, &ulValue); 913 RTPrintf("Maximum PIIX3 SATA Controllers: %u\n", ulValue); 914 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_SATA, &ulValue); 915 RTPrintf("Maximum ICH9 SATA Controllers: %u\n", ulValue); 916 systemProperties->GetMaxPortCountForStorageBus(StorageBus_SATA, &ulValue); 917 RTPrintf("Maximum SATA Port count: %u\n", ulValue); 918 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_SATA, &ulValue); 919 RTPrintf("Maximum Devices per SATA Port: %u\n", ulValue); 920 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_SCSI, &ulValue); 921 RTPrintf("Maximum PIIX3 SCSI Controllers: %u\n", ulValue); 922 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_SCSI, &ulValue); 923 RTPrintf("Maximum ICH9 SCSI Controllers: %u\n", ulValue); 924 systemProperties->GetMaxPortCountForStorageBus(StorageBus_SCSI, &ulValue); 925 RTPrintf("Maximum SCSI Port count: %u\n", ulValue); 926 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_SCSI, &ulValue); 927 RTPrintf("Maximum Devices per SCSI Port: %u\n", ulValue); 928 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_SAS, &ulValue); 929 RTPrintf("Maximum SAS PIIX3 Controllers: %u\n", ulValue); 930 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_SAS, &ulValue); 931 RTPrintf("Maximum SAS ICH9 Controllers: %u\n", ulValue); 932 systemProperties->GetMaxPortCountForStorageBus(StorageBus_SAS, &ulValue); 933 RTPrintf("Maximum SAS Port count: %u\n", ulValue); 934 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_SAS, &ulValue); 935 RTPrintf("Maximum Devices per SAS Port: %u\n", ulValue); 936 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_PIIX3, StorageBus_Floppy, &ulValue); 937 RTPrintf("Maximum PIIX3 Floppy Controllers:%u\n", ulValue); 938 systemProperties->GetMaxInstancesOfStorageBus(ChipsetType_ICH9, StorageBus_Floppy, &ulValue); 939 RTPrintf("Maximum ICH9 Floppy Controllers: %u\n", ulValue); 940 systemProperties->GetMaxPortCountForStorageBus(StorageBus_Floppy, &ulValue); 941 RTPrintf("Maximum Floppy Port count: %u\n", ulValue); 942 systemProperties->GetMaxDevicesPerPortForStorageBus(StorageBus_Floppy, &ulValue); 943 RTPrintf("Maximum Devices per Floppy Port: %u\n", ulValue); 944 systemProperties->COMGETTER(DefaultMachineFolder)(str.asOutParam()); 945 RTPrintf("Default machine folder: %ls\n", str.raw()); 946 systemProperties->COMGETTER(VRDEAuthLibrary)(str.asOutParam()); 947 RTPrintf("VRDE auth library: %ls\n", str.raw()); 948 systemProperties->COMGETTER(WebServiceAuthLibrary)(str.asOutParam()); 949 RTPrintf("Webservice auth. library: %ls\n", str.raw()); 950 systemProperties->COMGETTER(DefaultVRDEExtPack)(str.asOutParam()); 951 RTPrintf("Remote desktop ExtPack: %ls\n", str.raw()); 952 systemProperties->COMGETTER(LogHistoryCount)(&ulValue); 953 RTPrintf("Log history count: %u\n", ulValue); 954 break; 955 } 1034 rc = listSystemProperties(pVirtualBox); 1035 break; 956 1036 957 1037 case kListDhcpServers: 958 1038 { 959 1039 com::SafeIfaceArray<IDHCPServer> svrs; 960 CHECK_ERROR( rptrVirtualBox, COMGETTER(DHCPServers)(ComSafeArrayAsOutParam(svrs)));1040 CHECK_ERROR(pVirtualBox, COMGETTER(DHCPServers)(ComSafeArrayAsOutParam(svrs))); 961 1041 for (size_t i = 0; i < svrs.size(); ++i) 962 1042 { … … 986 1066 987 1067 case kListExtPacks: 988 rc = listExtensionPacks( rptrVirtualBox);1068 rc = listExtensionPacks(pVirtualBox); 989 1069 break; 990 1070 991 1071 case kListGroups: 992 rc = listGroups( rptrVirtualBox);1072 rc = listGroups(pVirtualBox); 993 1073 break; 994 1074 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r42526 r42748 1768 1768 } 1769 1769 1770 bool UIMessageCenter::cannotFindGuestAdditions( const QString &strSrc1, const QString &strSrc2)1770 bool UIMessageCenter::cannotFindGuestAdditions() 1771 1771 { 1772 1772 return messageYesNo(mainMachineWindowShown(), Question, 1773 1773 tr("<p>Could not find the VirtualBox Guest Additions " 1774 "CD image file <nobr><b>%1</b></nobr> or " 1775 "<nobr><b>%2</b>.</nobr></p><p>Do you wish to " 1776 "download this CD image from the Internet?</p>") 1777 .arg(strSrc1).arg(strSrc2)); 1774 "CD image file.</nobr></p><p>Do you wish to " 1775 "download this CD image from the Internet?</p>")); 1778 1776 } 1779 1777 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r42526 r42748 6 6 7 7 /* 8 * Copyright (C) 2006-201 1Oracle Corporation8 * Copyright (C) 2006-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 308 308 309 309 void remindAboutGuestAdditionsAreNotActive(QWidget *pParent); 310 bool cannotFindGuestAdditions( const QString &strSrc1, const QString &strSrc2);310 bool cannotFindGuestAdditions(); 311 311 void cannotMountGuestAdditions(const QString &strMachineName); 312 312 bool confirmDownloadAdditions(const QString &strUrl, qulonglong uSize); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r42665 r42748 129 129 130 130 #include <VBox/vd.h> 131 #include <VBox/version.h>132 131 #include <VBox/sup.h> 133 132 #include <VBox/com/Guid.h> … … 406 405 QString VBoxGlobal::vboxVersionStringNormalized() const 407 406 { 408 /** @todo IVirtualBox should expose a publisher-free version string! This 409 * doesn't work in any sane+portable manner. */ 410 return vboxVersionString().remove(VBOX_BUILD_PUBLISHER); 407 return mVBox.GetVersionNormalized(); 411 408 } 412 409 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r42526 r42748 64 64 #include "CUSBDevice.h" 65 65 #include "CVRDEServer.h" 66 #include "CSystemProperties.h" 66 67 #ifdef Q_WS_MAC 67 68 # include "CGuest.h" … … 1583 1584 return; 1584 1585 1585 char strAppPrivPath[RTPATH_MAX]; 1586 int rc = RTPathAppPrivateNoArch(strAppPrivPath, sizeof(strAppPrivPath)); 1587 AssertRC (rc); 1588 1589 QString strSrc1 = QString(strAppPrivPath) + "/VBoxGuestAdditions.iso"; 1590 QString strSrc2 = qApp->applicationDirPath() + "/additions/VBoxGuestAdditions.iso"; 1591 1592 /* Check the standard image locations */ 1593 if (QFile::exists(strSrc1)) 1594 return uisession()->sltInstallGuestAdditionsFrom(strSrc1); 1595 else if (QFile::exists(strSrc2)) 1596 return uisession()->sltInstallGuestAdditionsFrom(strSrc2); 1586 CSystemProperties systemProperties = vboxGlobal().virtualBox().GetSystemProperties(); 1587 QString strAdditions = systemProperties.GetDefaultAdditionsISO(); 1588 if (systemProperties.isOk() && !strAdditions.isEmpty()) 1589 return uisession()->sltInstallGuestAdditionsFrom(strAdditions); 1597 1590 1598 1591 /* Check for the already registered image */ … … 1617 1610 } 1618 1611 /* Else propose to download additions: */ 1619 else if (msgCenter().cannotFindGuestAdditions( QDir::toNativeSeparators(strSrc1), QDir::toNativeSeparators(strSrc2)))1612 else if (msgCenter().cannotFindGuestAdditions()) 1620 1613 { 1621 1614 /* Create Additions downloader: */
Note:
See TracChangeset
for help on using the changeset viewer.