本文整理汇总了C++中CGuestOSType::GetRecommendedHpet方法的典型用法代码示例。如果您正苦于以下问题:C++ CGuestOSType::GetRecommendedHpet方法的具体用法?C++ CGuestOSType::GetRecommendedHpet怎么用?C++ CGuestOSType::GetRecommendedHpet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGuestOSType
的用法示例。
在下文中一共展示了CGuestOSType::GetRecommendedHpet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vboxGlobal
//.........这里部分代码省略.........
hdCtr.SetPortCount(1);
}
else
{
/* The HD controller is the same as DVD */
hdCtr = dvdCtr;
ctrHdName = ctrDvdName;
}
/* Turn on PAE, if recommended */
m_Machine.SetCPUProperty(KCPUPropertyType_PAE, type.GetRecommendedPae());
/* Set recommended firmware type */
KFirmwareType fwType = type.GetRecommendedFirmware();
m_Machine.SetFirmwareType(fwType);
/* Set recommended human interface device types */
if (type.GetRecommendedUsbHid())
{
m_Machine.SetKeyboardHidType(KKeyboardHidType_USBKeyboard);
m_Machine.SetPointingHidType(KPointingHidType_USBMouse);
if (!usbController.isNull())
usbController.SetEnabled(true);
}
if (type.GetRecommendedUsbTablet())
{
m_Machine.SetPointingHidType(KPointingHidType_USBTablet);
if (!usbController.isNull())
usbController.SetEnabled(true);
}
/* Set HPET flag */
m_Machine.SetHpetEnabled(type.GetRecommendedHpet());
/* Set UTC flags */
m_Machine.SetRTCUseUTC(type.GetRecommendedRtcUseUtc());
/* Register the VM prior to attaching hard disks */
vbox.RegisterMachine(m_Machine);
if (!vbox.isOk())
{
msgCenter().cannotCreateMachine(vbox, m_Machine, this);
return false;
}
/* Attach default devices */
{
bool success = false;
QString machineId = m_Machine.GetId();
CSession session = vboxGlobal().openSession(machineId);
if (!session.isNull())
{
CMachine m = session.GetMachine();
QString strId = field("hardDiskId").toString();
/* Boot hard disk */
if (!strId.isNull())
{
VBoxMedium vmedium = vboxGlobal().findMedium(strId);
CMedium medium = vmedium.medium(); // @todo r=dj can this be cached somewhere?
m.AttachDevice(ctrHdName, 0, 0, KDeviceType_HardDisk, medium);
if (!m.isOk())
msgCenter().cannotAttachDevice(m, VBoxDefs::MediumType_HardDisk, field("hardDiskLocation").toString(),
StorageSlot(ctrHdBus, 0, 0), this);
}