VirtualBox

Changeset 63657 in vbox


Ignore:
Timestamp:
Aug 30, 2016 10:03:36 AM (8 years ago)
Author:
vboxsync
Message:

VBoxSCSI: fix loading a saved state from before r104155 (or r104311 for 5.0.x)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VBoxSCSI.cpp

    r62964 r63657  
    2929#include <VBox/vmm/pdmdev.h>
    3030#include <VBox/vmm/pgm.h>
     31#include <VBox/version.h>
    3132#include <iprt/asm.h>
    3233#include <iprt/mem.h>
     
    470471    SSMR3GetU8  (pSSM, &pVBoxSCSI->uTxDir);
    471472    SSMR3GetU8  (pSSM, &pVBoxSCSI->cbCDB);
    472     SSMR3GetMem (pSSM, &pVBoxSCSI->abCDB[0], sizeof(pVBoxSCSI->abCDB));
     473
     474    /*
     475     * The CDB buffer was increased with r104155 in trunk (backported to 5.0
     476     * in r104311) without bumping the SSM state versions which leaves us
     477     * with broken saved state restoring for older VirtualBox releases
     478     * (up to 5.0.10).
     479     */
     480    if (   (   SSMR3HandleRevision(pSSM) < 104311
     481            && SSMR3HandleVersion(pSSM)  < VBOX_FULL_VERSION_MAKE(5, 0, 12))
     482        || (   SSMR3HandleRevision(pSSM) < 104155
     483            && SSMR3HandleVersion(pSSM)  >= VBOX_FULL_VERSION_MAKE(5, 0, 51)))
     484    {
     485        memset(&pVBoxSCSI->abCDB[0], 0, sizeof(pVBoxSCSI->abCDB));
     486        SSMR3GetMem (pSSM, &pVBoxSCSI->abCDB[0], 12);
     487    }
     488    else
     489        SSMR3GetMem (pSSM, &pVBoxSCSI->abCDB[0], sizeof(pVBoxSCSI->abCDB));
     490
    473491    SSMR3GetU8  (pSSM, &pVBoxSCSI->iCDB);
    474492    SSMR3GetU32 (pSSM, &pVBoxSCSI->cbBufLeft);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette