VirtualBox

Changeset 66494 in vbox for trunk


Ignore:
Timestamp:
Apr 10, 2017 9:57:25 AM (7 years ago)
Author:
vboxsync
Message:

Storage: Get rid of duplicated code in the backends for unsupported features

Location:
trunk/src/VBox/Storage
Files:
6 edited

Legend:

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

    r66486 r66494  
    3535
    3636#include "VDBackends.h"
     37#include "VDBackendsInline.h"
    3738
    3839
     
    17591760
    17601761/** @copydoc VDIMAGEBACKEND::pfnGetComment */
    1761 static DECLCALLBACK(int) cueGetComment(void *pBackendData, char *pszComment,
    1762                                        size_t cbComment)
    1763 {
    1764     RT_NOREF2(pszComment, cbComment);
    1765     LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
    1766     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1767 
    1768     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1769 
    1770     LogFlowFunc(("returns %Rrc comment='%s'\n", VERR_NOT_SUPPORTED, pszComment));
    1771     return VERR_NOT_SUPPORTED;
    1772 }
     1762VD_BACKEND_CALLBACK_GET_COMMENT_DEF_NOT_SUPPORTED(cueGetComment);
    17731763
    17741764/** @copydoc VDIMAGEBACKEND::pfnSetComment */
    1775 static DECLCALLBACK(int) cueSetComment(void *pBackendData, const char *pszComment)
    1776 {
    1777     RT_NOREF1(pszComment);
    1778     LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
    1779     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1780 
    1781     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1782 
    1783     int rc;
    1784     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    1785         rc = VERR_VD_IMAGE_READ_ONLY;
    1786     else
    1787         rc = VERR_NOT_SUPPORTED;
    1788 
    1789     LogFlowFunc(("returns %Rrc\n", rc));
    1790     return rc;
    1791 }
     1765VD_BACKEND_CALLBACK_SET_COMMENT_DEF_NOT_SUPPORTED(cueSetComment, PCUEIMAGE);
    17921766
    17931767/** @copydoc VDIMAGEBACKEND::pfnGetUuid */
    1794 static DECLCALLBACK(int) cueGetUuid(void *pBackendData, PRTUUID pUuid)
    1795 {
    1796     RT_NOREF1(pUuid);
    1797     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    1798     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1799 
    1800     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1801 
    1802     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    1803     return VERR_NOT_SUPPORTED;
    1804 }
     1768VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(cueGetUuid);
    18051769
    18061770/** @copydoc VDIMAGEBACKEND::pfnSetUuid */
    1807 static DECLCALLBACK(int) cueSetUuid(void *pBackendData, PCRTUUID pUuid)
    1808 {
    1809     RT_NOREF1(pUuid);
    1810     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    1811     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1812 
    1813     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1814 
    1815     int rc;
    1816     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    1817         rc = VERR_VD_IMAGE_READ_ONLY;
    1818     else
    1819         rc = VERR_NOT_SUPPORTED;
    1820 
    1821     LogFlowFunc(("returns %Rrc\n", rc));
    1822     return rc;
    1823 }
     1771VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(cueSetUuid, PCUEIMAGE);
    18241772
    18251773/** @copydoc VDIMAGEBACKEND::pfnGetModificationUuid */
    1826 static DECLCALLBACK(int) cueGetModificationUuid(void *pBackendData, PRTUUID pUuid)
    1827 {
    1828     RT_NOREF1(pUuid);
    1829     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    1830     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1831 
    1832     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1833 
    1834     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    1835     return VERR_NOT_SUPPORTED;
    1836 }
     1774VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(cueGetModificationUuid);
    18371775
    18381776/** @copydoc VDIMAGEBACKEND::pfnSetModificationUuid */
    1839 static DECLCALLBACK(int) cueSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
    1840 {
    1841     RT_NOREF1(pUuid);
    1842     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    1843     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1844 
    1845     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1846 
    1847     int rc;
    1848     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    1849         rc = VERR_VD_IMAGE_READ_ONLY;
    1850     else
    1851         rc = VERR_NOT_SUPPORTED;
    1852 
    1853     LogFlowFunc(("returns %Rrc\n", rc));
    1854     return rc;
    1855 }
     1777VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(cueSetModificationUuid, PCUEIMAGE);
    18561778
    18571779/** @copydoc VDIMAGEBACKEND::pfnGetParentUuid */
    1858 static DECLCALLBACK(int) cueGetParentUuid(void *pBackendData, PRTUUID pUuid)
    1859 {
    1860     RT_NOREF1(pUuid);
    1861     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    1862     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1863 
    1864     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1865 
    1866     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    1867     return VERR_NOT_SUPPORTED;
    1868 }
     1780VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(cueGetParentUuid);
    18691781
    18701782/** @copydoc VDIMAGEBACKEND::pfnSetParentUuid */
    1871 static DECLCALLBACK(int) cueSetParentUuid(void *pBackendData, PCRTUUID pUuid)
    1872 {
    1873     RT_NOREF1(pUuid);
    1874     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    1875     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1876 
    1877     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1878 
    1879     int rc;
    1880     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    1881         rc = VERR_VD_IMAGE_READ_ONLY;
    1882     else
    1883         rc = VERR_NOT_SUPPORTED;
    1884 
    1885     LogFlowFunc(("returns %Rrc\n", rc));
    1886     return rc;
    1887 }
     1783VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(cueSetParentUuid, PCUEIMAGE);
    18881784
    18891785/** @copydoc VDIMAGEBACKEND::pfnGetParentModificationUuid */
    1890 static DECLCALLBACK(int) cueGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
    1891 {
    1892     RT_NOREF1(pUuid);
    1893     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    1894     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1895 
    1896     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1897 
    1898     int rc;
    1899     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    1900         rc = VERR_VD_IMAGE_READ_ONLY;
    1901     else
    1902         rc = VERR_NOT_SUPPORTED;
    1903 
    1904     LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
    1905     return rc;
    1906 }
     1786VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(cueGetParentModificationUuid);
    19071787
    19081788/** @copydoc VDIMAGEBACKEND::pfnSetParentModificationUuid */
    1909 static DECLCALLBACK(int) cueSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
    1910 {
    1911     RT_NOREF1(pUuid);
    1912     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    1913     PCUEIMAGE pThis = (PCUEIMAGE)pBackendData;
    1914 
    1915     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    1916 
    1917     int rc;
    1918     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    1919         rc = VERR_VD_IMAGE_READ_ONLY;
    1920     else
    1921         rc = VERR_NOT_SUPPORTED;
    1922 
    1923     LogFlowFunc(("returns %Rrc\n", rc));
    1924     return rc;
    1925 }
     1789VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(cueSetParentModificationUuid, PCUEIMAGE);
    19261790
    19271791/** @copydoc VDIMAGEBACKEND::pfnDump */
  • trunk/src/VBox/Storage/DMG.cpp

    r66486 r66494  
    3737
    3838#include "VDBackends.h"
     39#include "VDBackendsInline.h"
    3940
    4041
     
    22382239}
    22392240
    2240 /** @interface_method_impl{VDIMAGEBACKEND,pfnGetComment} */
    2241 static DECLCALLBACK(int) dmgGetComment(void *pBackendData, char *pszComment, size_t cbComment)
    2242 {
    2243     RT_NOREF2(pszComment, cbComment);
    2244     LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
    2245     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2246 
    2247     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2248 
    2249     LogFlowFunc(("returns %Rrc comment='%s'\n", VERR_NOT_SUPPORTED, pszComment));
    2250     return VERR_NOT_SUPPORTED;
    2251 }
    2252 
    2253 /** @interface_method_impl{VDIMAGEBACKEND,pfnSetComment} */
    2254 static DECLCALLBACK(int) dmgSetComment(void *pBackendData, const char *pszComment)
    2255 {
    2256     RT_NOREF1(pszComment);
    2257     LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
    2258     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2259 
    2260     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2261 
    2262     int rc;
    2263     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2264         rc = VERR_VD_IMAGE_READ_ONLY;
    2265     else
    2266         rc = VERR_NOT_SUPPORTED;
    2267 
    2268     LogFlowFunc(("returns %Rrc\n", rc));
    2269     return rc;
    2270 }
    2271 
    2272 /** @interface_method_impl{VDIMAGEBACKEND,pfnGetUuid} */
    2273 static DECLCALLBACK(int) dmgGetUuid(void *pBackendData, PRTUUID pUuid)
    2274 {
    2275     RT_NOREF1(pUuid);
    2276     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2277     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2278 
    2279     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2280 
    2281     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2282     return VERR_NOT_SUPPORTED;
    2283 }
    2284 
    2285 /** @interface_method_impl{VDIMAGEBACKEND,pfnSetUuid} */
    2286 static DECLCALLBACK(int) dmgSetUuid(void *pBackendData, PCRTUUID pUuid)
    2287 {
    2288     RT_NOREF1(pUuid);
    2289     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2290     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2291 
    2292     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2293 
    2294     int rc;
    2295     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2296         rc = VERR_VD_IMAGE_READ_ONLY;
    2297     else
    2298         rc = VERR_NOT_SUPPORTED;
    2299 
    2300     LogFlowFunc(("returns %Rrc\n", rc));
    2301     return rc;
    2302 }
    2303 
    2304 /** @interface_method_impl{VDIMAGEBACKEND,pfnGetModificationUuid} */
    2305 static DECLCALLBACK(int) dmgGetModificationUuid(void *pBackendData, PRTUUID pUuid)
    2306 {
    2307     RT_NOREF1(pUuid);
    2308     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2309     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2310 
    2311     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2312 
    2313     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2314     return VERR_NOT_SUPPORTED;
    2315 }
    2316 
    2317 /** @interface_method_impl{VDIMAGEBACKEND,pfnSetModificationUuid} */
    2318 static DECLCALLBACK(int) dmgSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
    2319 {
    2320     RT_NOREF1(pUuid);
    2321     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2322     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2323 
    2324     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2325 
    2326     int rc;
    2327     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2328         rc = VERR_VD_IMAGE_READ_ONLY;
    2329     else
    2330         rc = VERR_NOT_SUPPORTED;
    2331 
    2332     LogFlowFunc(("returns %Rrc\n", rc));
    2333     return rc;
    2334 }
    2335 
    2336 /** @interface_method_impl{VDIMAGEBACKEND,pfnGetParentUuid} */
    2337 static DECLCALLBACK(int) dmgGetParentUuid(void *pBackendData, PRTUUID pUuid)
    2338 {
    2339     RT_NOREF1(pUuid);
    2340     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2341     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2342 
    2343     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2344 
    2345     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2346     return VERR_NOT_SUPPORTED;
    2347 }
    2348 
    2349 /** @interface_method_impl{VDIMAGEBACKEND,pfnSetParentUuid} */
    2350 static DECLCALLBACK(int) dmgSetParentUuid(void *pBackendData, PCRTUUID pUuid)
    2351 {
    2352     RT_NOREF1(pUuid);
    2353     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2354     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2355 
    2356     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2357 
    2358     int rc;
    2359     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2360         rc = VERR_VD_IMAGE_READ_ONLY;
    2361     else
    2362         rc = VERR_NOT_SUPPORTED;
    2363 
    2364     LogFlowFunc(("returns %Rrc\n", rc));
    2365     return rc;
    2366 }
    2367 
    2368 /** @interface_method_impl{VDIMAGEBACKEND,pfnGetParentModificationUuid} */
    2369 static DECLCALLBACK(int) dmgGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
    2370 {
    2371     RT_NOREF1(pUuid);
    2372     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2373     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2374 
    2375     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2376 
    2377     int rc;
    2378     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2379         rc = VERR_VD_IMAGE_READ_ONLY;
    2380     else
    2381         rc = VERR_NOT_SUPPORTED;
    2382 
    2383     LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
    2384     return rc;
    2385 }
    2386 
    2387 /** @interface_method_impl{VDIMAGEBACKEND,pfnSetParentModificationUuid} */
    2388 static DECLCALLBACK(int) dmgSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
    2389 {
    2390     RT_NOREF1(pUuid);
    2391     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2392     PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    2393 
    2394     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
    2395 
    2396     int rc;
    2397     if (pThis->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2398         rc = VERR_VD_IMAGE_READ_ONLY;
    2399     else
    2400         rc = VERR_NOT_SUPPORTED;
    2401 
    2402     LogFlowFunc(("returns %Rrc\n", rc));
    2403     return rc;
    2404 }
     2241/** @copydoc VDIMAGEBACKEND::pfnGetComment */
     2242VD_BACKEND_CALLBACK_GET_COMMENT_DEF_NOT_SUPPORTED(dmgGetComment);
     2243
     2244/** @copydoc VDIMAGEBACKEND::pfnSetComment */
     2245VD_BACKEND_CALLBACK_SET_COMMENT_DEF_NOT_SUPPORTED(dmgSetComment, PDMGIMAGE);
     2246
     2247/** @copydoc VDIMAGEBACKEND::pfnGetUuid */
     2248VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(dmgGetUuid);
     2249
     2250/** @copydoc VDIMAGEBACKEND::pfnSetUuid */
     2251VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(dmgSetUuid, PDMGIMAGE);
     2252
     2253/** @copydoc VDIMAGEBACKEND::pfnGetModificationUuid */
     2254VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(dmgGetModificationUuid);
     2255
     2256/** @copydoc VDIMAGEBACKEND::pfnSetModificationUuid */
     2257VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(dmgSetModificationUuid, PDMGIMAGE);
     2258
     2259/** @copydoc VDIMAGEBACKEND::pfnGetParentUuid */
     2260VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(dmgGetParentUuid);
     2261
     2262/** @copydoc VDIMAGEBACKEND::pfnSetParentUuid */
     2263VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(dmgSetParentUuid, PDMGIMAGE);
     2264
     2265/** @copydoc VDIMAGEBACKEND::pfnGetParentModificationUuid */
     2266VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(dmgGetParentModificationUuid);
     2267
     2268/** @copydoc VDIMAGEBACKEND::pfnSetParentModificationUuid */
     2269VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(dmgSetParentModificationUuid, PDMGIMAGE);
    24052270
    24062271/** @interface_method_impl{VDIMAGEBACKEND,pfnDump} */
  • trunk/src/VBox/Storage/ISCSI.cpp

    r66486 r66494  
    3838
    3939#include "VDBackends.h"
     40#include "VDBackendsInline.h"
    4041
    4142
     
    52875288
    52885289/** @copydoc VDIMAGEBACKEND::pfnGetComment */
    5289 static DECLCALLBACK(int) iscsiGetComment(void *pBackendData, char *pszComment,
    5290                                          size_t cbComment)
    5291 {
    5292     RT_NOREF2(pszComment, cbComment);
    5293     LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
    5294     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5295 
    5296     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5297 
    5298     LogFlowFunc(("returns %Rrc comment='%s'\n", VERR_NOT_SUPPORTED, pszComment));
    5299     return VERR_NOT_SUPPORTED;
    5300 }
     5290VD_BACKEND_CALLBACK_GET_COMMENT_DEF_NOT_SUPPORTED(iscsiGetComment);
    53015291
    53025292/** @copydoc VDIMAGEBACKEND::pfnSetComment */
    5303 static DECLCALLBACK(int) iscsiSetComment(void *pBackendData, const char *pszComment)
    5304 {
    5305     RT_NOREF1(pszComment);
    5306     LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
    5307     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5308 
    5309     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5310 
    5311     int rc;
    5312     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    5313         rc = VERR_NOT_SUPPORTED;
    5314     else
    5315         rc = VERR_VD_IMAGE_READ_ONLY;
    5316 
    5317     LogFlowFunc(("returns %Rrc\n", rc));
    5318     return rc;
    5319 }
     5293VD_BACKEND_CALLBACK_SET_COMMENT_DEF_NOT_SUPPORTED(iscsiSetComment, PISCSIIMAGE);
    53205294
    53215295/** @copydoc VDIMAGEBACKEND::pfnGetUuid */
    5322 static DECLCALLBACK(int) iscsiGetUuid(void *pBackendData, PRTUUID pUuid)
    5323 {
    5324     RT_NOREF1(pUuid);
    5325     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    5326     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5327 
    5328     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5329 
    5330     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    5331     return VERR_NOT_SUPPORTED;
    5332 }
     5296VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(iscsiGetUuid);
    53335297
    53345298/** @copydoc VDIMAGEBACKEND::pfnSetUuid */
    5335 static DECLCALLBACK(int) iscsiSetUuid(void *pBackendData, PCRTUUID pUuid)
    5336 {
    5337     RT_NOREF1(pUuid);
    5338     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    5339     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5340 
    5341     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5342 
    5343     int rc;
    5344     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    5345         rc = VERR_NOT_SUPPORTED;
    5346     else
    5347         rc = VERR_VD_IMAGE_READ_ONLY;
    5348 
    5349     LogFlowFunc(("returns %Rrc\n", rc));
    5350     return rc;
    5351 }
     5299VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(iscsiSetUuid, PISCSIIMAGE);
    53525300
    53535301/** @copydoc VDIMAGEBACKEND::pfnGetModificationUuid */
    5354 static DECLCALLBACK(int) iscsiGetModificationUuid(void *pBackendData, PRTUUID pUuid)
    5355 {
    5356     RT_NOREF1(pUuid);
    5357     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    5358     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5359 
    5360     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5361 
    5362     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    5363     return VERR_NOT_SUPPORTED;
    5364 }
     5302VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(iscsiGetModificationUuid);
    53655303
    53665304/** @copydoc VDIMAGEBACKEND::pfnSetModificationUuid */
    5367 static DECLCALLBACK(int) iscsiSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
    5368 {
    5369     RT_NOREF1(pUuid);
    5370     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    5371     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5372 
    5373     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5374 
    5375     int rc;
    5376     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    5377         rc = VERR_NOT_SUPPORTED;
    5378     else
    5379         rc = VERR_VD_IMAGE_READ_ONLY;
    5380 
    5381     LogFlowFunc(("returns %Rrc\n", rc));
    5382     return rc;
    5383 }
     5305VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(iscsiSetModificationUuid, PISCSIIMAGE);
    53845306
    53855307/** @copydoc VDIMAGEBACKEND::pfnGetParentUuid */
    5386 static DECLCALLBACK(int) iscsiGetParentUuid(void *pBackendData, PRTUUID pUuid)
    5387 {
    5388     RT_NOREF1(pUuid);
    5389     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    5390     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5391 
    5392     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5393 
    5394     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    5395     return VERR_NOT_SUPPORTED;
    5396 }
     5308VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(iscsiGetParentUuid);
    53975309
    53985310/** @copydoc VDIMAGEBACKEND::pfnSetParentUuid */
    5399 static DECLCALLBACK(int) iscsiSetParentUuid(void *pBackendData, PCRTUUID pUuid)
    5400 {
    5401     RT_NOREF1(pUuid);
    5402     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    5403     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5404 
    5405     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5406 
    5407     int rc;
    5408     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    5409         rc = VERR_NOT_SUPPORTED;
    5410     else
    5411         rc = VERR_VD_IMAGE_READ_ONLY;
    5412 
    5413     LogFlowFunc(("returns %Rrc\n", rc));
    5414     return rc;
    5415 }
     5311VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(iscsiSetParentUuid, PISCSIIMAGE);
    54165312
    54175313/** @copydoc VDIMAGEBACKEND::pfnGetParentModificationUuid */
    5418 static DECLCALLBACK(int) iscsiGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
    5419 {
    5420     RT_NOREF1(pUuid);
    5421     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    5422     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5423 
    5424     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5425 
    5426     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    5427     return VERR_NOT_SUPPORTED;
    5428 }
     5314VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(iscsiGetParentModificationUuid);
    54295315
    54305316/** @copydoc VDIMAGEBACKEND::pfnSetParentModificationUuid */
    5431 static DECLCALLBACK(int) iscsiSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
    5432 {
    5433     RT_NOREF1(pUuid);
    5434     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    5435     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5436 
    5437     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    5438 
    5439     int rc;
    5440     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    5441         rc = VERR_NOT_SUPPORTED;
    5442     else
    5443         rc = VERR_VD_IMAGE_READ_ONLY;
    5444 
    5445     LogFlowFunc(("returns %Rrc\n", rc));
    5446     return rc;
    5447 }
     5317VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(iscsiSetParentModificationUuid, PISCSIIMAGE);
    54485318
    54495319/** @copydoc VDIMAGEBACKEND::pfnDump */
  • trunk/src/VBox/Storage/QCOW.cpp

    r66486 r66494  
    3333
    3434#include "VDBackends.h"
     35#include "VDBackendsInline.h"
    3536
    3637/** @page pg_storage_qcow   QCOW Storage Backend
     
    21162117
    21172118/** @copydoc VDIMAGEBACKEND::pfnGetComment */
    2118 static DECLCALLBACK(int) qcowGetComment(void *pBackendData, char *pszComment, size_t cbComment)
    2119 {
    2120     RT_NOREF2(pszComment, cbComment);
    2121     LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
    2122     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2123 
    2124     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2125 
    2126     LogFlowFunc(("returns %Rrc comment='%s'\n", VERR_NOT_SUPPORTED, pszComment));
    2127     return VERR_NOT_SUPPORTED;
    2128 }
     2119VD_BACKEND_CALLBACK_GET_COMMENT_DEF_NOT_SUPPORTED(qcowGetComment);
    21292120
    21302121/** @copydoc VDIMAGEBACKEND::pfnSetComment */
    2131 static DECLCALLBACK(int) qcowSetComment(void *pBackendData, const char *pszComment)
    2132 {
    2133     RT_NOREF1(pszComment);
    2134     LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
    2135     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2136 
    2137     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2138 
    2139     int rc;
    2140     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2141         rc = VERR_VD_IMAGE_READ_ONLY;
    2142     else
    2143         rc = VERR_NOT_SUPPORTED;
    2144 
    2145     LogFlowFunc(("returns %Rrc\n", rc));
    2146     return rc;
    2147 }
     2122VD_BACKEND_CALLBACK_SET_COMMENT_DEF_NOT_SUPPORTED(qcowSetComment, PQCOWIMAGE);
    21482123
    21492124/** @copydoc VDIMAGEBACKEND::pfnGetUuid */
    2150 static DECLCALLBACK(int) qcowGetUuid(void *pBackendData, PRTUUID pUuid)
    2151 {
    2152     RT_NOREF1(pUuid);
    2153     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2154     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2155 
    2156     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2157 
    2158     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2159     return VERR_NOT_SUPPORTED;
    2160 }
     2125VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(qcowGetUuid);
    21612126
    21622127/** @copydoc VDIMAGEBACKEND::pfnSetUuid */
    2163 static DECLCALLBACK(int) qcowSetUuid(void *pBackendData, PCRTUUID pUuid)
    2164 {
    2165     RT_NOREF1(pUuid);
    2166     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2167     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2168 
    2169     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2170 
    2171     int rc;
    2172     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2173         rc = VERR_VD_IMAGE_READ_ONLY;
    2174     else
    2175         rc = VERR_NOT_SUPPORTED;
    2176 
    2177     LogFlowFunc(("returns %Rrc\n", rc));
    2178     return rc;
    2179 }
     2128VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(qcowSetUuid, PQCOWIMAGE);
    21802129
    21812130/** @copydoc VDIMAGEBACKEND::pfnGetModificationUuid */
    2182 static DECLCALLBACK(int) qcowGetModificationUuid(void *pBackendData, PRTUUID pUuid)
    2183 {
    2184     RT_NOREF1(pUuid);
    2185     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2186     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2187 
    2188     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2189 
    2190     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2191     return VERR_NOT_SUPPORTED;
    2192 }
     2131VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(qcowGetModificationUuid);
    21932132
    21942133/** @copydoc VDIMAGEBACKEND::pfnSetModificationUuid */
    2195 static DECLCALLBACK(int) qcowSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
    2196 {
    2197     RT_NOREF1(pUuid);
    2198     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2199     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2200 
    2201     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2202 
    2203     int rc;
    2204     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2205         rc = VERR_VD_IMAGE_READ_ONLY;
    2206     else
    2207         rc = VERR_NOT_SUPPORTED;
    2208 
    2209     LogFlowFunc(("returns %Rrc\n", rc));
    2210     return rc;
    2211 }
     2134VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(qcowSetModificationUuid, PQCOWIMAGE);
    22122135
    22132136/** @copydoc VDIMAGEBACKEND::pfnGetParentUuid */
    2214 static DECLCALLBACK(int) qcowGetParentUuid(void *pBackendData, PRTUUID pUuid)
    2215 {
    2216     RT_NOREF1(pUuid);
    2217     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2218     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2219 
    2220     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2221 
    2222     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2223     return VERR_NOT_SUPPORTED;
    2224 }
     2137VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(qcowGetParentUuid);
    22252138
    22262139/** @copydoc VDIMAGEBACKEND::pfnSetParentUuid */
    2227 static DECLCALLBACK(int) qcowSetParentUuid(void *pBackendData, PCRTUUID pUuid)
    2228 {
    2229     RT_NOREF1(pUuid);
    2230     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2231     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2232 
    2233     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2234 
    2235     int rc;
    2236     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2237         rc = VERR_VD_IMAGE_READ_ONLY;
    2238     else
    2239         rc = VERR_NOT_SUPPORTED;
    2240 
    2241     LogFlowFunc(("returns %Rrc\n", rc));
    2242     return rc;
    2243 }
     2140VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(qcowSetParentUuid, PQCOWIMAGE);
    22442141
    22452142/** @copydoc VDIMAGEBACKEND::pfnGetParentModificationUuid */
    2246 static DECLCALLBACK(int) qcowGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
    2247 {
    2248     RT_NOREF1(pUuid);
    2249     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2250     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2251 
    2252     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2253 
    2254     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2255     return VERR_NOT_SUPPORTED;
    2256 }
     2143VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(qcowGetParentModificationUuid);
    22572144
    22582145/** @copydoc VDIMAGEBACKEND::pfnSetParentModificationUuid */
    2259 static DECLCALLBACK(int) qcowSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
    2260 {
    2261     RT_NOREF1(pUuid);
    2262     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2263     PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
    2264 
    2265     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2266 
    2267     int rc;
    2268     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2269         rc = VERR_VD_IMAGE_READ_ONLY;
    2270     else
    2271         rc = VERR_NOT_SUPPORTED;
    2272 
    2273     LogFlowFunc(("returns %Rrc\n", rc));
    2274     return rc;
    2275 }
     2146VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(qcowSetParentModificationUuid, PQCOWIMAGE);
    22762147
    22772148/** @copydoc VDIMAGEBACKEND::pfnDump */
  • trunk/src/VBox/Storage/QED.cpp

    r66486 r66494  
    3333
    3434#include "VDBackends.h"
     35#include "VDBackendsInline.h"
    3536
    3637/**
     
    21252126
    21262127/** @copydoc VDIMAGEBACKEND::pfnGetComment */
    2127 static DECLCALLBACK(int) qedGetComment(void *pBackendData, char *pszComment,
    2128                                        size_t cbComment)
    2129 {
    2130     RT_NOREF2(pszComment, cbComment);
    2131     LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
    2132     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2133 
    2134     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2135 
    2136     LogFlowFunc(("returns %Rrc comment='%s'\n", VERR_NOT_SUPPORTED, pszComment));
    2137     return VERR_NOT_SUPPORTED;
    2138 }
     2128VD_BACKEND_CALLBACK_GET_COMMENT_DEF_NOT_SUPPORTED(qedGetComment);
    21392129
    21402130/** @copydoc VDIMAGEBACKEND::pfnSetComment */
    2141 static DECLCALLBACK(int) qedSetComment(void *pBackendData, const char *pszComment)
    2142 {
    2143     RT_NOREF1(pszComment);
    2144     LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
    2145     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2146 
    2147     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2148 
    2149     int rc;
    2150     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2151         rc = VERR_VD_IMAGE_READ_ONLY;
    2152     else
    2153         rc = VERR_NOT_SUPPORTED;
    2154 
    2155     LogFlowFunc(("returns %Rrc\n", rc));
    2156     return rc;
    2157 }
     2131VD_BACKEND_CALLBACK_SET_COMMENT_DEF_NOT_SUPPORTED(qedSetComment, PQEDIMAGE);
    21582132
    21592133/** @copydoc VDIMAGEBACKEND::pfnGetUuid */
    2160 static DECLCALLBACK(int) qedGetUuid(void *pBackendData, PRTUUID pUuid)
    2161 {
    2162     RT_NOREF1(pUuid);
    2163     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2164     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2165 
    2166     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2167 
    2168     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2169     return VERR_NOT_SUPPORTED;
    2170 }
     2134VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(qedGetUuid);
    21712135
    21722136/** @copydoc VDIMAGEBACKEND::pfnSetUuid */
    2173 static DECLCALLBACK(int) qedSetUuid(void *pBackendData, PCRTUUID pUuid)
    2174 {
    2175     RT_NOREF1(pUuid);
    2176     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2177     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2178 
    2179     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2180 
    2181     int rc;
    2182     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2183         rc = VERR_VD_IMAGE_READ_ONLY;
    2184     else
    2185         rc = VERR_NOT_SUPPORTED;
    2186 
    2187     LogFlowFunc(("returns %Rrc\n", rc));
    2188     return rc;
    2189 }
     2137VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(qedSetUuid, PQEDIMAGE);
    21902138
    21912139/** @copydoc VDIMAGEBACKEND::pfnGetModificationUuid */
    2192 static DECLCALLBACK(int) qedGetModificationUuid(void *pBackendData, PRTUUID pUuid)
    2193 {
    2194     RT_NOREF1(pUuid);
    2195     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2196     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2197 
    2198     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2199 
    2200     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2201     return VERR_NOT_SUPPORTED;
    2202 }
     2140VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(qedGetModificationUuid);
    22032141
    22042142/** @copydoc VDIMAGEBACKEND::pfnSetModificationUuid */
    2205 static DECLCALLBACK(int) qedSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
    2206 {
    2207     RT_NOREF1(pUuid);
    2208     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2209     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2210 
    2211     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2212 
    2213     int rc;
    2214     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2215         rc = VERR_VD_IMAGE_READ_ONLY;
    2216     else
    2217         rc = VERR_NOT_SUPPORTED;
    2218 
    2219     LogFlowFunc(("returns %Rrc\n", rc));
    2220     return rc;
    2221 }
     2143VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(qedSetModificationUuid, PQEDIMAGE);
    22222144
    22232145/** @copydoc VDIMAGEBACKEND::pfnGetParentUuid */
    2224 static DECLCALLBACK(int) qedGetParentUuid(void *pBackendData, PRTUUID pUuid)
    2225 {
    2226     RT_NOREF1(pUuid);
    2227     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2228     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2229 
    2230     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2231 
    2232     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2233     return VERR_NOT_SUPPORTED;
    2234 }
     2146VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(qedGetParentUuid);
    22352147
    22362148/** @copydoc VDIMAGEBACKEND::pfnSetParentUuid */
    2237 static DECLCALLBACK(int) qedSetParentUuid(void *pBackendData, PCRTUUID pUuid)
    2238 {
    2239     RT_NOREF1(pUuid);
    2240     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2241     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2242 
    2243     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2244 
    2245     int rc;
    2246     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2247         rc = VERR_VD_IMAGE_READ_ONLY;
    2248     else
    2249         rc = VERR_NOT_SUPPORTED;
    2250 
    2251     LogFlowFunc(("returns %Rrc\n", rc));
    2252     return rc;
    2253 }
     2149VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(qedSetParentUuid, PQEDIMAGE);
    22542150
    22552151/** @copydoc VDIMAGEBACKEND::pfnGetParentModificationUuid */
    2256 static DECLCALLBACK(int) qedGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
    2257 {
    2258     RT_NOREF1(pUuid);
    2259     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2260     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2261 
    2262     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2263 
    2264     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VERR_NOT_SUPPORTED, pUuid));
    2265     return VERR_NOT_SUPPORTED;
    2266 }
     2152VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(qedGetParentModificationUuid);
    22672153
    22682154/** @copydoc VDIMAGEBACKEND::pfnSetParentModificationUuid */
    2269 static DECLCALLBACK(int) qedSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
    2270 {
    2271     RT_NOREF1(pUuid);
    2272     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2273     PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
    2274 
    2275     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
    2276 
    2277     int rc;
    2278     if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2279         rc = VERR_VD_IMAGE_READ_ONLY;
    2280     else
    2281         rc = VERR_NOT_SUPPORTED;
    2282 
    2283     LogFlowFunc(("returns %Rrc\n", rc));
    2284     return rc;
    2285 }
     2155VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(qedSetParentModificationUuid, PQEDIMAGE);
    22862156
    22872157/** @copydoc VDIMAGEBACKEND::pfnDump */
  • trunk/src/VBox/Storage/VHDX.cpp

    r66486 r66494  
    3333
    3434#include "VDBackends.h"
     35#include "VDBackendsInline.h"
    3536
    3637
     
    22632264
    22642265/** @copydoc VDIMAGEBACKEND::pfnGetComment */
    2265 static DECLCALLBACK(int) vhdxGetComment(void *pBackendData, char *pszComment,
    2266                                         size_t cbComment)
    2267 {
    2268     RT_NOREF2(pszComment, cbComment);
    2269     LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
    2270     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2271     int rc;
    2272 
    2273     AssertPtr(pImage);
    2274 
    2275     if (pImage)
    2276         rc = VERR_NOT_SUPPORTED;
    2277     else
    2278         rc = VERR_VD_NOT_OPENED;
    2279 
    2280     LogFlowFunc(("returns %Rrc comment='%s'\n", rc, pszComment));
    2281     return rc;
    2282 }
     2266VD_BACKEND_CALLBACK_GET_COMMENT_DEF_NOT_SUPPORTED(vhdxGetComment);
    22832267
    22842268/** @copydoc VDIMAGEBACKEND::pfnSetComment */
    2285 static DECLCALLBACK(int) vhdxSetComment(void *pBackendData, const char *pszComment)
    2286 {
    2287     RT_NOREF1(pszComment);
    2288     LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
    2289     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2290     int rc;
    2291 
    2292     AssertPtr(pImage);
    2293 
    2294     if (pImage)
    2295     {
    2296         if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2297             rc = VERR_VD_IMAGE_READ_ONLY;
    2298         else
    2299             rc = VERR_NOT_SUPPORTED;
    2300     }
    2301     else
    2302         rc = VERR_VD_NOT_OPENED;
    2303 
    2304     LogFlowFunc(("returns %Rrc\n", rc));
    2305     return rc;
    2306 }
     2269VD_BACKEND_CALLBACK_SET_COMMENT_DEF_NOT_SUPPORTED(vhdxSetComment, PVHDXIMAGE);
    23072270
    23082271/** @copydoc VDIMAGEBACKEND::pfnGetUuid */
    2309 static DECLCALLBACK(int) vhdxGetUuid(void *pBackendData, PRTUUID pUuid)
    2310 {
    2311     RT_NOREF1(pUuid);
    2312     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2313     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2314     int rc;
    2315 
    2316     AssertPtr(pImage);
    2317 
    2318     if (pImage)
    2319         rc = VERR_NOT_SUPPORTED;
    2320     else
    2321         rc = VERR_VD_NOT_OPENED;
    2322 
    2323     LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
    2324     return rc;
    2325 }
     2272VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(vhdxGetUuid);
    23262273
    23272274/** @copydoc VDIMAGEBACKEND::pfnSetUuid */
    2328 static DECLCALLBACK(int) vhdxSetUuid(void *pBackendData, PCRTUUID pUuid)
    2329 {
    2330     RT_NOREF1(pUuid);
    2331     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2332     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2333     int rc;
    2334 
    2335     LogFlowFunc(("%RTuuid\n", pUuid));
    2336     AssertPtr(pImage);
    2337 
    2338     if (pImage)
    2339     {
    2340         if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    2341             rc = VERR_NOT_SUPPORTED;
    2342         else
    2343             rc = VERR_VD_IMAGE_READ_ONLY;
    2344     }
    2345     else
    2346         rc = VERR_VD_NOT_OPENED;
    2347 
    2348     LogFlowFunc(("returns %Rrc\n", rc));
    2349     return rc;
    2350 }
     2275VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(vhdxSetUuid, PVHDXIMAGE);
    23512276
    23522277/** @copydoc VDIMAGEBACKEND::pfnGetModificationUuid */
    2353 static DECLCALLBACK(int) vhdxGetModificationUuid(void *pBackendData, PRTUUID pUuid)
    2354 {
    2355     RT_NOREF1(pUuid);
    2356     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2357     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2358     int rc;
    2359 
    2360     AssertPtr(pImage);
    2361 
    2362     if (pImage)
    2363         rc = VERR_NOT_SUPPORTED;
    2364     else
    2365         rc = VERR_VD_NOT_OPENED;
    2366 
    2367     LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
    2368     return rc;
    2369 }
     2278VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(vhdxGetModificationUuid);
    23702279
    23712280/** @copydoc VDIMAGEBACKEND::pfnSetModificationUuid */
    2372 static DECLCALLBACK(int) vhdxSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
    2373 {
    2374     RT_NOREF1(pUuid);
    2375     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2376     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2377     int rc;
    2378 
    2379     AssertPtr(pImage);
    2380 
    2381     if (pImage)
    2382     {
    2383         if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    2384             rc = VERR_NOT_SUPPORTED;
    2385         else
    2386             rc = VERR_VD_IMAGE_READ_ONLY;
    2387     }
    2388     else
    2389         rc = VERR_VD_NOT_OPENED;
    2390 
    2391     LogFlowFunc(("returns %Rrc\n", rc));
    2392     return rc;
    2393 }
     2281VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(vhdxSetModificationUuid, PVHDXIMAGE);
    23942282
    23952283/** @copydoc VDIMAGEBACKEND::pfnGetParentUuid */
    2396 static DECLCALLBACK(int) vhdxGetParentUuid(void *pBackendData, PRTUUID pUuid)
    2397 {
    2398     RT_NOREF1(pUuid);
    2399     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2400     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2401     int rc;
    2402 
    2403     AssertPtr(pImage);
    2404 
    2405     if (pImage)
    2406         rc = VERR_NOT_SUPPORTED;
    2407     else
    2408         rc = VERR_VD_NOT_OPENED;
    2409 
    2410     LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
    2411     return rc;
    2412 }
     2284VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(vhdxGetParentUuid);
    24132285
    24142286/** @copydoc VDIMAGEBACKEND::pfnSetParentUuid */
    2415 static DECLCALLBACK(int) vhdxSetParentUuid(void *pBackendData, PCRTUUID pUuid)
    2416 {
    2417     RT_NOREF1(pUuid);
    2418     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2419     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2420     int rc;
    2421 
    2422     AssertPtr(pImage);
    2423 
    2424     if (pImage)
    2425     {
    2426         if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    2427             rc = VERR_NOT_SUPPORTED;
    2428         else
    2429             rc = VERR_VD_IMAGE_READ_ONLY;
    2430     }
    2431     else
    2432         rc = VERR_VD_NOT_OPENED;
    2433 
    2434     LogFlowFunc(("returns %Rrc\n", rc));
    2435     return rc;
    2436 }
     2287VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(vhdxSetParentUuid, PVHDXIMAGE);
    24372288
    24382289/** @copydoc VDIMAGEBACKEND::pfnGetParentModificationUuid */
    2439 static DECLCALLBACK(int) vhdxGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
    2440 {
    2441     RT_NOREF1(pUuid);
    2442     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
    2443     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2444     int rc;
    2445 
    2446     AssertPtr(pImage);
    2447 
    2448     if (pImage)
    2449         rc = VERR_NOT_SUPPORTED;
    2450     else
    2451         rc = VERR_VD_NOT_OPENED;
    2452 
    2453     LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
    2454     return rc;
    2455 }
     2290VD_BACKEND_CALLBACK_GET_UUID_DEF_NOT_SUPPORTED(vhdxGetParentModificationUuid);
    24562291
    24572292/** @copydoc VDIMAGEBACKEND::pfnSetParentModificationUuid */
    2458 static DECLCALLBACK(int) vhdxSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
    2459 {
    2460     RT_NOREF1(pUuid);
    2461     LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
    2462     PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
    2463     int rc;
    2464 
    2465     AssertPtr(pImage);
    2466 
    2467     if (pImage)
    2468     {
    2469         if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
    2470             rc = VERR_NOT_SUPPORTED;
    2471         else
    2472             rc = VERR_VD_IMAGE_READ_ONLY;
    2473     }
    2474     else
    2475         rc = VERR_VD_NOT_OPENED;
    2476 
    2477     LogFlowFunc(("returns %Rrc\n", rc));
    2478     return rc;
    2479 }
     2293VD_BACKEND_CALLBACK_SET_UUID_DEF_NOT_SUPPORTED(vhdxSetParentModificationUuid, PVHDXIMAGE);
    24802294
    24812295/** @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