Changeset 86648 in vbox
- Timestamp:
- Oct 20, 2020 1:59:45 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 22 edited
- 2 copied
-
VBox/Additions/linux/installer/vboxadd.sh (modified) (1 diff)
-
VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp (modified) (1 diff)
-
VBox/Frontends/VBoxManage/VBoxManageCloud.cpp (modified) (7 diffs)
-
VBox/Frontends/VBoxSDL/VBoxSDL.cpp (modified) (5 diffs)
-
VBox/GuestHost/OpenGL (copied) (copied from trunk/src/VBox/GuestHost/OpenGL )
-
VBox/HostServices/SharedOpenGL (copied) (copied from trunk/src/VBox/HostServices/SharedOpenGL )
-
VBox/Main/UnattendedTemplates/ol_ks.cfg (modified) (1 diff)
-
VBox/Main/UnattendedTemplates/ol_postinstall.sh (modified) (1 diff)
-
VBox/Main/UnattendedTemplates/redhat67_ks.cfg (modified) (1 diff)
-
VBox/Main/UnattendedTemplates/redhat_postinstall.sh (modified) (1 diff)
-
VBox/Main/idl/VirtualBox.xidl (modified) (2 diffs)
-
VBox/Main/include/ApplianceImpl.h (modified) (1 diff)
-
VBox/Main/include/ProgressImpl.h (modified) (1 diff)
-
VBox/Main/include/UnattendedInstaller.h (modified) (5 diffs)
-
VBox/Main/include/UnattendedScript.h (modified) (1 diff)
-
VBox/Main/src-all/ProgressImpl.cpp (modified) (2 diffs)
-
VBox/Main/src-server/ApplianceImpl.cpp (modified) (2 diffs)
-
VBox/Main/src-server/ApplianceImplExport.cpp (modified) (4 diffs)
-
VBox/Main/src-server/UnattendedScript.cpp (modified) (11 diffs)
-
VBox/Runtime/common/crypto/key-file.cpp (modified) (1 diff)
-
VBox/Runtime/generic/http-curl.cpp (modified) (3 diffs)
-
VBox/ValidationKit/tests/api/tdAppliance1.py (modified) (1 diff)
-
VBox/ValidationKit/tests/api/tdMoveVm1.py (modified) (2 diffs)
-
libs/curl-7.64.0/lib/sendf.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r84947 r86648 356 356 echo "KERNEL=${udev_fix}\"vboxuser\", NAME=\"vboxuser\", OWNER=\"vboxadd\", MODE=\"0666\"" >> /etc/udev/rules.d/60-vboxadd.rules 357 357 # Make sure the new rule is noticed. 358 udevadm control --reload >/dev/null 2>&1 || true358 udevadm control --reload-rules >/dev/null 2>&1 || true 359 359 udevcontrol reload_rules >/dev/null 2>&1 || true 360 360 fi -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
r85631 r86648 1113 1113 case VirtualSystemDescriptionType_CloudPublicSSHKey: 1114 1114 case VirtualSystemDescriptionType_BootingFirmware: 1115 case VirtualSystemDescriptionType_CloudInstanceMetadata: 1116 case VirtualSystemDescriptionType_CloudInstanceFreeFormTags: 1117 case VirtualSystemDescriptionType_CloudImageFreeFormTags: 1118 1115 1119 /** @todo VirtualSystemDescriptionType_Miscellaneous? */ 1116 1120 break; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp
r86153 r86648 123 123 int vrc = RTGetOptInit(&GetState, a->argc, a->argv, s_aOptions, RT_ELEMENTS(s_aOptions), iFirst, 0); 124 124 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 125 if (a->argc == iFirst)126 {127 RTPrintf("Empty command parameter list, show help.\n");128 printHelp(g_pStdOut);129 return RTEXITCODE_SUCCESS;130 }131 125 132 126 Utf8Str strCompartmentId; … … 295 289 int vrc = RTGetOptInit(&GetState, a->argc, a->argv, s_aOptions, RT_ELEMENTS(s_aOptions), iFirst, 0); 296 290 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 297 if (a->argc == iFirst)298 {299 RTPrintf("Empty command parameter list, show help.\n");300 printHelp(g_pStdOut);301 return RTEXITCODE_SUCCESS;302 }303 291 304 292 Utf8Str strCompartmentId; … … 542 530 543 531 Utf8Str strDisplayName, strImageId, strBootVolumeId, strPublicSSHKey; 532 bool fKeyPresented = false; 544 533 int c; 545 534 while ((c = RTGetOpt(&GetState, &ValueUnion)) != 0) … … 603 592 pVSD->AddDescription(VirtualSystemDescriptionType_CloudPublicSSHKey, 604 593 Bstr(ValueUnion.psz).raw(), NULL); 594 fKeyPresented = true; 605 595 break; 606 596 case 1001: … … 620 610 return RTEXITCODE_FAILURE; 621 611 622 if (strPublicSSHKey.isEmpty()) 623 RTPrintf("Warning!!! Public SSH key doesn't present in the passed arguments...\n"); 612 if ( fKeyPresented ) 613 if (strPublicSSHKey.isEmpty()) 614 RTPrintf("Warning!!! The value of the passed public SSH key is empty...\n"); 615 else 616 return errorArgument("Parameter --public-ssh-key is absent. if there is no need to pass a key just use the form" 617 " '--public-ssh-key='."); 624 618 625 619 if (strImageId.isNotEmpty() && strBootVolumeId.isNotEmpty()) … … 787 781 }; 788 782 789 const size_t vsdHReadableArraySize = 1 2;//the number of items in the vsdHReadableArray783 const size_t vsdHReadableArraySize = 14;//the number of items in the vsdHReadableArray 790 784 vsdHReadable vsdHReadableArray[vsdHReadableArraySize] = { 791 785 {VirtualSystemDescriptionType_CloudDomain, "Availability domain = %ls\n", "Availability domain wasn't found\n"}, … … 802 796 {VirtualSystemDescriptionType_CPU, "CPUs = %ls\n", "Numbers of CPUs weren't found\n"}, 803 797 {VirtualSystemDescriptionType_CloudPublicIP, "Instance public IP = %ls\n", "Public IP wasn't found\n"}, 804 {VirtualSystemDescriptionType_Miscellaneous, "%ls\n", "Free-form tags or metadata weren't found\n"} 798 {VirtualSystemDescriptionType_CloudInstanceMetadata, "%ls\n", "Metadata weren't found\n"}, 799 {VirtualSystemDescriptionType_CloudInstanceFreeFormTags, "%ls\n", "Instance free-form tags weren't found\n"}, 800 {VirtualSystemDescriptionType_CloudImageFreeFormTags, "%ls\n", "Image free-form tags weren't found\n"} 801 805 802 }; 806 803 -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r85121 r86648 363 363 } 364 364 #endif 365 break; 366 } 367 368 case VBoxEventType_OnProgressPercentageChanged: 369 { 370 ComPtr<IProgressPercentageChangedEvent> pV = aEvent; 371 Assert(pV); 372 LONG percent = 0; 373 pV->COMGETTER(Percent)(&percent); 374 { 375 LogRel(("VBoxSDLEventListener: got the percent %d from the event " 376 "VBoxEventType_OnProgressPercentageChanged.\n", percent)); 377 RTPrintf("VBoxSDLEventListener: got the percent %d from the event " 378 "VBoxEventType_OnProgressPercentageChanged.\n", percent); 379 } 365 380 break; 366 381 } … … 597 612 } 598 613 #endif /* !RT_OS_DARWIN */ 614 break; 615 } 616 617 case VBoxEventType_OnProgressPercentageChanged: 618 { 619 ComPtr<IProgressPercentageChangedEvent> pV = aEvent; 620 Assert(pV); 621 LONG percent = 0; 622 pV->COMGETTER(Percent)(&percent); 623 { 624 LogRel(("VBoxSDLConsoleEventListener: got the percent %d from the event " 625 "VBoxEventType_OnProgressPercentageChanged.\n", percent)); 626 RTPrintf("VBoxSDLConsoleEventListener: got the percent %d from the event " 627 "VBoxEventType_OnProgressPercentageChanged.\n", percent); 628 } 599 629 break; 600 630 } … … 2108 2138 com::SafeArray<VBoxEventType_T> eventTypes; 2109 2139 eventTypes.push_back(VBoxEventType_OnExtraDataChanged); 2140 2141 eventTypes.push_back(VBoxEventType_OnProgressPercentageChanged); 2110 2142 CHECK_ERROR(pES, RegisterListener(pVBoxListener, ComSafeArrayAsInParam(eventTypes), true)); 2111 2143 } … … 2125 2157 eventTypes.push_back(VBoxEventType_OnCanShowWindow); 2126 2158 eventTypes.push_back(VBoxEventType_OnShowWindow); 2159 eventTypes.push_back(VBoxEventType_OnProgressPercentageChanged); 2127 2160 CHECK_ERROR(pES, RegisterListener(pConsoleListener, ComSafeArrayAsInParam(eventTypes), true)); 2128 2161 // until we've tried to to start the VM, ignore power off events … … 2372 2405 case SDL_USER_EVENT_XPCOM_EVENTQUEUE: 2373 2406 { 2374 LogFlow(("SDL_USER_EVENT_XPCOM_EVENTQUEUE: processing XPCOM event queue...\n"));2407 // LogFlow(("SDL_USER_EVENT_XPCOM_EVENTQUEUE: processing XPCOM event queue...\n")); 2375 2408 eventQ->processEventQueue(0); 2376 2409 signalXPCOMEventQueueThread(); -
trunk/src/VBox/Main/UnattendedTemplates/ol_ks.cfg
r86269 r86648 82 82 glibc-headers 83 83 gcc 84 @@VBOX_ GUEST_OS_COND_VERSION@@**8.0.0**84 @@VBOX_COND_GUEST_VERSION[>8.0.0]@@ 85 85 elfutils-libelf-devel 86 @@VBOX_ GUEST_OS_COND_END@@86 @@VBOX_COND_END@@ 87 87 dkms 88 88 make -
trunk/src/VBox/Main/UnattendedTemplates/ol_postinstall.sh
r86276 r86648 202 202 log_command_in_target yum -y install binutils 203 203 log_command_in_target yum -y install make 204 @@VBOX_ GUEST_OS_COND_VERSION@@**8.0.0**204 @@VBOX_COND_GUEST_VERSION[>8.0.0]@@ 205 205 log_command_in_target yum -y install elfutils-libelf-devel 206 @@VBOX_ GUEST_OS_COND_END@@206 @@VBOX_COND_END@@ 207 207 log_command_in_target yum -y install dkms 208 208 log_command_in_target yum -y install make -
trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg
r86269 r86648 82 82 glibc-headers 83 83 gcc 84 @@VBOX_ GUEST_OS_COND_VERSION@@**8.0.0**84 @@VBOX_COND_GUEST_VERSION[>8.0.0]@@ 85 85 elfutils-libelf-devel 86 @@VBOX_ GUEST_OS_COND_END@@86 @@VBOX_COND_END@@ 87 87 dkms 88 88 make -
trunk/src/VBox/Main/UnattendedTemplates/redhat_postinstall.sh
r86269 r86648 178 178 log_command_in_target yum -y install binutils 179 179 log_command_in_target yum -y install make 180 @@VBOX_ GUEST_OS_COND_VERSION@@**8.0.0**180 @@VBOX_COND_GUEST_VERSION[>8.0.0]@@ 181 181 log_command_in_target yum -y install elfutils-libelf-devel 182 @@VBOX_ GUEST_OS_COND_END@@182 @@VBOX_COND_END@@ 183 183 log_command_in_target yum -y install dkms 184 184 log_command_in_target yum -y install make -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r86553 r86648 4178 4178 <enum 4179 4179 name="VirtualSystemDescriptionType" 4180 uuid=" 6e18c6d7-e1b7-4cb0-9706-1f31d18248f8"4180 uuid="70c5ca7b-65a8-49cc-9b19-e80192b9db1d" 4181 4181 > 4182 4182 <desc>Used with <link to="IVirtualSystemDescription" /> to describe the type of … … 4246 4246 <const name="CloudPublicSSHKey" value="48" /> 4247 4247 <const name="BootingFirmware" value="49" /> 4248 <const name="CloudInstanceMetadata" value="50" /> 4249 <const name="CloudInstanceFreeFormTags" value="51" /> 4250 <const name="CloudImageFreeFormTags" value="52" /> 4248 4251 <const name="HardDiskControllerVirtioSCSI" value="60" /> 4249 4252 </enum> -
trunk/src/VBox/Main/include/ApplianceImpl.h
r86509 r86648 145 145 static void i_exportOPCThreadTask(TaskOPC *pTask); 146 146 static void i_importOrExportCloudThreadTask(TaskCloud *pTask); 147 148 HRESULT i_findFirstBootableImage(ComPtr<IMedium>& bootMedium, const ComPtr<IMachine> &pMachine); 147 149 148 150 HRESULT i_initBackendNames(); -
trunk/src/VBox/Main/include/ProgressImpl.h
r85251 r86648 157 157 static DECLCALLBACK(int) i_vdProgressCallback(void *pvUser, unsigned uPercentage); 158 158 159 HRESULT i_addOperations(ULONG cOperations, ULONG ulTotalOperationsWeight); 159 160 protected: 160 161 DECLARE_EMPTY_CTOR_DTOR(Progress) -
trunk/src/VBox/Main/include/UnattendedInstaller.h
r86270 r86648 520 520 /** 521 521 * RHEL 7 installer (same as RHEL 6). 522 * The class was added for better handling any possible subtle difference between RHEL6 and RHEL7. 522 523 */ 523 524 class UnattendedRhel7Installer : public UnattendedRhel6Installer … … 540 541 /** 541 542 * RHEL 8 installer (same as RHEL 7). 543 * The class was added for better handling any possible subtle difference between RHEL7 and RHEL8. 542 544 */ 543 545 class UnattendedRhel8Installer : public UnattendedRhel7Installer … … 605 607 606 608 /** 607 * Oracle Linux 6 installer. 609 * Oracle Linux 6 installer. 610 * (same as RHEL 6, except for the templates). 611 * The reason of adding new class is to sepatate the RHEL from OL. 608 612 */ 609 613 class UnattendedOracleLinux6Installer : public UnattendedRhel6Installer … … 621 625 622 626 /** 623 * Oracle Linux 7 installer. 627 * Oracle Linux 7 installer. Same as OL 6. 628 * The class was added for better handling any possible subtle difference between OL6 and OL7. 624 629 */ 625 630 class UnattendedOracleLinux7Installer : public UnattendedOracleLinux6Installer … … 641 646 642 647 /** 643 * Oracle Linux 8 installer. 648 * Oracle Linux 8 installer. Same as OL 7. 649 * The class was added for better handling any possible subtle difference between OL7 and OL8. 644 650 */ 645 651 class UnattendedOracleLinux8Installer : public UnattendedOracleLinux7Installer -
trunk/src/VBox/Main/include/UnattendedScript.h
r86274 r86648 96 96 virtual HRESULT getConditional(const char *pachPlaceholder, size_t cchPlaceholder, bool *pfOutputting); 97 97 98 99 /**100 * Get the result of a conditional for special version of guest OS.101 *102 * @returns COM status code.103 * @param pachPlaceholder The placholder string. Not zero terminated.104 * @param cchPlaceholder The length of the placeholder.105 * @param cchContent The length of placeholder content.106 * @param pcchCorrect The length of part which must be excluded from the final content of107 * the placeholder.108 * @param pfOutputting Where to return the result of the conditional.109 * This holds the current outputting state on input110 * in case someone want to sanity check anything.111 */112 virtual HRESULT getGuestOSConditional(const char *pachPlaceholder,113 size_t cchPlaceholder,114 size_t cchContent,115 size_t *pcchCorrect,116 bool *pfOutputting);117 98 }; 118 99 -
trunk/src/VBox/Main/src-all/ProgressImpl.cpp
r85307 r86648 321 321 322 322 // public methods only for internal purposes 323 324 HRESULT Progress::i_addOperations(ULONG cOperations, ULONG ulTotalOperationsWeight) 325 { 326 m_cOperations += cOperations; 327 m_ulTotalOperationsWeight += ulTotalOperationsWeight; 328 return S_OK; 329 } 323 330 //////////////////////////////////////////////////////////////////////////////// 324 331 … … 1059 1066 m_ulOperationPercent = 0; 1060 1067 1061 Log ThisFunc(("%s: aNextOperationsWeight = %d; m_ulCurrentOperation is now %d, m_ulOperationsCompletedWeight is now %d\n",1068 LogRel(("%s: aNextOperationsWeight = %d; m_ulCurrentOperation is now %d, m_ulOperationsCompletedWeight is now %d\n", 1062 1069 m_operationDescription.c_str(), aNextOperationsWeight, m_ulCurrentOperation, m_ulOperationsCompletedWeight)); 1063 1070 -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r86509 r86648 26 26 #include <VBox/com/array.h> 27 27 #include <map> 28 #include <stack> 28 29 29 30 #include "ApplianceImpl.h" … … 1409 1410 } 1410 1411 1412 HRESULT Appliance::i_findFirstBootableImage(ComPtr<IMedium>& bootMedium, const ComPtr<IMachine> &pMachine) 1413 { 1414 HRESULT hrc = S_OK; 1415 LogFlowFuncEnter(); 1416 1417 const ComPtr<IMachine> &baseMachine = pMachine; 1418 try 1419 { 1420 /* Fetch all available storage controllers */ 1421 com::SafeIfaceArray<IStorageController> aStorageControllers; 1422 // AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1423 hrc = baseMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(aStorageControllers)); 1424 // alock.release(); 1425 bool fBootMediumFound = false; 1426 ComPtr<IMedium> ptrBootMedium; 1427 std::stack <StorageBus_T> aBuses; 1428 //insert buses in priority StorageBus_IDE - highest, StorageBus_SAS - lowest 1429 aBuses.push(StorageBus_SAS); 1430 aBuses.push(StorageBus_SCSI); 1431 aBuses.push(StorageBus_SATA); 1432 aBuses.push(StorageBus_IDE); 1433 1434 while (!aBuses.empty()) 1435 { 1436 Bstr bstrControllerName; 1437 Utf8Str strControllerName; 1438 ComPtr<IStorageController> sc; 1439 StorageBus_T eTargetStorageBusType = aBuses.top(); 1440 StorageBus_T eSourceStorageBusType; 1441 bool f = false; 1442 1443 for (size_t i=0; i<aStorageControllers.size(); ++i) 1444 { 1445 sc = aStorageControllers[i]; 1446 sc->COMGETTER(Name)(bstrControllerName.asOutParam()); 1447 sc->COMGETTER(Bus)(&eSourceStorageBusType); 1448 if (eSourceStorageBusType == eTargetStorageBusType) 1449 { 1450 f = true; 1451 break; 1452 } 1453 } 1454 1455 if (!f) 1456 { 1457 aBuses.pop(); 1458 continue; 1459 } 1460 1461 com::SafeIfaceArray<IMediumAttachment> aMediumAttachments; 1462 hrc = baseMachine->GetMediumAttachmentsOfController(bstrControllerName.raw(), 1463 ComSafeArrayAsOutParam(aMediumAttachments)); 1464 1465 strControllerName = bstrControllerName; 1466 AssertLogRelReturn(strControllerName.isNotEmpty(), setErrorBoth(E_UNEXPECTED, VERR_INTERNAL_ERROR_2)); 1467 1468 for (size_t j = 0; j < aMediumAttachments.size(); j++) 1469 { 1470 //some checks just in case 1471 LONG iPort = -1; 1472 hrc = aMediumAttachments[j]->COMGETTER(Port)(&iPort); 1473 AssertComRCReturn(hrc, hrc); 1474 1475 LONG iDevice = -1; 1476 hrc = aMediumAttachments[j]->COMGETTER(Device)(&iDevice); 1477 AssertComRCReturn(hrc, hrc); 1478 1479 DeviceType_T enmType; 1480 hrc = aMediumAttachments[j]->COMGETTER(Type)(&enmType); 1481 AssertComRCReturn(hrc, hrc); 1482 1483 if (enmType == DeviceType_HardDisk) 1484 { 1485 ComPtr<IMedium> ptrMedium; 1486 hrc = aMediumAttachments[j]->COMGETTER(Medium)(ptrMedium.asOutParam()); 1487 AssertComRCReturn(hrc, hrc); 1488 1489 if (ptrMedium.isNotNull()) 1490 { 1491 ptrBootMedium = ptrMedium; 1492 fBootMediumFound = true; 1493 break; 1494 } 1495 } 1496 } 1497 1498 if (fBootMediumFound) 1499 { 1500 hrc = S_OK; 1501 break; 1502 } 1503 else 1504 aBuses.pop(); 1505 } 1506 1507 if (ptrBootMedium != NULL && !ptrBootMedium.isNull()) 1508 ptrBootMedium.queryInterfaceTo(bootMedium.asOutParam()); 1509 } 1510 catch (HRESULT erc) 1511 { 1512 hrc = setError(erc, tr("Exception during finding a bootable disk ")); 1513 } 1514 1515 LogFlowFuncLeave(); 1516 return hrc; 1517 } 1518 1411 1519 void i_parseURI(Utf8Str strUri, LocationInfo &locInfo) 1412 1520 { -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r85364 r86648 712 712 try 713 713 { 714 alock.release(); 714 715 rc = i_writeCloudImpl(m->locInfo, progress); 716 alock.acquire(); 715 717 } 716 718 catch (HRESULT aRC) … … 883 885 HRESULT Appliance::i_writeCloudImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress) 884 886 { 887 HRESULT hrc = S_OK; 888 885 889 for (list<ComObjPtr<VirtualSystemDescription> >::const_iterator 886 890 it = m->virtualSystemDescriptions.begin(); … … 897 901 } 898 902 899 //remove all disks from the VirtualSystemDescription exept one 903 //Detect bootable disk and remove others from the VirtualSystemDescription 904 ComPtr<IMedium> pBootableMedium; 905 hrc = i_findFirstBootableImage(pBootableMedium, vsdescThis->m->pMachine); 906 907 if (FAILED(hrc)) 908 throw hrc; 909 if (pBootableMedium.isNull()) 910 throw hrc = setError(VBOX_E_OBJECT_NOT_FOUND, tr("Could not find any bootable disk")); 911 912 ComPtr<IMedium> pBootableBaseMedium; 913 // returns pBootableMedium if there are no diff images 914 hrc = pBootableMedium->COMGETTER(Base)(pBootableBaseMedium.asOutParam()); 915 if (FAILED(hrc)) 916 throw hrc; 917 918 //Get base bootable disk location 919 Bstr bstrBootLocation; 920 hrc = pBootableBaseMedium->COMGETTER(Location)(bstrBootLocation.asOutParam()); 921 if (FAILED(hrc)) throw hrc; 922 Utf8Str strBootLocation = bstrBootLocation; 923 900 924 skipped = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskImage); 901 925 itSkipped = skipped.begin(); 902 903 Utf8Str strBootLocation;904 926 while (itSkipped != skipped.end()) 905 927 { 906 if (strBootLocation.isEmpty()) 907 strBootLocation = (*itSkipped)->strVBoxCurrent; 928 Utf8Str path = (*itSkipped)->strVBoxCurrent; 929 // Locate the Medium object for this entry (by location/path). 930 Log(("Finding disk \"%s\"\n", path.c_str())); 931 ComObjPtr<Medium> ptrSourceDisk; 932 hrc = mVirtualBox->i_findHardDiskByLocation(path, true , &ptrSourceDisk); 933 if (FAILED(hrc)) 934 throw hrc; 935 936 if (!path.equalsIgnoreCase(strBootLocation)) 937 (*itSkipped)->skipIt = true; 908 938 else 909 (*itSkipped)->skipIt = true; 939 LogRel(("Possible bootable disk \"%s\"\n", path.c_str())); 940 910 941 ++itSkipped; 911 942 } … … 932 963 933 964 // Create a progress object here otherwise Task won't be created successfully 934 HRESULThrc = aProgress.createObject();965 hrc = aProgress.createObject(); 935 966 if (SUCCEEDED(hrc)) 936 967 { -
trunk/src/VBox/Main/src-server/UnattendedScript.cpp
r86336 r86648 59 59 static const char s_szPrefixCond[] = "@@VBOX_COND_"; 60 60 static const char s_szPrefixCondEnd[] = "@@VBOX_COND_END@@"; 61 static const char s_szPrefixCondGuestOs[] = "@@VBOX_GUEST_OS_COND_";62 static const char s_szPrefixCondGuestOsEnd[] = "@@VBOX_GUEST_OS_COND_END@@";63 61 64 62 struct … … 71 69 size_t offTemplate = 0; 72 70 size_t cchTemplate = mStrScriptFullContent.length(); 73 size_t cchInternalCorrect = 0;//used in logic handling the placeholder @@VBOX_GUEST_OS_COND_XXX@@74 71 rStrDst.setNull(); 75 72 for (;;) … … 86 83 try 87 84 { 88 rStrDst.append(mStrScriptFullContent, offTemplate + cchInternalCorrect, cchToCopy - + cchInternalCorrect);85 rStrDst.append(mStrScriptFullContent, offTemplate, cchToCopy); 89 86 } 90 87 catch (std::bad_alloc &) … … 95 92 } 96 93 offTemplate += cchToCopy; 97 cchInternalCorrect = 0;//don't forget to reset98 94 } 99 95 … … 111 107 while ( offPlaceholder + cchPlaceholder < cchTemplate 112 108 && (ch = pszPlaceholder[cchPlaceholder]) != '\0' 113 && ( ch == '_' 109 && ( ch == '_' || ch == '[' || ch == ']' || ch == '.' || ch == '>' || ch == '<' 114 110 || RT_C_IS_UPPER(ch) 115 111 || RT_C_IS_DIGIT(ch)) ) … … 128 124 || pszPlaceholder[cchPlaceholder - 2] != '@' 129 125 || ( strncmp(pszPlaceholder, s_szPrefixInsert, sizeof(s_szPrefixInsert) - 1) != 0 130 && strncmp(pszPlaceholder, s_szPrefixCond, sizeof(s_szPrefixCond) - 1) != 0 131 && strncmp(pszPlaceholder, s_szPrefixCondGuestOs, sizeof(s_szPrefixCondGuestOs) - 1) != 0) ) 126 && strncmp(pszPlaceholder, s_szPrefixCond, sizeof(s_szPrefixCond) - 1) != 0 ) ) 132 127 { 133 128 hrc = mpSetError->setError(E_FAIL, mpSetError->tr("Malformed template placeholder '%.*s'"), … … 188 183 * one from the condition. 189 184 */ 190 else if ( strncmp(pszPlaceholder, s_szPrefixCond, sizeof(s_szPrefixCond) - 1U) == 0 ) 191 { 185 else 186 { 187 Assert(strncmp(pszPlaceholder, s_szPrefixCond, sizeof(s_szPrefixCond) - 1) == 0); 192 188 if (cConds + 1 < RT_ELEMENTS(aConds)) 193 189 { … … 195 191 bool fNewOutputting = fOutputting; 196 192 hrc = getConditional(pszPlaceholder, cchPlaceholder, &fNewOutputting); 197 if (SUCCEEDED(hrc))198 fOutputting = fOutputting && fNewOutputting;199 else200 break;201 cConds++;202 }203 else204 {205 hrc = mpSetError->setErrorBoth(E_FAIL, VERR_PARSE_ERROR,206 mpSetError->tr("Too deep conditional nesting at offset %zu (%#zx)"),207 offPlaceholder, offPlaceholder);208 break;209 }210 }211 /*212 * @@VBOX_GUEST_OS_COND_END@@: Pop one item of the conditional stack.213 */214 else if ( strncmp(pszPlaceholder, s_szPrefixCondGuestOsEnd, sizeof(s_szPrefixCondGuestOsEnd) - 1U) == 0 )215 {216 if (cConds > 0)217 {218 cConds--;219 fOutputting = aConds[cConds].fSavedOutputting;220 }221 else222 {223 hrc = mpSetError->setErrorBoth(E_FAIL, VERR_PARSE_ERROR,224 mpSetError->tr("%s without @@VBOX_GUEST_OS_COND_XXX@@ at offset %zu (%#zx)"),225 s_szPrefixCondGuestOsEnd, offPlaceholder, offPlaceholder);226 break;227 }228 }229 /*230 * @@VBOX_GUEST_OS_COND_XXX@@: Push the previous outputting state and combine it with the231 * one from the condition.232 */233 else234 {235 Assert(strncmp(pszPlaceholder, s_szPrefixCondGuestOs, sizeof(s_szPrefixCondGuestOs) - 1) == 0);236 if (cConds + 1 < RT_ELEMENTS(aConds))237 {238 aConds[cConds].fSavedOutputting = fOutputting;239 bool fNewOutputting = fOutputting;240 241 //offTemplate is the beginning of content, offEndContent is the end of content242 //@@PLACEHOLDER_BEGIN@@Content@@PLACEHOLDER_END@@243 // ^ ^244 // | |245 // offTemplate offEndContent246 size_t offEndContent = mStrScriptFullContent.find(s_szPrefix, offTemplate);247 size_t cchContent = offEndContent - offTemplate - 1;248 hrc = getGuestOSConditional(pszPlaceholder, cchPlaceholder, cchContent, &cchInternalCorrect, &fNewOutputting);249 193 if (SUCCEEDED(hrc)) 250 194 fOutputting = fOutputting && fNewOutputting; … … 499 443 } 500 444 501 HRESULT UnattendedScriptTemplate::getGuestOSConditional(const char *pachPlaceholder,502 size_t cchPlaceholder,503 size_t cchContent,504 size_t *cchCorrect,505 bool *pfOutputting)506 {507 #define IS_PLACEHOLDER_MATCH(a_szMatch) \508 ( cchPlaceholder == sizeof("@@VBOX_GUEST_OS_COND_" a_szMatch "@@") - 1U \509 && memcmp(pachPlaceholder, "@@VBOX_GUEST_OS_COND_" a_szMatch "@@", sizeof("@@VBOX_GUEST_OS_COND_" a_szMatch "@@") - 1U) == 0)510 511 if ( IS_PLACEHOLDER_MATCH("VERSION") )512 {513 Utf8Str strT(pachPlaceholder + cchPlaceholder, cchContent);514 RTCList<RTCString> partList = strT.split("**");515 Utf8Str strRequiredOSVersion;516 if (partList.size() == 2)//when the version is placed together with the placeholder in one line in the file517 {518 //The case when the string has been splitted on the 2 parts:519 //1. OS version520 //2. Actual content521 strRequiredOSVersion.assign(partList.at(0));522 //cchCorrect = "**" + length of OS version string + "**"523 *cchCorrect = 2 + partList.at(0).length() + 2;// must be subtracted from the cchContent524 }525 else if (partList.size() == 3)//when the version is placed on a standalone line in the file526 {527 //The case when the string has been splitted on the 3 parts:528 //1. Empty string or string with only "\n"529 //2. OS version530 //3. Actual content531 strRequiredOSVersion.assign(partList.at(1));532 *cchCorrect = 2 + partList.at(0).length() + partList.at(1).length() + 2;// must be subtracted from the cchContent533 }534 else//case with wrong string syntax535 {536 *cchCorrect = 0;537 *pfOutputting = false;538 LogRel(("Malformed content of the template @@VBOX_GUEST_OS_COND_VERSION@@\n"));539 return S_OK;540 }541 542 if (strRequiredOSVersion.isEmpty())543 *pfOutputting = false;544 else545 {546 Utf8Str strDetectedOSVersion = mpUnattended->i_getDetectedOSVersion();547 RTCList<RTCString> partListRequired = strRequiredOSVersion.split(".");548 RTCList<RTCString> partListDetected = strDetectedOSVersion.split(".");549 *pfOutputting = false;//initially is set to "false"550 551 /** @todo r=vvp: Should we check the string with a requested OS version for digits?552 * (with RTLocCIsDigit()) */553 //Major version must be presented554 if ( partListDetected.at(0).toUInt32() >= partListRequired.at(0).toUInt32() )//comparison major versions555 {556 //OS major versions are equal or detected guest OS major version is greater. Go further.557 if (partListDetected.size() > 1 && partListRequired.size() > 1)//comparison minor versions558 {559 if (partListDetected.at(1).toUInt32() >= partListRequired.at(1).toUInt32())560 //OS minor versions are equal or detected guest OS minor version is greater. Go further.561 *pfOutputting = true;562 else563 //The detected guest OS minor version is less than the requested one.564 *pfOutputting = false;565 }566 else567 //OS minor versions are absent.568 *pfOutputting = true;569 }570 else571 //The detected guest OS major version is less than the requested one.572 *pfOutputting = false;573 }574 }575 else576 return mpSetError->setErrorBoth(E_FAIL, VERR_NOT_FOUND, mpSetError->tr("Unknown conditional placeholder '%.*s'"),577 cchPlaceholder, pachPlaceholder);578 return S_OK;579 #undef IS_PLACEHOLDER_MATCH580 }581 582 445 HRESULT UnattendedScriptTemplate::getConditional(const char *pachPlaceholder, size_t cchPlaceholder, bool *pfOutputting) 583 446 { … … 585 448 ( cchPlaceholder == sizeof("@@VBOX_COND_" a_szMatch "@@") - 1U \ 586 449 && memcmp(pachPlaceholder, "@@VBOX_COND_" a_szMatch "@@", sizeof("@@VBOX_COND_" a_szMatch "@@") - 1U) == 0) 450 451 #define IS_PLACEHOLDER_PARTIALLY_MATCH(a_szMatch) \ 452 (memcmp(pachPlaceholder, "@@VBOX_COND_" a_szMatch, sizeof("@@VBOX_COND_" a_szMatch) - 1U) == 0) 587 453 588 454 /* Install Guest Additions: */ … … 623 489 else if (IS_PLACEHOLDER_MATCH("HAS_PROXY")) 624 490 *pfOutputting = mpUnattended->i_getProxy().isNotEmpty(); 491 else if (IS_PLACEHOLDER_PARTIALLY_MATCH("GUEST_VERSION")) 492 { 493 //parse the placeholder and extract the OS version from there 494 RTCString strPlaceHolder(pachPlaceholder); 495 size_t startPos = sizeof("@@VBOX_COND_GUEST_VERSION") - 1;//-1 is for '\n' 496 size_t endPos = strPlaceHolder.find("@@", startPos + 2); 497 //next part should look like [>8.0.0] for example where: 498 // - "[,]" is just the brackets to wrap up the condition; 499 // - ">" is "greater". Also possible comparison is "<"; 500 // - 8.0.0 is required guest OS version. 501 //The end of placeholder is "@@" like for others. 502 503 if ( strPlaceHolder[endPos] == '@' 504 && strPlaceHolder[endPos+1] == '@' ) 505 { 506 if ( strPlaceHolder[startPos++] == '[' && strPlaceHolder[--endPos] == ']' ) 507 { 508 char chComp = strPlaceHolder[startPos++]; 509 RTCString strRequiredOSVersion = strPlaceHolder.substr(startPos, endPos - startPos); 510 RTCString strDetectedOSVersion = mpUnattended->i_getDetectedOSVersion(); 511 int res = RTStrVersionCompare(strDetectedOSVersion.c_str(), strRequiredOSVersion.c_str()); 512 if ( res >= 0 && chComp == '>' ) 513 *pfOutputting = true; 514 else if ( res < 0 && chComp == '<' ) 515 *pfOutputting = true; 516 else 517 *pfOutputting = false; 518 } 519 } 520 else 521 *pfOutputting = false;//initially is set to "false" 522 } 625 523 else 626 524 return mpSetError->setErrorBoth(E_FAIL, VERR_NOT_FOUND, mpSetError->tr("Unknown conditional placeholder '%.*s'"), -
trunk/src/VBox/Runtime/common/crypto/key-file.cpp
r85121 r86648 106 106 { g_aWords_PublicKey, RT_ELEMENTS(g_aWords_PublicKey) }, 107 107 { g_aWords_RsaPrivateKey, RT_ELEMENTS(g_aWords_RsaPrivateKey) }, 108 { g_aWords_EncryptedPrivateKey, RT_ELEMENTS(g_aWords_EncryptedPrivateKey) }, 108 109 { g_aWords_PrivateKey, RT_ELEMENTS(g_aWords_PrivateKey) }, 109 110 }; -
trunk/src/VBox/Runtime/generic/http-curl.cpp
r86448 r86648 404 404 405 405 *phHttp = (RTHTTP)pThis; 406 406 #if 0 // XXX: uwe 407 { 408 const char *verbose = getenv("CURL_VERBOSE"); 409 if (verbose != NULL && *verbose != '0') 410 curl_easy_setopt(pThis->pCurl, CURLOPT_VERBOSE, 1L); 411 } 412 #endif 407 413 return VINF_SUCCESS; 408 414 } … … 440 446 pThis->rcOutput = VINF_SUCCESS; 441 447 442 /* Tell the proxy configuration code to reapply settings even if they 443 didn't change as cURL has forgotten them: */ 444 pThis->fReapplyProxyInfo = true; 448 #if 0 // XXX: uwe 449 { 450 const char *verbose = getenv("CURL_VERBOSE"); 451 if (verbose != NULL && *verbose != '0') 452 curl_easy_setopt(pThis->pCurl, CURLOPT_VERBOSE, 1L); 453 } 454 #endif 445 455 446 456 return VINF_SUCCESS; … … 2636 2646 pThis->fDeleteCaFile = true; 2637 2647 pThis->pszCaFile = pszCaFile; 2648 2649 // RTPrintf("pszCaFile=\"%s\"\n", pszCaFile); // XXX: uwe 2650 2638 2651 return VINF_SUCCESS; 2639 2652 } -
trunk/src/VBox/ValidationKit/tests/api/tdAppliance1.py
r82968 r86648 61 61 """ 62 62 fRc = True; 63 64 if not self.oTstDrv.importVBoxApi(): 65 return False 63 66 64 67 # Import a set of simple OVAs. -
trunk/src/VBox/ValidationKit/tests/api/tdMoveVm1.py
r86505 r86648 145 145 fRc = True 146 146 try: 147 148 ## @todo r=bird: Too much unncessary crap inside try clause. Only oVM.moveTo needs to be here.149 ## Though, you could make an argument for oVM.name too, perhaps.150 151 147 # move machine 152 148 reporter.log('Moving machine "%s" to the "%s"' % (oVM.name, sLocation)) … … 236 232 237 233 reporter.log('####### Reference locations: #######') 238 for eachItem in a Actuals:234 for eachItem in aReferences: 239 235 reporter.log(' "%s"' % (eachItem)) 240 236 -
trunk/src/libs/curl-7.64.0/lib/sendf.c
r85671 r86648 828 828 case CURLINFO_HEADER_OUT: 829 829 case CURLINFO_HEADER_IN: 830 case CURLINFO_DATA_IN: /* XXX: uwe */ 831 case CURLINFO_DATA_OUT: /* XXX: uwe */ 830 832 fwrite(s_infotype[type], 2, 1, data->set.err); 831 833 fwrite(ptr, size, 1, data->set.err);
Note:
See TracChangeset
for help on using the changeset viewer.

