VirtualBox

Changeset 66492 in vbox


Ignore:
Timestamp:
Apr 10, 2017 9:46:03 AM (8 years ago)
Author:
vboxsync
Message:

Storage/RAW: Replace the stubs for unsupported features with the new helper macros

File:
1 edited

Legend:

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

    r66489 r66492  
    3030
    3131#include "VDBackends.h"
     32#include "VDBackendsInline.h"
    3233
    3334
     
    802803
    803804/** @copydoc VDIMAGEBACKEND::pfnGetComment */
    804 static DECLCALLBACK(int) rawGetComment(void *pBackendData, char *pszComment,
    805                                        size_t cbComment)
    806 {
    807     RT_NOREF2(pszComment, cbComment);
    808     LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
    809     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    810 
    811     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    812 
    813     LogFlowFunc(("returns %Rrc comment='%s'\n", VERR_NOT_SUPPORTED, pszComment));
    814     return VERR_NOT_SUPPORTED;
    815 }
     805VD_BACKEND_CALLBACK_GET_COMMENT_DEF_NOT_SUPPORTED(rawGetComment);
    816806
    817807/** @copydoc VDIMAGEBACKEND::pfnSetComment */
    818 static DECLCALLBACK(int) rawSetComment(void *pBackendData, const char *pszComment)
    819 {
    820     RT_NOREF1(pszComment);
    821     LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
    822     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    823 
    824     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    825 
    826     int rc;
    827     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    828         rc = VERR_VD_IMAGE_READ_ONLY;
    829     else
    830         rc = VERR_NOT_SUPPORTED;
    831 
    832     LogFlowFunc(("returns %Rrc\n", rc));
    833     return rc;
    834 }
     808VD_BACKEND_CALLBACK_SET_COMMENT_DEF_NOT_SUPPORTED(rawSetComment, PRAWIMAGE);
    835809
    836810/** @copydoc VDIMAGEBACKEND::pfnGetUuid */
    837 static DECLCALLBACK(int) rawGetUuid(void *pBackendData, PRTUUID pUuid)
    838 {
    839     RT_NOREF1(pUuid);
    840     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    841     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    842 
    843     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    844 
    845     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    846     return VERR_NOT_SUPPORTED;
    847 }
     811VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(rawGetUuid);
    848812
    849813/** @copydoc VDIMAGEBACKEND::pfnSetUuid */
    850 static DECLCALLBACK(int) rawSetUuid(void *pBackendData, PCRTUUID pUuid)
    851 {
    852     RT_NOREF1(pUuid);
    853     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    854     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    855 
    856     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    857 
    858     int rc;
    859     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    860         rc = VERR_VD_IMAGE_READ_ONLY;
    861     else
    862         rc = VERR_NOT_SUPPORTED;
    863 
    864     LogFlowFunc(("returns %Rrc\n", rc));
    865     return rc;
    866 }
     814VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(rawSetUuid, PRAWIMAGE);
    867815
    868816/** @copydoc VDIMAGEBACKEND::pfnGetModificationUuid */
    869 static DECLCALLBACK(int) rawGetModificationUuid(void *pBackendData, PRTUUID pUuid)
    870 {
    871     RT_NOREF1(pUuid);
    872     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    873     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    874 
    875     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    876 
    877     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    878     return VERR_NOT_SUPPORTED;
    879 }
     817VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(rawGetModificationUuid);
    880818
    881819/** @copydoc VDIMAGEBACKEND::pfnSetModificationUuid */
    882 static DECLCALLBACK(int) rawSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
    883 {
    884     RT_NOREF1(pUuid);
    885     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    886     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    887 
    888     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    889 
    890     int rc;
    891     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    892         rc = VERR_VD_IMAGE_READ_ONLY;
    893     else
    894         rc = VERR_NOT_SUPPORTED;
    895 
    896     LogFlowFunc(("returns %Rrc\n", rc));
    897     return rc;
    898 }
     820VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(rawSetModificationUuid, PRAWIMAGE);
    899821
    900822/** @copydoc VDIMAGEBACKEND::pfnGetParentUuid */
    901 static DECLCALLBACK(int) rawGetParentUuid(void *pBackendData, PRTUUID pUuid)
    902 {
    903     RT_NOREF1(pUuid);
    904     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    905     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    906 
    907     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    908 
    909     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    910     return VERR_NOT_SUPPORTED;
    911 }
     823VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(rawGetParentUuid);
    912824
    913825/** @copydoc VDIMAGEBACKEND::pfnSetParentUuid */
    914 static DECLCALLBACK(int) rawSetParentUuid(void *pBackendData, PCRTUUID pUuid)
    915 {
    916     RT_NOREF1(pUuid);
    917     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    918     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    919 
    920     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    921 
    922     int rc;
    923     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    924         rc = VERR_VD_IMAGE_READ_ONLY;
    925     else
    926         rc = VERR_NOT_SUPPORTED;
    927 
    928     LogFlowFunc(("returns %Rrc\n", rc));
    929     return rc;
    930 }
     826VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(rawSetParentUuid, PRAWIMAGE);
    931827
    932828/** @copydoc VDIMAGEBACKEND::pfnGetParentModificationUuid */
    933 static DECLCALLBACK(int) rawGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
    934 {
    935     RT_NOREF1(pUuid);
    936     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    937     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    938 
    939     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    940 
    941     int rc;
    942     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    943         rc = VERR_VD_IMAGE_READ_ONLY;
    944     else
    945         rc = VERR_NOT_SUPPORTED;
    946 
    947     LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
    948     return rc;
    949 }
     829VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(rawGetParentModificationUuid);
    950830
    951831/** @copydoc VDIMAGEBACKEND::pfnSetParentModificationUuid */
    952 static DECLCALLBACK(int) rawSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
    953 {
    954     RT_NOREF1(pUuid);
    955     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    956     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
    957 
    958     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    959 
    960     int rc;
    961     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    962         rc = VERR_VD_IMAGE_READ_ONLY;
    963     else
    964         rc = VERR_NOT_SUPPORTED;
    965 
    966     LogFlowFunc(("returns %Rrc\n", rc));
    967     return rc;
    968 }
     832VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(rawSetParentModificationUuid, PRAWIMAGE);
    969833
    970834/** @copydoc VDIMAGEBACKEND::pfnDump */
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