VirtualBox

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


Ignore:
Timestamp:
Feb 11, 2018 12:06:03 PM (7 years ago)
Author:
vboxsync
Message:

Storage/QCOW: Fix bug introduced in r120663 which caused creation of broken QCOW images with certain sizes failing to get opened later. The fix to enforce at least 1 L1 table entry was completely wrong, there wasn't anything needing fixing as the line below would enforce that already. Only aligning the L1 table to a cluster size is required actually.

File:
1 edited

Legend:

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

    r70848 r70961  
    12861286                pImage->cbL2Table          = qcowCluster2Byte(pImage, QCOW_L2_CLUSTERS_DEFAULT);
    12871287                pImage->cL2TableEntries    = pImage->cbL2Table / sizeof(uint64_t);
    1288                 pImage->cL1TableEntries    = RT_MIN(1, cbSize / (pImage->cbCluster * pImage->cL2TableEntries));
     1288                pImage->cL1TableEntries    = cbSize / (pImage->cbCluster * pImage->cL2TableEntries);
    12891289                if (cbSize % (pImage->cbCluster * pImage->cL2TableEntries))
    12901290                    pImage->cL1TableEntries++;
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