2026
2033
parm.u.pointer.addr = (IConsole*) (Console*) pConsole;
2027
2034
parm.u.pointer.size = sizeof(IConsole *);
2029
rc = pConsole->mVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_CONSOLE,
2030
SHCRGL_CPARMS_SET_CONSOLE, &parm);
2036
rc = pVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_CONSOLE,
2037
SHCRGL_CPARMS_SET_CONSOLE, &parm);
2031
2038
if (!RT_SUCCESS(rc))
2032
2039
AssertMsgFailed(("SHCRGL_HOST_FN_SET_CONSOLE failed with %Rrc\n", rc));
2034
2041
parm.u.pointer.addr = pVM;
2035
2042
parm.u.pointer.size = sizeof(pVM);
2036
rc = pConsole->mVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_VM,
2037
SHCRGL_CPARMS_SET_VM, &parm);
2043
rc = pVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_VM,
2044
SHCRGL_CPARMS_SET_VM, &parm);
2038
2045
if (!RT_SUCCESS(rc))
2039
2046
AssertMsgFailed(("SHCRGL_HOST_FN_SET_VM failed with %Rrc\n", rc));
2527
2534
* Ext4 bug: Check if the host I/O cache is disabled and the disk image is located
2528
2535
* on an ext4 partition. Later we have to check the Linux kernel version!
2529
2536
* This bug apparently applies to the XFS file system as well.
2537
* Linux 2.6.36 is known to be fixed (tested with 2.6.36-rc4).
2540
char szOsRelease[128];
2541
rc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szOsRelease, sizeof(szOsRelease));
2542
bool fKernelHasODirectBug = RT_FAILURE(rc)
2543
|| (RTStrVersionCompare(szOsRelease, "2.6.36-rc4") < 0);
2531
2545
if ( (uCaps & MediumFormatCapabilities_Asynchronous)
2532
2546
&& !fUseHostIOCache
2533
&& ( enmFsTypeFile == RTFSTYPE_EXT4
2534
|| enmFsTypeFile == RTFSTYPE_XFS))
2536
setVMRuntimeErrorCallbackF(pVM, this, 0,
2537
"Ext4PartitionDetected",
2538
N_("The host I/O cache for at least one controller is disabled "
2539
"and the medium '%ls' for this VM "
2540
"is located on an %s partition. There is a known Linux "
2541
"kernel bug which can lead to the corruption of the virtual "
2542
"disk image under these conditions.\n"
2543
"Either enable the host I/O cache permanently in the VM "
2544
"settings or put the disk image and the snapshot folder "
2545
"onto a different file system.\n"
2546
"The host I/O cache will now be enabled for this medium"),
2547
strFile.raw(), enmFsTypeFile == RTFSTYPE_EXT4 ? "ext4" : "xfs");
2548
fUseHostIOCache = true;
2550
else if ( (uCaps & MediumFormatCapabilities_Asynchronous)
2552
&& ( enmFsTypeSnap == RTFSTYPE_EXT4
2553
|| enmFsTypeSnap == RTFSTYPE_XFS)
2554
&& !mfSnapshotFolderExt4WarningShown)
2556
setVMRuntimeErrorCallbackF(pVM, this, 0,
2557
"Ext4PartitionDetected",
2558
N_("The host I/O cache for at least one controller is disabled "
2559
"and the snapshot folder for this VM "
2560
"is located on an %s partition. There is a known Linux "
2561
"kernel bug which can lead to the corruption of the virtual "
2562
"disk image under these conditions.\n"
2563
"Either enable the host I/O cache permanently in the VM "
2564
"settings or put the disk image and the snapshot folder "
2565
"onto a different file system.\n"
2566
"The host I/O cache will now be enabled for this medium"),
2567
enmFsTypeSnap == RTFSTYPE_EXT4 ? "ext4" : "xfs");
2568
fUseHostIOCache = true;
2569
mfSnapshotFolderExt4WarningShown = true;
2547
&& fKernelHasODirectBug)
2549
if ( enmFsTypeFile == RTFSTYPE_EXT4
2550
|| enmFsTypeFile == RTFSTYPE_XFS)
2552
setVMRuntimeErrorCallbackF(pVM, this, 0,
2553
"Ext4PartitionDetected",
2554
N_("The host I/O cache for at least one controller is disabled "
2555
"and the medium '%ls' for this VM "
2556
"is located on an %s partition. There is a known Linux "
2557
"kernel bug which can lead to the corruption of the virtual "
2558
"disk image under these conditions.\n"
2559
"Either enable the host I/O cache permanently in the VM "
2560
"settings or put the disk image and the snapshot folder "
2561
"onto a different file system.\n"
2562
"The host I/O cache will now be enabled for this medium"),
2563
strFile.raw(), enmFsTypeFile == RTFSTYPE_EXT4 ? "ext4" : "xfs");
2564
fUseHostIOCache = true;
2566
else if ( ( enmFsTypeSnap == RTFSTYPE_EXT4
2567
|| enmFsTypeSnap == RTFSTYPE_XFS)
2568
&& !mfSnapshotFolderExt4WarningShown)
2570
setVMRuntimeErrorCallbackF(pVM, this, 0,
2571
"Ext4PartitionDetected",
2572
N_("The host I/O cache for at least one controller is disabled "
2573
"and the snapshot folder for this VM "
2574
"is located on an %s partition. There is a known Linux "
2575
"kernel bug which can lead to the corruption of the virtual "
2576
"disk image under these conditions.\n"
2577
"Either enable the host I/O cache permanently in the VM "
2578
"settings or put the disk image and the snapshot folder "
2579
"onto a different file system.\n"
2580
"The host I/O cache will now be enabled for this medium"),
2581
enmFsTypeSnap == RTFSTYPE_EXT4 ? "ext4" : "xfs");
2582
fUseHostIOCache = true;
2583
mfSnapshotFolderExt4WarningShown = true;
3967
3985
parms[3].u.pointer.addr = flags;
3968
3986
parms[3].u.pointer.size = 0; /* We don't actually care. */
3970
pVMMDev->hgcmHostCall ("VBoxGuestPropSvc", guestProp::SET_PROPS_HOST, 4,
3988
pVMMDev->hgcmHostCall("VBoxGuestPropSvc",
3989
guestProp::SET_PROPS_HOST,
3975
3995
* Set a single guest property
3977
static void configSetProperty(VMMDev * const pVMMDev, const char *pszName,
3978
const char *pszValue, const char *pszFlags)
3997
static void configSetProperty(VMMDev * const pVMMDev,
3998
const char *pszName,
3999
const char *pszValue,
4000
const char *pszFlags)
3980
4002
VBOXHGCMSVCPARM parms[4];
4053
4076
/* Sysprep execution by VBoxService. */
4054
configSetProperty(pConsole->mVMMDev,
4077
configSetProperty(pConsole->m_pVMMDev,
4055
4078
"/VirtualBox/HostGuest/SysprepExec", "",
4056
4079
"TRANSIENT, RDONLYGUEST");
4057
configSetProperty(pConsole->mVMMDev,
4080
configSetProperty(pConsole->m_pVMMDev,
4058
4081
"/VirtualBox/HostGuest/SysprepArgs", "",
4059
4082
"TRANSIENT, RDONLYGUEST");
4135
4158
* will override them.
4137
4160
/* Set the VBox version string as a guest property */
4138
configSetProperty(pConsole->mVMMDev, "/VirtualBox/HostInfo/VBoxVer",
4161
configSetProperty(pConsole->m_pVMMDev, "/VirtualBox/HostInfo/VBoxVer",
4139
4162
VBOX_VERSION_STRING, "TRANSIENT, RDONLYGUEST");
4140
4163
/* Set the VBox SVN revision as a guest property */
4141
configSetProperty(pConsole->mVMMDev, "/VirtualBox/HostInfo/VBoxRev",
4164
configSetProperty(pConsole->m_pVMMDev, "/VirtualBox/HostInfo/VBoxRev",
4142
4165
RTBldCfgRevisionStr(), "TRANSIENT, RDONLYGUEST");