VirtualBox

Changeset 54430 in vbox


Ignore:
Timestamp:
Feb 24, 2015 10:43:16 AM (10 years ago)
Author:
vboxsync
Message:

Storage/VD: make use of the image type (hdd/dvd/floppy) for sanity checking when creating disk images

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vd-image-backend.h

    r50988 r54430  
    44
    55/*
    6  * Copyright (C) 2006-2014 Oracle Corporation
     6 * Copyright (C) 2006-2015 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    139139     * @param   pVDIfsImage     Pointer to the per-image VD interface list.
    140140     * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
     141     * @param   enmType         Requested type of the image.
    141142     * @param   ppBackendData   Opaque state data for this image.
    142143     */
     
    150151                                          PVDINTERFACE pVDIfsImage,
    151152                                          PVDINTERFACE pVDIfsOperation,
     153                                          VDTYPE enmType,
    152154                                          void **ppBackendData));
    153155
  • trunk/src/VBox/Storage/DMG.cpp

    r50988 r54430  
    55
    66/*
    7  * Copyright (C) 2010-2013 Oracle Corporation
     7 * Copyright (C) 2010-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    18021802                                 VDTYPE enmType, void **ppBackendData)
    18031803{
    1804     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     1804    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
     1805
     1806    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    18051807
    18061808    /* Check open flags. All valid flags are (in principle) supported. */
     
    18561858                                   unsigned uPercentStart, unsigned uPercentSpan,
    18571859                                   PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
    1858                                    PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    1859 {
    1860     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p", pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     1860                                   PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     1861                                   void **ppBackendData)
     1862{
     1863    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
     1864                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    18611865    int rc = VERR_NOT_SUPPORTED;
    18621866
  • trunk/src/VBox/Storage/ISCSI.cpp

    r54138 r54430  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    45674567                     VDTYPE enmType, void **ppBackendData)
    45684568{
    4569     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     4569    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    45704570    int rc;
    45714571    PISCSIIMAGE pImage;
     4572
     4573    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    45724574
    45734575    /* Check open flags. All valid flags are supported. */
     
    46314633                       unsigned uPercentStart, unsigned uPercentSpan,
    46324634                       PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
    4633                        PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    4634 {
    4635     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p", pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     4635                       PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     4636                       void **ppBackendData)
     4637{
     4638    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
     4639                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    46364640    int rc = VERR_NOT_SUPPORTED;
    46374641
  • trunk/src/VBox/Storage/Parallels.cpp

    r50988 r54430  
    66
    77/*
    8  * Copyright (C) 2006-2013 Oracle Corporation
     8 * Copyright (C) 2006-2015 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    422422                         VDTYPE enmType, void **ppBackendData)
    423423{
    424     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     424    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    425425    int rc;
    426426    PPARALLELSIMAGE pImage;
     427
     428    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    427429
    428430    /* Check open flags. All valid flags are supported. */
     
    473475                           unsigned uPercentSpan, PVDINTERFACE pVDIfsDisk,
    474476                           PVDINTERFACE pVDIfsImage,
    475                            PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    476 {
    477     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p",
    478                  pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     477                           PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     478                           void **ppBackendData)
     479{
     480    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
     481                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    479482    int rc = VINF_SUCCESS;
    480483    PPARALLELSIMAGE pImage;
     
    487490        pfnProgress = pIfProgress->pfnProgress;
    488491        pvUser = pIfProgress->Core.pvUser;
     492    }
     493
     494    /* Check the VD container type. */
     495    if (enmType != VDTYPE_HDD)
     496    {
     497        rc = VERR_VD_INVALID_TYPE;
     498        goto out;
    489499    }
    490500
  • trunk/src/VBox/Storage/QCOW.cpp

    r51626 r54430  
    55
    66/*
    7  * Copyright (C) 2011-2013 Oracle Corporation
     7 * Copyright (C) 2011-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    14951495                   VDTYPE enmType, void **ppBackendData)
    14961496{
    1497     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     1497    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    14981498    int rc;
    14991499    PQCOWIMAGE pImage;
     1500
     1501    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    15001502
    15011503    /* Check open flags. All valid flags are supported. */
     
    15441546                     unsigned uPercentStart, unsigned uPercentSpan,
    15451547                     PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
    1546                      PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    1547 {
    1548     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p",
    1549                  pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     1548                     PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     1549                     void **ppBackendData)
     1550{
     1551    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
     1552                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    15501553    int rc;
    15511554    PQCOWIMAGE pImage;
     
    15581561        pfnProgress = pIfProgress->pfnProgress;
    15591562        pvUser = pIfProgress->Core.pvUser;
     1563    }
     1564
     1565    /* Check the VD container type. */
     1566    if (enmType != VDTYPE_HDD)
     1567    {
     1568        rc = VERR_VD_INVALID_TYPE;
     1569        goto out;
    15601570    }
    15611571
  • trunk/src/VBox/Storage/QED.cpp

    r51680 r54430  
    55
    66/*
    7  * Copyright (C) 2011-2014 Oracle Corporation
     7 * Copyright (C) 2011-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    15891589                   VDTYPE enmType, void **ppBackendData)
    15901590{
    1591     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     1591    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    15921592    int rc;
    15931593    PQEDIMAGE pImage;
     1594
     1595    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    15941596
    15951597    /* Check open flags. All valid flags are supported. */
     
    16381640                     unsigned uPercentStart, unsigned uPercentSpan,
    16391641                     PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
    1640                      PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    1641 {
    1642     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p",
    1643                  pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     1642                     PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     1643                     void **ppBackendData)
     1644{
     1645    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType, ppBackendData=%#p",
     1646                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    16441647    int rc;
    16451648    PQEDIMAGE pImage;
     
    16521655        pfnProgress = pIfProgress->pfnProgress;
    16531656        pvUser = pIfProgress->Core.pvUser;
     1657    }
     1658
     1659    /* Check the VD container type. */
     1660    if (enmType != VDTYPE_HDD)
     1661    {
     1662        rc = VERR_VD_INVALID_TYPE;
     1663        goto out;
    16541664    }
    16551665
  • trunk/src/VBox/Storage/RAW.cpp

    r54397 r54430  
    427427                   VDTYPE enmType, void **ppBackendData)
    428428{
    429     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     429    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    430430    int rc;
    431431    PRAWIMAGE pImage;
     432
     433    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    432434
    433435    /* Check open flags. All valid flags are supported. */
     
    482484                     unsigned uPercentStart, unsigned uPercentSpan,
    483485                     PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
    484                      PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    485 {
    486     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p", pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     486                     PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     487                     void **ppBackendData)
     488{
     489    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
     490                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    487491    int rc;
    488492    PRAWIMAGE pImage;
     
    495499        pfnProgress = pIfProgress->pfnProgress;
    496500        pvUser = pIfProgress->Core.pvUser;
     501    }
     502
     503    /* Check the VD container type. Yes, hard disk must be allowed, otherwise
     504     * various tools using this backend for hard disk images will fail. */
     505    if (enmType != VDTYPE_HDD && enmType != VDTYPE_DVD && enmType != VDTYPE_FLOPPY)
     506    {
     507        rc = VERR_VD_INVALID_TYPE;
     508        goto out;
    497509    }
    498510
  • trunk/src/VBox/Storage/VD.cpp

    r54340 r54430  
    69966996                                        pImage->pVDIfsImage,
    69976997                                        pVDIfsOperation,
     6998                                        pDisk->enmType,
    69986999                                        &pImage->pBackendData);
    69997000
     
    72737274                                        pImage->pVDIfsImage,
    72747275                                        pVDIfsOperation,
     7276                                        pDisk->enmType,
    72757277                                        &pImage->pBackendData);
    72767278
  • trunk/src/VBox/Storage/VDI.cpp

    r54117 r54430  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    13511351                   VDTYPE enmType, void **ppBackendData)
    13521352{
    1353     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     1353    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    13541354    int rc;
    13551355    PVDIIMAGEDESC pImage;
     1356
     1357    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    13561358
    13571359    /* Check open flags. All valid flags are supported. */
     
    14001402                     unsigned uPercentStart, unsigned uPercentSpan,
    14011403                     PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
    1402                      PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    1403 {
    1404     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p\n", pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     1404                     PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     1405                     void **ppBackendData)
     1406{
     1407    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p\n",
     1408                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    14051409    int rc;
    14061410    PVDIIMAGEDESC pImage;
     
    14191423    /* Check the image flags. */
    14201424    if ((uImageFlags & ~VD_VDI_IMAGE_FLAGS_MASK) != 0)
     1425    {
     1426        rc = VERR_VD_INVALID_TYPE;
     1427        goto out;
     1428    }
     1429
     1430    /* Check the VD container type. */
     1431    if (enmType != VDTYPE_HDD)
    14211432    {
    14221433        rc = VERR_VD_INVALID_TYPE;
  • trunk/src/VBox/Storage/VHD.cpp

    r54117 r54430  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    12971297                   VDTYPE enmType, void **ppBackendData)
    12981298{
    1299     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     1299    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    13001300    int rc = VINF_SUCCESS;
    13011301    PVHDIMAGE pImage;
     1302
     1303    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    13021304
    13031305    /* Check open flags. All valid flags are supported. */
     
    13461348                     unsigned uPercentStart, unsigned uPercentSpan,
    13471349                     PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
    1348                      PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    1349 {
    1350     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p", pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     1350                     PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     1351                     void **ppBackendData)
     1352{
     1353    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
     1354                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    13511355    int rc = VINF_SUCCESS;
    13521356    PVHDIMAGE pImage;
     
    13591363        pfnProgress = pIfProgress->pfnProgress;
    13601364        pvUser = pIfProgress->Core.pvUser;
     1365    }
     1366
     1367    /* Check the VD container type. */
     1368    if (enmType != VDTYPE_HDD)
     1369    {
     1370        rc = VERR_VD_INVALID_TYPE;
     1371        goto out;
    13611372    }
    13621373
  • trunk/src/VBox/Storage/VHDX.cpp

    r50988 r54430  
    55
    66/*
    7  * Copyright (C) 2012-2013 Oracle Corporation
     7 * Copyright (C) 2012-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    17921792                   VDTYPE enmType, void **ppBackendData)
    17931793{
    1794     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     1794    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    17951795    int rc;
    17961796    PVHDXIMAGE pImage;
     1797
     1798    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    17971799
    17981800    /* Check open flags. All valid flags are supported. */
     
    18221824
    18231825    LogFlowFunc(("returns %Rrc (pBackendData=%#p)\n", rc, *ppBackendData));
     1826    return rc;
     1827}
     1828
     1829/** @interface_method_impl{VBOXHDDBACKEND,pfnCreate} */
     1830static DECLCALLBACK(int) vhdxCreate(const char *pszFilename, uint64_t cbSize,
     1831                                    unsigned uImageFlags, const char *pszComment,
     1832                                    PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
     1833                                    PCRTUUID pUuid, unsigned uOpenFlags,
     1834                                    unsigned uPercentStart, unsigned uPercentSpan,
     1835                                    PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
     1836                                    PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     1837                                    void **ppBackendData)
     1838{
     1839    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
     1840                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
     1841    int rc = VERR_NOT_SUPPORTED;
     1842
     1843    LogFlowFunc(("returns %Rrc\n", rc));
    18241844    return rc;
    18251845}
     
    24482468    vhdxOpen,
    24492469    /* pfnCreate */
    2450     NULL,
     2470    vhdxCreate,
    24512471    /* pfnRename */
    24522472    vhdxRename,
  • trunk/src/VBox/Storage/VMDK.cpp

    r54117 r54430  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    52645264                    VDTYPE enmType, void **ppBackendData)
    52655265{
    5266     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
     5266    LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
    52675267    int rc;
    52685268    PVMDKIMAGE pImage;
     5269
     5270    NOREF(enmType); /**< @todo r=klaus make use of the type info. */
    52695271
    52705272    /* Check open flags. All valid flags are supported. */
     
    53175319                      unsigned uPercentStart, unsigned uPercentSpan,
    53185320                      PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
    5319                       PVDINTERFACE pVDIfsOperation, void **ppBackendData)
    5320 {
    5321     LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p\n", pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
     5321                      PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
     5322                      void **ppBackendData)
     5323{
     5324    LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p\n",
     5325                 pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
    53225326    int rc;
    53235327    PVMDKIMAGE pImage;
     
    53345338    /* Check the image flags. */
    53355339    if ((uImageFlags & ~VD_VMDK_IMAGE_FLAGS_MASK) != 0)
     5340    {
     5341        rc = VERR_VD_INVALID_TYPE;
     5342        goto out;
     5343    }
     5344
     5345    /* Check the VD container type. */
     5346    if (enmType != VDTYPE_HDD)
    53365347    {
    53375348        rc = VERR_VD_INVALID_TYPE;
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