Changeset 97310 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 26, 2022 4:07:46 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r96816 r97310 363 363 if (uiCommon().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx)) 364 364 { 365 /* VT-x/AMD-V: */ 366 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled)) 367 { 368 acceleration << QApplication::translate("UIDetails", "VT-x/AMD-V", "details (system)"); 369 /* Nested Paging (only when hw virt is enabled): */ 370 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging)) 371 acceleration << QApplication::translate("UIDetails", "Nested Paging", "details (system)"); 372 } 365 /* Nested Paging: */ 366 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging)) 367 acceleration << QApplication::translate("UIDetails", "Nested Paging", "details (system)"); 373 368 } 374 369 /* PAE/NX: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r97135 r97310 462 462 if (m_machine.isOk()) 463 463 { 464 UIMachineSettingsGeneral *pGeneralPage =465 qobject_cast<UIMachineSettingsGeneral*>(m_pSelector->idToPage(MachineSettingsPageType_General));466 464 UIMachineSettingsSystem *pSystemPage = 467 465 qobject_cast<UIMachineSettingsSystem*>(m_pSelector->idToPage(MachineSettingsPageType_System)); … … 470 468 qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(MachineSettingsPageType_Display)); 471 469 #endif /* VBOX_WITH_3D_ACCELERATION */ 472 473 /* Guest OS type & VT-x/AMD-V option correlation auto-fix: */474 if (pGeneralPage && pSystemPage &&475 pGeneralPage->is64BitOSTypeSelected() && !pSystemPage->isHWVirtExEnabled())476 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, true);477 470 478 471 #ifdef VBOX_WITH_3D_ACCELERATION … … 538 531 /* Make changes on 'system' page influent 'general' and 'storage' page: */ 539 532 UIMachineSettingsSystem *pSystemPage = qobject_cast<UIMachineSettingsSystem*>(pSettingsPage); 540 UIMachineSettingsGeneral *pGeneralPage = qobject_cast<UIMachineSettingsGeneral*>(m_pSelector->idToPage(MachineSettingsPageType_General));541 533 UIMachineSettingsStorage *pStoragePage = qobject_cast<UIMachineSettingsStorage*>(m_pSelector->idToPage(MachineSettingsPageType_Storage)); 542 if (pSystemPage) 543 { 544 if (pGeneralPage) 545 pGeneralPage->setHWVirtExEnabled(pSystemPage->isHWVirtExEnabled()); 546 if (pStoragePage) 547 pStoragePage->setChipsetType(pSystemPage->chipsetType()); 548 } 534 if (pSystemPage && pStoragePage) 535 pStoragePage->setChipsetType(pSystemPage->chipsetType()); 549 536 break; 550 537 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIAccelerationFeaturesEditor.cpp
r96407 r97310 38 38 UIAccelerationFeaturesEditor::UIAccelerationFeaturesEditor(QWidget *pParent /* = 0 */) 39 39 : QIWithRetranslateUI<QWidget>(pParent) 40 , m_fEnableVirtualization(false)41 40 , m_fEnableNestedPaging(false) 42 41 , m_pLabel(0) 43 , m_pCheckBoxEnableVirtualization(0)44 42 , m_pCheckBoxEnableNestedPaging(0) 45 43 { 46 44 prepare(); 47 }48 49 void UIAccelerationFeaturesEditor::setEnableVirtualization(bool fOn)50 {51 /* Update cached value and52 * check-box if value has changed: */53 if (m_fEnableVirtualization != fOn)54 {55 m_fEnableVirtualization = fOn;56 if (m_pCheckBoxEnableVirtualization)57 m_pCheckBoxEnableVirtualization->setCheckState(m_fEnableVirtualization ? Qt::Checked : Qt::Unchecked);58 }59 }60 61 bool UIAccelerationFeaturesEditor::isEnabledVirtualization() const62 {63 return m_pCheckBoxEnableVirtualization64 ? m_pCheckBoxEnableVirtualization->checkState() == Qt::Checked65 : m_fEnableVirtualization;66 }67 68 void UIAccelerationFeaturesEditor::setEnableVirtualizationAvailable(bool fAvailable)69 {70 m_pCheckBoxEnableVirtualization->setEnabled(fAvailable);71 45 } 72 46 … … 110 84 if (m_pLabel) 111 85 m_pLabel->setText(tr("Hardware Virtualization:")); 112 if (m_pCheckBoxEnableVirtualization)113 {114 m_pCheckBoxEnableVirtualization->setText(tr("Enable &VT-x/AMD-V"));115 m_pCheckBoxEnableVirtualization->setToolTip(tr("When checked, the virtual machine will try to make use of the host "116 "CPU's hardware virtualization extensions such as Intel VT-x and AMD-V."));117 }118 86 if (m_pCheckBoxEnableNestedPaging) 119 87 { … … 133 101 m_pLayout->setColumnStretch(1, 1); 134 102 135 /* Prepare label layout: */136 QVBoxLayout *pLayoutLabel = new QVBoxLayout;137 if ( pLayoutLabel)103 /* Prepare virtualization label: */ 104 m_pLabel = new QLabel(this); 105 if (m_pLabel) 138 106 { 139 /* Prepare virtualization label: */ 140 m_pLabel = new QLabel(this); 141 if (m_pLabel) 142 { 143 m_pLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 144 pLayoutLabel->addWidget(m_pLabel); 145 } 146 /* Prepare placeholder: */ 147 QWidget *pWidgetPlaceholder = new QWidget(this); 148 if (pWidgetPlaceholder) 149 { 150 #ifndef VBOX_WITH_RAW_MODE 151 /* Hide placeholder when raw-mode is not supported: */ 152 pWidgetPlaceholder->setVisible(false); 153 #endif 154 pLayoutLabel->addWidget(pWidgetPlaceholder); 155 } 156 157 m_pLayout->addLayout(pLayoutLabel, 0, 0); 107 m_pLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 108 m_pLayout->addWidget(m_pLabel, 0, 0); 158 109 } 159 110 160 /* Prepare widget layout: */161 QVBoxLayout *pLayoutWidget = new QVBoxLayout;162 if ( pLayoutWidget)111 /* Prepare 'enable nested virtualization' check-box: */ 112 m_pCheckBoxEnableNestedPaging = new QCheckBox(this); 113 if (m_pCheckBoxEnableNestedPaging) 163 114 { 164 /* Prepare 'enable PAE' check-box: */ 165 m_pCheckBoxEnableVirtualization = new QCheckBox(this); 166 if (m_pCheckBoxEnableVirtualization) 167 { 168 #ifndef VBOX_WITH_RAW_MODE 169 /* Hide check-box when raw-mode is not supported: */ 170 m_pCheckBoxEnableVirtualization->setVisible(false); 171 #endif 172 connect(m_pCheckBoxEnableVirtualization, &QCheckBox::stateChanged, 173 this, &UIAccelerationFeaturesEditor::sigChangedVirtualization); 174 pLayoutWidget->addWidget(m_pCheckBoxEnableVirtualization); 175 } 176 /* Prepare 'enable nested virtualization' check-box: */ 177 m_pCheckBoxEnableNestedPaging = new QCheckBox(this); 178 if (m_pCheckBoxEnableNestedPaging) 179 { 180 connect(m_pCheckBoxEnableNestedPaging, &QCheckBox::stateChanged, 181 this, &UIAccelerationFeaturesEditor::sigChangedNestedPaging); 182 pLayoutWidget->addWidget(m_pCheckBoxEnableNestedPaging); 183 } 184 185 m_pLayout->addLayout(pLayoutWidget, 0, 1); 115 connect(m_pCheckBoxEnableNestedPaging, &QCheckBox::stateChanged, 116 this, &UIAccelerationFeaturesEditor::sigChangedNestedPaging); 117 m_pLayout->addWidget(m_pCheckBoxEnableNestedPaging, 0, 1); 186 118 } 187 119 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIAccelerationFeaturesEditor.h
r96407 r97310 47 47 signals: 48 48 49 /** Notifies listeners about virtualization change. */50 void sigChangedVirtualization();51 49 /** Notifies listeners about nested paging change. */ 52 50 void sigChangedNestedPaging(); … … 56 54 /** Constructs editor passing @a pParent to the base-class. */ 57 55 UIAccelerationFeaturesEditor(QWidget *pParent = 0); 58 59 /** Defines whether 'enable virtualization' feature in @a fOn. */60 void setEnableVirtualization(bool fOn);61 /** Returns 'enable virtualization' feature value. */62 bool isEnabledVirtualization() const;63 /** Defines whether 'enable virtualization' option @a fAvailable. */64 void setEnableVirtualizationAvailable(bool fAvailable);65 56 66 57 /** Defines whether 'enable nested paging' feature in @a fOn. */ … … 88 79 /** @name Values 89 80 * @{ */ 90 /** Holds the 'enable virtualization' feature value. */91 bool m_fEnableVirtualization;92 81 /** Holds the 'enable nested paging' feature value. */ 93 82 bool m_fEnableNestedPaging; … … 100 89 /** Holds the label instance. */ 101 90 QLabel *m_pLabel; 102 /** Holds the 'enable virtualization' check-box instance. */103 QCheckBox *m_pCheckBoxEnableVirtualization;104 91 /** Holds the 'enable nested paging' check-box instance. */ 105 92 QCheckBox *m_pCheckBoxEnableNestedPaging; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r97128 r97310 130 130 131 131 UIMachineSettingsGeneral::UIMachineSettingsGeneral() 132 : m_fHWVirtExEnabled(false) 133 , m_fEncryptionCipherChanged(false) 132 : m_fEncryptionCipherChanged(false) 134 133 , m_fEncryptionPasswordChanged(false) 135 134 , m_pCache(0) … … 158 157 AssertPtrReturn(m_pEditorNameAndSystem, CGuestOSType()); 159 158 return m_pEditorNameAndSystem->type(); 160 }161 162 bool UIMachineSettingsGeneral::is64BitOSTypeSelected() const163 {164 AssertPtrReturn(m_pEditorNameAndSystem, false);165 return m_pEditorNameAndSystem->type().isNotNull()166 ? m_pEditorNameAndSystem->type().GetIs64Bit()167 : false;168 }169 170 void UIMachineSettingsGeneral::setHWVirtExEnabled(bool fEnabled)171 {172 /* Make sure hardware virtualization extension has changed: */173 if (m_fHWVirtExEnabled == fEnabled)174 return;175 176 /* Update hardware virtualization extension value: */177 m_fHWVirtExEnabled = fEnabled;178 179 /* Revalidate: */180 revalidate();181 159 } 182 160 … … 401 379 message.second << tr("No name specified for the virtual machine."); 402 380 fPass = false; 403 }404 405 /* OS type & VT-x/AMD-v correlation: */406 if (is64BitOSTypeSelected() && !m_fHWVirtExEnabled)407 {408 message.second << tr("The virtual machine operating system hint is set to a 64-bit type. "409 "64-bit guest systems require hardware virtualization, "410 "so this will be enabled automatically if you confirm the changes.");411 381 } 412 382 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
r96407 r97310 60 60 /** Returns the VM OS type ID. */ 61 61 CGuestOSType guestOSType() const; 62 /** Returns whether 64bit OS type ID is selected. */63 bool is64BitOSTypeSelected() const;64 65 /** Defines whether HW virtualization extension is enabled. */66 void setHWVirtExEnabled(bool fEnabled);67 62 68 63 protected: … … 134 129 bool saveEncryptionData(); 135 130 136 /** Holds whether HW virtualization extension is enabled. */137 bool m_fHWVirtExEnabled;138 139 131 /** Holds whether the encryption cipher was changed. 140 132 * We are holding that argument here because we do not know -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r96967 r97310 83 83 /* Acceleration data: */ 84 84 , m_paravirtProvider(KParavirtProvider_None) 85 , m_fEnabledHwVirtEx(false)86 85 , m_fEnabledNestedPaging(false) 87 86 {} … … 115 114 /* Acceleration data: */ 116 115 && (m_paravirtProvider == other.m_paravirtProvider) 117 && (m_fEnabledHwVirtEx == other.m_fEnabledHwVirtEx)118 116 && (m_fEnabledNestedPaging == other.m_fEnabledNestedPaging) 119 117 ; … … 168 166 /** Holds the paravirtualization provider. */ 169 167 KParavirtProvider m_paravirtProvider; 170 /** Holds whether the HW Virt Ex is enabled. */171 bool m_fEnabledHwVirtEx;172 168 /** Holds whether the Nested Paging is enabled. */ 173 169 bool m_fEnabledNestedPaging; … … 208 204 } 209 205 210 bool UIMachineSettingsSystem::isHWVirtExEnabled() const211 {212 return m_pEditorAccelerationFeatures->isEnabledVirtualization();213 }214 215 206 bool UIMachineSettingsSystem::isNestedPagingSupported() const 216 207 { … … 309 300 /* Gather old 'Acceleration' data: */ 310 301 oldSystemData.m_paravirtProvider = m_machine.GetParavirtProvider(); 311 oldSystemData.m_fEnabledHwVirtEx = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled);312 302 oldSystemData.m_fEnabledNestedPaging = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging); 313 303 … … 362 352 m_pEditorParavirtProvider->setValue(oldSystemData.m_paravirtProvider); 363 353 if (m_pEditorAccelerationFeatures) 364 {365 m_pEditorAccelerationFeatures->setEnableVirtualization(oldSystemData.m_fEnabledHwVirtEx);366 354 m_pEditorAccelerationFeatures->setEnableNestedPaging(oldSystemData.m_fEnabledNestedPaging); 367 }368 355 369 356 /* Polish page finally: */ … … 429 416 if (m_pEditorParavirtProvider) 430 417 newSystemData.m_paravirtProvider = m_pEditorParavirtProvider->value(); 431 /* Enable HW Virt Ex automatically if it's supported and432 * 1. multiple CPUs, 2. Nested Paging or 3. Nested HW Virt Ex is requested. */433 if (m_pEditorVCPU)434 newSystemData.m_fEnabledHwVirtEx = isHWVirtExEnabled()435 || ( isHWVirtExSupported()436 && ( m_pEditorVCPU->value() > 1437 || isNestedPagingEnabled()438 || isNestedHWVirtExEnabled()));439 418 /* Enable Nested Paging automatically if it's supported and 440 419 * Nested HW Virt Ex is requested. */ … … 544 523 "This is needed to support more than one virtual processor. " 545 524 "It will be enabled automatically if you confirm your changes."); 546 }547 548 /* VCPU: */549 if (m_pEditorVCPU->value() > 1)550 {551 /* HW Virt Ex test: */552 if (isHWVirtExSupported() && !isHWVirtExEnabled())553 {554 message.second << tr(555 "The hardware virtualization is not currently enabled in the Acceleration section of the System page. "556 "This is needed to support more than one virtual processor. "557 "It will be enabled automatically if you confirm your changes.");558 }559 525 } 560 526 … … 582 548 if (isNestedHWVirtExEnabled()) 583 549 { 584 /* HW Virt Ex test: */585 if (isHWVirtExSupported() && !isHWVirtExEnabled())586 {587 message.second << tr(588 "The hardware virtualization is not currently enabled in the Acceleration section of the System page. "589 "This is needed to support nested hardware virtualization. "590 "It will be enabled automatically if you confirm your changes.");591 }592 593 550 /* Nested Paging test: */ 594 551 if (isHWVirtExSupported() && isNestedPagingSupported() && !isNestedPagingEnabled()) … … 604 561 if (!message.second.isEmpty()) 605 562 messages << message; 606 }607 608 /* Acceleration tab: */609 {610 /* Prepare message: */611 UIValidationMessage message;612 message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(2));613 614 /* Nested Paging: */615 if (isNestedPagingEnabled())616 {617 /* HW Virt Ex test: */618 if (isHWVirtExSupported() && !isHWVirtExEnabled())619 {620 message.second << tr(621 "The hardware virtualization is not currently enabled in the Acceleration section of the System page. "622 "This is needed for nested paging support. "623 "It will be enabled automatically if you confirm your changes.");624 }625 }626 627 /* Serialize message: */628 if (!message.second.isEmpty())629 messages << message;630 631 563 } 632 564 … … 714 646 m_pEditorParavirtProvider->setEnabled(isMachineOffline()); 715 647 m_pEditorAccelerationFeatures->setEnabled(isMachineOffline()); 716 m_pEditorAccelerationFeatures->setEnableVirtualizationAvailable( (systemData.m_fSupportedHwVirtEx && isMachineOffline()) 717 || (systemData.m_fEnabledHwVirtEx && isMachineOffline())); 718 m_pEditorAccelerationFeatures->setEnableNestedPagingAvailable( m_pEditorAccelerationFeatures->isEnabledVirtualization() 719 && ( (systemData.m_fSupportedNestedPaging && isMachineOffline()) 720 || (systemData.m_fEnabledNestedPaging && isMachineOffline()))); 721 } 722 723 void UIMachineSettingsSystem::sltHandleHwVirtExToggle() 724 { 725 /* Update Nested Paging checkbox: */ 726 AssertPtrReturnVoid(m_pCache); 727 m_pEditorAccelerationFeatures->setEnableNestedPagingAvailable( m_pEditorAccelerationFeatures->isEnabledVirtualization() 728 && ( (m_pCache->base().m_fSupportedNestedPaging && isMachineOffline()) 729 || (m_pCache->base().m_fEnabledNestedPaging && isMachineOffline()))); 730 731 /* Revalidate: */ 732 revalidate(); 648 m_pEditorAccelerationFeatures->setEnableNestedPagingAvailable( (systemData.m_fSupportedNestedPaging && isMachineOffline()) 649 || (systemData.m_fEnabledNestedPaging && isMachineOffline())); 733 650 } 734 651 … … 899 816 900 817 /* Configure 'Acceleration' connections: */ 901 connect(m_pEditorAccelerationFeatures, &UIAccelerationFeaturesEditor::sigChangedVirtualization,902 this, &UIMachineSettingsSystem::sltHandleHwVirtExToggle);903 818 connect(m_pEditorAccelerationFeatures, &UIAccelerationFeaturesEditor::sigChangedNestedPaging, 904 819 this, &UIMachineSettingsSystem::revalidate); … … 1120 1035 fSuccess = m_machine.isOk(); 1121 1036 } 1122 /* Save whether the hardware virtualization extension is enabled: */1123 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledHwVirtEx != oldSystemData.m_fEnabledHwVirtEx)1124 {1125 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, newSystemData.m_fEnabledHwVirtEx);1126 fSuccess = m_machine.isOk();1127 }1128 1037 /* Save whether the nested paging is enabled: */ 1129 1038 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledNestedPaging != oldSystemData.m_fEnabledNestedPaging) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r96669 r97310 65 65 /** Returns whether the HW Virt Ex is supported. */ 66 66 bool isHWVirtExSupported() const; 67 /** Returns whether the HW Virt Ex is enabled. */68 bool isHWVirtExEnabled() const;69 67 70 68 /** Returns whether the Nested Paging is supported. */ … … 117 115 /** Performs final page polishing. */ 118 116 virtual void polishPage() RT_OVERRIDE; 119 120 private slots:121 122 /** Handles HW Virt Ex check-box toggling. */123 void sltHandleHwVirtExToggle();124 117 125 118 private:
Note:
See TracChangeset
for help on using the changeset viewer.