VirtualBox

Changeset 11353 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Aug 12, 2008 12:55:15 PM (16 years ago)
Author:
vboxsync
Message:

VBoxHDD-new: add new UUID parameter to image creation, specifying which UUID the new image should have.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/RawHDDCore.cpp

    r11287 r11353  
    359359                     const char *pszComment,
    360360                     PCPDMMEDIAGEOMETRY pPCHSGeometry,
    361                      PCPDMMEDIAGEOMETRY pLCHSGeometry,
     361                     PCPDMMEDIAGEOMETRY pLCHSGeometry, PCRTUUID pUuid,
    362362                     unsigned uOpenFlags, PFNVMPROGRESS pfnProgress,
    363363                     void *pvUser, unsigned uPercentStart,
     
    365365                     void **ppBackendData)
    366366{
    367     LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pInterfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));
     367    LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pInterfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));
    368368    int rc;
    369369    PRAWIMAGE pImage;
  • trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp

    r11287 r11353  
    12551255 * @param   pPCHSGeometry   Pointer to physical disk geometry <= (16383,16,63). Not NULL.
    12561256 * @param   pLCHSGeometry   Pointer to logical disk geometry <= (1024,255,63). Not NULL.
     1257 * @param   pUuid           New UUID of the image. If NULL, a new UUID is created.
    12571258 * @param   uOpenFlags      Image file open mode, see VD_OPEN_FLAGS_* constants.
    12581259 * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
     
    12651266                               PCPDMMEDIAGEOMETRY pPCHSGeometry,
    12661267                               PCPDMMEDIAGEOMETRY pLCHSGeometry,
    1267                                unsigned uOpenFlags, PFNVMPROGRESS pfnProgress,
    1268                                void *pvUser)
     1268                               PCRTUUID pUuid, unsigned uOpenFlags,
     1269                               PFNVMPROGRESS pfnProgress, void *pvUser)
    12691270{
    12701271    int rc = VINF_SUCCESS;
    12711272    PVDIMAGE pImage = NULL;
    1272 
    1273     LogFlowFunc(("pDisk=%#p pszBackend=\"%s\" pszFilename=\"%s\" enmType=%#x cbSize=%llu uImageFlags=%#x pszComment=\"%s\" PCHS=%u/%u/%u LCHS=%u/%u/%u uOpenFlags=%#x pfnProgress=%#p pvUser=%#p\n",
     1273    RTUUID uuid;
     1274
     1275    LogFlowFunc(("pDisk=%#p pszBackend=\"%s\" pszFilename=\"%s\" enmType=%#x cbSize=%llu uImageFlags=%#x pszComment=\"%s\" PCHS=%u/%u/%u LCHS=%u/%u/%u Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p\n",
    12741276                 pDisk, pszBackend, pszFilename, enmType, cbSize, uImageFlags, pszComment,
    12751277                 pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads,
    12761278                 pPCHSGeometry->cSectors, pLCHSGeometry->cCylinders,
    1277                  pLCHSGeometry->cHeads, pLCHSGeometry->cSectors, uOpenFlags,
    1278                  pfnProgress, pvUser));
     1279                 pLCHSGeometry->cHeads, pLCHSGeometry->cSectors, pUuid,
     1280                 uOpenFlags, pfnProgress, pvUser));
    12791281    do
    12801282    {
     
    13171319                            pLCHSGeometry->cSectors),
    13181320                           rc = VERR_INVALID_PARAMETER);
     1321        /* The UUID may be NULL. */
     1322        AssertMsgBreakStmt(pUuid == NULL || VALID_PTR(pUuid),
     1323                           ("pUuid=%#p UUID=%RTuuid\n", pUuid, pUuid),
     1324                           rc = VERR_INVALID_PARAMETER);
    13191325        AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0,
    13201326                           ("uOpenFlags=%#x\n", uOpenFlags),
     
    13501356        }
    13511357
     1358        /* Create UUID if the caller didn't specify one. */
     1359        if (!pUuid)
     1360        {
     1361            rc = RTUuidCreate(&uuid);
     1362            if (RT_FAILURE(rc))
     1363            {
     1364                rc = vdError(pDisk, rc, RT_SRC_POS,
     1365                             N_("VD: cannot generate UUID for image '%s'"),
     1366                             pszFilename);
     1367                break;
     1368            }
     1369            pUuid = &uuid;
     1370        }
     1371
    13521372        pImage->uOpenFlags = uOpenFlags & VD_OPEN_FLAGS_HONOR_SAME;
    13531373        rc = pImage->Backend->pfnCreate(pImage->pszFilename, enmType, cbSize,
    13541374                                        uImageFlags, pszComment, pPCHSGeometry,
    1355                                         pLCHSGeometry,
     1375                                        pLCHSGeometry, pUuid,
    13561376                                        uOpenFlags & ~VD_OPEN_FLAGS_HONOR_SAME,
    13571377                                        pfnProgress, pvUser, 0, 99,
     
    14571477 * @param   uImageFlags     Flags specifying special image features.
    14581478 * @param   pszComment      Pointer to image comment. NULL is ok.
     1479 * @param   pUuid           New UUID of the image. If NULL, a new UUID is created.
    14591480 * @param   uOpenFlags      Image file open mode, see VD_OPEN_FLAGS_* constants.
    14601481 * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
     
    14631484VBOXDDU_DECL(int) VDCreateDiff(PVBOXHDD pDisk, const char *pszBackend,
    14641485                               const char *pszFilename, unsigned uImageFlags,
    1465                                const char *pszComment, unsigned uOpenFlags,
    1466                                PFNVMPROGRESS pfnProgress, void *pvUser)
     1486                               const char *pszComment, PCRTUUID pUuid,
     1487                               unsigned uOpenFlags, PFNVMPROGRESS pfnProgress,
     1488                               void *pvUser)
    14671489{
    14681490    int rc = VINF_SUCCESS;
    14691491    PVDIMAGE pImage = NULL;
    1470 
    1471     LogFlowFunc(("pDisk=%#p pszBackend=\"%s\" pszFilename=\"%s\" uImageFlags=%#x pszComment=\"%s\" uOpenFlags=%#x pfnProgress=%#p pvUser=%#p\n",
    1472                  pDisk, pszBackend, pszFilename, uImageFlags, pszComment, uOpenFlags,
     1492    RTUUID uuid;
     1493
     1494    LogFlowFunc(("pDisk=%#p pszBackend=\"%s\" pszFilename=\"%s\" uImageFlags=%#x pszComment=\"%s\" Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p\n",
     1495                 pDisk, pszBackend, pszFilename, uImageFlags, pszComment, pUuid, uOpenFlags,
    14731496                 pfnProgress, pvUser));
    14741497    do
     
    14871510        AssertMsgBreakStmt((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0,
    14881511                           ("uImageFlags=%#x\n", uImageFlags),
     1512                           rc = VERR_INVALID_PARAMETER);
     1513        /* The UUID may be NULL. */
     1514        AssertMsgBreakStmt(pUuid == NULL || VALID_PTR(pUuid),
     1515                           ("pUuid=%#p UUID=%RTuuid\n", pUuid, pUuid),
    14891516                           rc = VERR_INVALID_PARAMETER);
    14901517        AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0,
     
    15191546                         N_("VD: unknown backend name '%s'"), pszBackend);
    15201547            break;
     1548        }
     1549
     1550        /* Create UUID if the caller didn't specify one. */
     1551        if (!pUuid)
     1552        {
     1553            rc = RTUuidCreate(&uuid);
     1554            if (RT_FAILURE(rc))
     1555            {
     1556                rc = vdError(pDisk, rc, RT_SRC_POS,
     1557                             N_("VD: cannot generate UUID for image '%s'"),
     1558                             pszFilename);
     1559                break;
     1560            }
     1561            pUuid = &uuid;
    15211562        }
    15221563
     
    15261567                                        uImageFlags, pszComment,
    15271568                                        &pDisk->PCHSGeometry,
    1528                                         &pDisk->LCHSGeometry,
     1569                                        &pDisk->LCHSGeometry, pUuid,
    15291570                                        uOpenFlags & ~VD_OPEN_FLAGS_HONOR_SAME,
    15301571                                        pfnProgress, pvUser, 0, 99,
     
    19672008        {
    19682009            rc = VDCreateDiff(pDiskTo, pszBackend, pszFilename, uImageFlagsFrom,
    1969                               "", uOpenFlagsFrom, NULL, NULL);
     2010                              "", NULL, uOpenFlagsFrom, NULL, NULL);
    19702011        } else {
    19712012            rc = VDCreateBase(pDiskTo, pszBackend, pszFilename, enmTypeFrom,
    19722013                              cbSize, uImageFlagsFrom, "",
    19732014                              &PCHSGeometryFrom, &LCHSGeometryFrom,
    1974                               uOpenFlagsFrom, NULL, NULL);
     2015                              NULL, uOpenFlagsFrom, NULL, NULL);
    19752016        }
    19762017        if (RT_FAILURE(rc))
  • trunk/src/VBox/Devices/Storage/VBoxHDD-newInternal.h

    r10715 r11353  
    8989     * @param   pPCHSGeometry   Physical drive geometry CHS <= (16383,16,255).
    9090     * @param   pLCHSGeometry   Logical drive geometry CHS <= (1024,255,63).
     91     * @param   pUuid           New UUID of the image. Not NULL.
    9192     * @param   uOpenFlags      Image file open mode, see VD_OPEN_FLAGS_* constants.
    9293     * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
     
    9798     * @param   ppvBackendData  Opaque state data for this image.
    9899     */
    99     DECLR3CALLBACKMEMBER(int, pfnCreate, (const char *pszFilename, VDIMAGETYPE enmType, uint64_t cbSize, unsigned uImageFlags, const char *pszComment, PCPDMMEDIAGEOMETRY pPCHSGeometry, PCPDMMEDIAGEOMETRY pLCHSGeometry, unsigned uOpenFlags, PFNVMPROGRESS pfnProgress, void *pvUser, unsigned uPercentStart, unsigned uPercentSpan, PVDINTERFACE pInterfaces, void **ppvBackendData));
     100    DECLR3CALLBACKMEMBER(int, pfnCreate, (const char *pszFilename, VDIMAGETYPE enmType, uint64_t cbSize, unsigned uImageFlags, const char *pszComment, PCPDMMEDIAGEOMETRY pPCHSGeometry, PCPDMMEDIAGEOMETRY pLCHSGeometry, PCRTUUID pUuid, unsigned uOpenFlags, PFNVMPROGRESS pfnProgress, void *pvUser, unsigned uPercentStart, unsigned uPercentSpan, PVDINTERFACE pInterfaces, void **ppvBackendData));
    100101
    101102    /**
  • trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp

    r11287 r11353  
    316316                          const char *pszComment,
    317317                          PCPDMMEDIAGEOMETRY pPCHSGeometry,
    318                           PCPDMMEDIAGEOMETRY pLCHSGeometry,
     318                          PCPDMMEDIAGEOMETRY pLCHSGeometry, PCRTUUID pUuid,
    319319                          PFNVMPROGRESS pfnProgress, void *pvUser,
    320320                          unsigned uPercentStart, unsigned uPercentSpan)
     
    415415        goto out;
    416416    }
     417
     418    /* Use specified image uuid */
     419    *getImageCreationUUID(&pImage->Header) = *pUuid;
    417420
    418421    /* Generate image last-modify uuid */
     
    800803                     const char *pszComment,
    801804                     PCPDMMEDIAGEOMETRY pPCHSGeometry,
    802                      PCPDMMEDIAGEOMETRY pLCHSGeometry,
     805                     PCPDMMEDIAGEOMETRY pLCHSGeometry, PCRTUUID pUuid,
    803806                     unsigned uOpenFlags, PFNVMPROGRESS pfnProgress,
    804807                     void *pvUser, unsigned uPercentStart,
     
    806809                     void **ppBackendData)
    807810{
    808     LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pInterfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));
     811    LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pInterfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));
    809812    int rc;
    810813    PVDIIMAGEDESC pImage;
     
    843846
    844847    rc = vdiCreateImage(pImage, enmType, cbSize, uImageFlags, pszComment,
    845                         pPCHSGeometry, pLCHSGeometry,
     848                        pPCHSGeometry, pLCHSGeometry, pUuid,
    846849                        pfnProgress, pvUser, uPercentStart, uPercentSpan);
    847850    if (RT_SUCCESS(rc))
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r11287 r11353  
    30963096                           const char *pszComment,
    30973097                           PCPDMMEDIAGEOMETRY pPCHSGeometry,
    3098                            PCPDMMEDIAGEOMETRY pLCHSGeometry,
     3098                           PCPDMMEDIAGEOMETRY pLCHSGeometry, PCRTUUID pUuid,
    30993099                           PFNVMPROGRESS pfnProgress, void *pvUser,
    31003100                           unsigned uPercentStart, unsigned uPercentSpan)
     
    31803180    pImage->PCHSGeometry = *pPCHSGeometry;
    31813181
    3182     rc = RTUuidCreate(&pImage->ImageUuid);
    3183     if (RT_FAILURE(rc))
    3184         goto out;
     3182    pImage->ImageUuid = *pUuid;
    31853183    rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    31863184                            VMDK_DDB_IMAGE_UUID, &pImage->ImageUuid);
     
    37463744                      const char *pszComment,
    37473745                      PCPDMMEDIAGEOMETRY pPCHSGeometry,
    3748                       PCPDMMEDIAGEOMETRY pLCHSGeometry,
     3746                      PCPDMMEDIAGEOMETRY pLCHSGeometry, PCRTUUID pUuid,
    37493747                      unsigned uOpenFlags, PFNVMPROGRESS pfnProgress,
    37503748                      void *pvUser, unsigned uPercentStart,
     
    37523750                      void **ppBackendData)
    37533751{
    3754     LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pInterfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));
     3752    LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pInterfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));
    37553753    int rc;
    37563754    PVMDKIMAGE pImage;
     
    38073805
    38083806    rc = vmdkCreateImage(pImage, enmType, cbSize, uImageFlags, pszComment,
    3809                          pPCHSGeometry, pLCHSGeometry,
     3807                         pPCHSGeometry, pLCHSGeometry, pUuid,
    38103808                         pfnProgress, pvUser, uPercentStart, uPercentSpan);
    38113809    if (RT_SUCCESS(rc))
  • trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp

    r10715 r11353  
    8383
    8484    rc = VDCreateBase(pVD, pszBackend, pszFilename, enmType, cbSize,
    85                       uFlags, "Test image", &PCHS, &LCHS, VD_OPEN_FLAGS_NORMAL,
    86                       NULL, NULL);
     85                      uFlags, "Test image", &PCHS, &LCHS, NULL,
     86                      VD_OPEN_FLAGS_NORMAL, NULL, NULL);
    8787    CHECK("VDCreateBase()");
    8888
     
    101101
    102102/**
    103  * The following code is based on the work of George Marsaglia 
    104  * taken from 
     103 * The following code is based on the work of George Marsaglia
     104 * taken from
    105105 * http://groups.google.ws/group/comp.sys.sun.admin/msg/7c667186f6cbf354
    106  * and 
    107  * http://groups.google.ws/group/comp.lang.c/msg/0e170777c6e79e8d 
     106 * and
     107 * http://groups.google.ws/group/comp.lang.c/msg/0e170777c6e79e8d
    108108 */
    109109
    110 /* 
    111 A C version of a very very good 64-bit RNG is given below. 
    112 You should be able to adapt it to your particular needs. 
    113 
    114 It is based on the complimentary-multiple-with-carry 
    115 sequence 
    116          x(n)=a*x(n-4)+carry mod 2^64-1, 
    117 which works as follows: 
    118 Assume a certain multiplier 'a' and a base 'b'. 
    119 Given a current x value and a current carry 'c', 
    120 form:               t=a*x+c 
    121 Then the new carry is     c=floor(t/b) 
    122 and the new x value is    x = b-1-(t mod b). 
    123 
    124 
    125 Ordinarily, for 32-bit mwc or cmwc sequences, the 
    126 value t=a*x+c can be formed in 64 bits, then the new c 
    127 is the top and the new x the bottom 32 bits (with a little 
    128 fiddling when b=2^32-1 and cmwc rather than mwc.) 
    129 
    130 
    131 To generate 64-bit x's, it is difficult to form 
    132 t=a*x+c in 128 bits then get the new c and new x 
    133 from the the top and bottom halves. 
    134 But if 'a' has a special form, for example, 
    135 a=2^62+2^47+2 and b=2^64-1, then the new c and 
    136 the new x can be formed with shifts, tests and +/-'s, 
    137 again with a little fiddling because b=2^64-1 rather 
    138 than 2^64.   (The latter is not an optimal choice because, 
    139 being a square, it cannot be a primitive root of the 
    140 prime a*b^k+1, where 'k' is the 'lag': 
    141         x(n)=a*x(n-k)+carry mod b.) 
    142 But the multiplier a=2^62+2^47+2 makes a*b^4+1 a prime for 
    143 which b=2^64-1 is a primitive root, and getting  the new x and 
    144 new c  can be done with arithmetic on integers the size of x. 
    145 */ 
     110/*
     111A C version of a very very good 64-bit RNG is given below.
     112You should be able to adapt it to your particular needs.
     113
     114It is based on the complimentary-multiple-with-carry
     115sequence
     116         x(n)=a*x(n-4)+carry mod 2^64-1,
     117which works as follows:
     118Assume a certain multiplier 'a' and a base 'b'.
     119Given a current x value and a current carry 'c',
     120form:               t=a*x+c
     121Then the new carry is     c=floor(t/b)
     122and the new x value is    x = b-1-(t mod b).
     123
     124
     125Ordinarily, for 32-bit mwc or cmwc sequences, the
     126value t=a*x+c can be formed in 64 bits, then the new c
     127is the top and the new x the bottom 32 bits (with a little
     128fiddling when b=2^32-1 and cmwc rather than mwc.)
     129
     130
     131To generate 64-bit x's, it is difficult to form
     132t=a*x+c in 128 bits then get the new c and new x
     133from the the top and bottom halves.
     134But if 'a' has a special form, for example,
     135a=2^62+2^47+2 and b=2^64-1, then the new c and
     136the new x can be formed with shifts, tests and +/-'s,
     137again with a little fiddling because b=2^64-1 rather
     138than 2^64.   (The latter is not an optimal choice because,
     139being a square, it cannot be a primitive root of the
     140prime a*b^k+1, where 'k' is the 'lag':
     141        x(n)=a*x(n-k)+carry mod b.)
     142But the multiplier a=2^62+2^47+2 makes a*b^4+1 a prime for
     143which b=2^64-1 is a primitive root, and getting  the new x and
     144new c  can be done with arithmetic on integers the size of x.
     145*/
    146146
    147147struct RndCtx
     
    159159
    160160/**
    161  * Initialize seeds. 
    162  * 
     161 * Initialize seeds.
     162 *
    163163 * @remarks You should choose ANY 4 random 64-bit
    164164 * seeds x,y,z,w < 2^64-1 and a random seed c in
     
    196196RTDECL(uint64_t) RTPRandU64(PRNDCTX pCtx)
    197197{
    198     uint64_t t; 
    199     t = (pCtx->x<<47) + (pCtx->x<<62) + (pCtx->x<<1); 
    200     t += pCtx->c; t+= (t < pCtx->c); 
    201     pCtx->c = (t<pCtx->c) + (pCtx->x>>17) + (pCtx->x>>2) + (pCtx->x>>63); 
    202     pCtx->x = pCtx->y;  pCtx->y = pCtx->z ; pCtx->z = pCtx->w; 
    203     return (pCtx->w = ~(t + pCtx->c)-1); 
    204 } 
     198    uint64_t t;
     199    t = (pCtx->x<<47) + (pCtx->x<<62) + (pCtx->x<<1);
     200    t += pCtx->c; t+= (t < pCtx->c);
     201    pCtx->c = (t<pCtx->c) + (pCtx->x>>17) + (pCtx->x>>2) + (pCtx->x>>63);
     202    pCtx->x = pCtx->y;  pCtx->y = pCtx->z ; pCtx->z = pCtx->w;
     203    return (pCtx->w = ~(t + pCtx->c)-1);
     204}
    205205
    206206/**
    207  * Generate a 64-bit unsigned pseudo random number in the set 
    208  * [u64First..u64Last]. 
     207 * Generate a 64-bit unsigned pseudo random number in the set
     208 * [u64First..u64Last].
    209209 *
    210210 * @returns The pseudo random number.
     
    240240             pCtx->u32y ^= pCtx->u32y<<5,
    241241             pCtx->u32x + pCtx->u32y );
    242 } 
     242}
    243243
    244244/**
    245  * Generate a 32-bit unsigned pseudo random number in the set 
    246  * [u32First..u32Last]. 
     245 * Generate a 32-bit unsigned pseudo random number in the set
     246 * [u32First..u32Last].
    247247 *
    248248 * @returns The pseudo random number.
     
    283283    else
    284284    {
    285         RTPrintf("INFO: Random generator seed used: %x\n", RTPRandGetSeedInfo(pCtx));   
    286         RTLogPrintf("INFO: Random generator seed used: %x\n", RTPRandGetSeedInfo(pCtx));   
     285        RTPrintf("INFO: Random generator seed used: %x\n", RTPRandGetSeedInfo(pCtx));
     286        RTLogPrintf("INFO: Random generator seed used: %x\n", RTPRandGetSeedInfo(pCtx));
    287287    }
    288288}
     
    481481                          VD_IMAGE_TYPE_NORMAL, u64DiskSize,
    482482                          VD_IMAGE_FLAGS_NONE, "Test image",
    483                           &PCHS, &LCHS, VD_OPEN_FLAGS_NORMAL,
     483                          &PCHS, &LCHS, NULL, VD_OPEN_FLAGS_NORMAL,
    484484                          NULL, NULL);
    485485        CHECK("VDCreateBase()");
     
    506506
    507507    rc = VDCreateDiff(pVD, pszBackend, pszDiffFilename,
    508                       VD_IMAGE_FLAGS_NONE, "Test diff image",
     508                      VD_IMAGE_FLAGS_NONE, "Test diff image", NULL,
    509509                      VD_OPEN_FLAGS_NORMAL, NULL, NULL);
    510510    CHECK("VDCreateDiff()");
     
    587587                      VD_IMAGE_TYPE_NORMAL, u64DiskSize,
    588588                      VD_IMAGE_FLAGS_NONE, "Test image",
    589                       &PCHS, &LCHS, VD_OPEN_FLAGS_NORMAL,
     589                      &PCHS, &LCHS, NULL, VD_OPEN_FLAGS_NORMAL,
    590590                      NULL, NULL);
    591591    CHECK("VDCreateBase()");
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