summaryrefslogtreecommitdiff
path: root/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/VMM/VMMR3/PDMBlkCache.cpp')
-rw-r--r--src/VBox/VMM/VMMR3/PDMBlkCache.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/VBox/VMM/VMMR3/PDMBlkCache.cpp b/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
index 895e48637..721864370 100644
--- a/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
+++ b/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
@@ -879,7 +879,14 @@ static DECLCALLBACK(int) pdmR3BlkCacheLoadExec(PVM pVM, PSSMHANDLE pSSM, uint32_
SSMR3GetU32(pSSM, &cRefs);
- if (cRefs == pBlkCacheGlobal->cRefs)
+ /*
+ * Fewer users in the saved state than in the current VM are allowed
+ * because that means that there are only new ones which don't have any saved state
+ * which can get lost.
+ * More saved entries that current ones are not allowed because this could result in
+ * lost data.
+ */
+ if (cRefs <= pBlkCacheGlobal->cRefs)
{
char *pszId = NULL;