VirtualBox

Changeset 97314 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Oct 26, 2022 6:47:49 PM (2 years ago)
Author:
vboxsync
Message:

Frontends/VBoxManage: 'VBoxManage internalcommands createrawvmdk' no
longer works after the implementation was moved to the API as part of
xTracker #9224.

Follow-up build fix to address a left-behind orphaned function
(appendPartDesc()) whose only caller in VBoxInternalManage.cpp was
removed (flagged as 'defined but not used' by [-Werror=unused-function]).
Also, avoid assigning a size_t to an int which is flagged as 'possible
loss of data' by the Windows compiler.

bugref:9224 ticketref:21125

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp

    r97313 r97314  
    12821282}
    12831283
    1284 static PVDISKRAWPARTDESC appendPartDesc(uint32_t *pcPartDescs, PVDISKRAWPARTDESC *ppPartDescs)
    1285 {
    1286     (*pcPartDescs)++;
    1287     PVDISKRAWPARTDESC p;
    1288     p = (PVDISKRAWPARTDESC)RTMemRealloc(*ppPartDescs,
    1289                                           *pcPartDescs * sizeof(VDISKRAWPARTDESC));
    1290     *ppPartDescs = p;
    1291     if (p)
    1292     {
    1293         p = p + *pcPartDescs - 1;
    1294         memset(p, '\0', sizeof(VDISKRAWPARTDESC));
    1295     }
    1296 
    1297     return p;
    1298 }
    1299 
    13001284static const RTGETOPTDEF g_aCreateRawVMDKOptions[] =
    13011285{
     
    13681352    if (!papszNewArgv)
    13691353            return RTMsgErrorExit(RTEXITCODE_FAILURE, Internal::tr("Failed to allocate memory for argument array"));
    1370     size_t cArgs = 0;
     1354    int cArgs = 0;
    13711355
    13721356    papszNewArgv[cArgs++] = RTStrDup("disk");
     
    13741358    papszNewArgv[cArgs++] = RTStrDup("--format=VMDK");
    13751359
    1376     for (size_t i = 0; i < cArgs; i++)
     1360    for (int i = 0; i < cArgs; i++)
    13771361        if (!papszNewArgv[i])
    13781362            return RTMsgErrorExit(RTEXITCODE_FAILURE, Internal::tr("Failed to allocate memory for argument array"));
     
    13961380    RTEXITCODE rcExit = handleCreateMedium(a);
    13971381
    1398     for (size_t i = 0; i < cArgs; i++)
     1382    for (int i = 0; i < cArgs; i++)
    13991383        RTStrFree(papszNewArgv[i]);
    14001384    RTMemFree(papszNewArgv);
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