VirtualBox

Changeset 51625 in vbox for trunk/src/VBox/Storage


Ignore:
Timestamp:
Jun 16, 2014 8:01:10 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94368
Message:

QED: Initialize the L2 cache always, fixes a crash if opening the image file fails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/QED.cpp

    r50988 r51625  
    55
    66/*
    7  * Copyright (C) 2011-2013 Oracle Corporation
     7 * Copyright (C) 2011-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    11811181
    11821182    /*
     1183     * Create the L2 cache before opening the image so we can call qedFreeImage()
     1184     * even if opening the image file fails.
     1185     */
     1186    rc = qedL2TblCacheCreate(pImage);
     1187    if (RT_FAILURE(rc))
     1188    {
     1189        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS,
     1190                       N_("Qed: Creating the L2 table cache for image '%s' failed"),
     1191                       pImage->pszFilename);
     1192
     1193        goto out;
     1194    }
     1195
     1196    /*
    11831197     * Open the image.
    11841198     */
     
    12571271                        {
    12581272                            qedTableConvertToHostEndianess(pImage->paL1Table, pImage->cTableEntries);
    1259                             rc = qedL2TblCacheCreate(pImage);
    1260                             if (RT_SUCCESS(rc))
    1261                             {
    1262                                 /* If the consistency check succeeded, clear the flag by flushing the image. */
    1263                                 if (Header.u64FeatureFlags & QED_FEATURE_NEED_CHECK)
    1264                                     rc = qedFlushImage(pImage);
    1265                             }
    1266                             else
    1267                                 rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS,
    1268                                                N_("Qed: Creating the L2 table cache for image '%s' failed"),
    1269                                                pImage->pszFilename);
     1273
     1274                            /* If the consistency check succeeded, clear the flag by flushing the image. */
     1275                            if (Header.u64FeatureFlags & QED_FEATURE_NEED_CHECK)
     1276                                rc = qedFlushImage(pImage);
    12701277                        }
    12711278                        else
Note: See TracChangeset for help on using the changeset viewer.

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