~ubuntu-branches/ubuntu/quantal/virtualbox/quantal

« back to all changes in this revision

Viewing changes to src/VBox/Storage/VD.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2012-04-05 12:41:55 UTC
  • mfrom: (3.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120405124155-i7b39tv5ddwhubbe
Tags: 4.1.12-dfsg-2
* Upstream has replaced the 4.1.12 tarball with a new one that fixes a
  crash when creating host only interfaces. (Closes: #667460)
  - Add 36-tarball-respin.patch which contains the diff between the old
    and the new tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4456
4456
        AssertRC(rc);
4457
4457
 
4458
4458
        pImage->uOpenFlags = uOpenFlags & (VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_IGNORE_FLUSH);
 
4459
        pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
4459
4460
        rc = pImage->Backend->pfnOpen(pImage->pszFilename,
4460
4461
                                      uOpenFlags & ~(VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_IGNORE_FLUSH),
4461
4462
                                      pDisk->pVDIfsDisk,
4492
4493
        fLockWrite = true;
4493
4494
 
4494
4495
        pImage->VDIo.pBackendData = pImage->pBackendData;
4495
 
        pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
4496
4496
 
4497
4497
        /* Check image type. As the image itself has only partial knowledge
4498
4498
         * whether it's a base image or not, this info is derived here. The
4712
4712
        AssertRC(rc);
4713
4713
 
4714
4714
        pCache->uOpenFlags = uOpenFlags & VD_OPEN_FLAGS_HONOR_SAME;
 
4715
        pCache->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
4715
4716
        rc = pCache->Backend->pfnOpen(pCache->pszFilename,
4716
4717
                                      uOpenFlags & ~VD_OPEN_FLAGS_HONOR_SAME,
4717
4718
                                      pDisk->pVDIfsDisk,
4979
4980
 
4980
4981
        pImage->uOpenFlags = uOpenFlags & VD_OPEN_FLAGS_HONOR_SAME;
4981
4982
        uImageFlags &= ~VD_IMAGE_FLAGS_DIFF;
 
4983
        pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
4982
4984
        rc = pImage->Backend->pfnCreate(pImage->pszFilename, cbSize,
4983
4985
                                        uImageFlags, pszComment, pPCHSGeometry,
4984
4986
                                        pLCHSGeometry, pUuid,
4992
4994
        if (RT_SUCCESS(rc))
4993
4995
        {
4994
4996
            pImage->VDIo.pBackendData = pImage->pBackendData;
4995
 
            pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
4996
4997
            pImage->uImageFlags = uImageFlags;
4997
4998
 
4998
4999
            /* Force sane optimization settings. It's not worth avoiding writes
5245
5246
        }
5246
5247
 
5247
5248
        pImage->uOpenFlags = uOpenFlags & VD_OPEN_FLAGS_HONOR_SAME;
 
5249
        pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
5248
5250
        uImageFlags |= VD_IMAGE_FLAGS_DIFF;
5249
5251
        rc = pImage->Backend->pfnCreate(pImage->pszFilename, pDisk->cbSize,
5250
5252
                                        uImageFlags | VD_IMAGE_FLAGS_DIFF,
5260
5262
        if (RT_SUCCESS(rc))
5261
5263
        {
5262
5264
            pImage->VDIo.pBackendData = pImage->pBackendData;
5263
 
            pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
5264
5265
            pImage->uImageFlags = uImageFlags;
5265
5266
 
5266
5267
            /* Lock disk for writing, as we modify pDisk information below. */
5500
5501
        }
5501
5502
 
5502
5503
        pCache->uOpenFlags = uOpenFlags & VD_OPEN_FLAGS_HONOR_SAME;
 
5504
        pCache->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
5503
5505
        rc = pCache->Backend->pfnCreate(pCache->pszFilename, cbSize,
5504
5506
                                        uImageFlags,
5505
5507
                                        pszComment, pUuid,
5518
5520
            fLockWrite = true;
5519
5521
 
5520
5522
            pCache->VDIo.pBackendData = pCache->pBackendData;
5521
 
            pCache->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0;
5522
5523
 
5523
5524
            /* Re-check state, as the lock wasn't held and another image
5524
5525
             * creation call could have been done by another thread. */