VirtualBox

Changeset 21556 in vbox for trunk/src


Ignore:
Timestamp:
Jul 13, 2009 5:14:42 PM (15 years ago)
Author:
vboxsync
Message:

VBoxManage/createrawvmdk: force use of devices giving access to the correct partition, and implement this for OSX. thi fixes public bug#1461

File:
1 edited

Legend:

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

    r21394 r21556  
    870870        return errorSyntax(USAGE_CREATERAWVMDK, "The parameter -mbr is only valid when the parameter -partitions is also present");
    871871
     872#ifdef RT_OS_DARWIN
     873    fRelative = true;
     874#endif /* RT_OS_DARWIN */
    872875    RTFILE RawFile;
    873876    int vrc = RTFileOpen(&RawFile, rawdisk.raw(), RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE);
     
    11091112                    char *pszRawName;
    11101113                    vrc = RTStrAPrintf(&pszRawName, "%s%u", rawdisk.raw(),
     1114                                       partitions.aPartitions[i].uIndex);
     1115                    if (RT_FAILURE(vrc))
     1116                    {
     1117                        RTPrintf("Error creating reference to individual partition %u, rc=%Rrc\n",
     1118                                 partitions.aPartitions[i].uIndex, vrc);
     1119                        goto out;
     1120                    }
     1121                    RawDescriptor.pPartitions[i].pszRawDevice = pszRawName;
     1122                    RawDescriptor.pPartitions[i].uPartitionStartOffset = 0;
     1123                    RawDescriptor.pPartitions[i].uPartitionStart = partitions.aPartitions[i].uStart * 512;
     1124#elif defined(RT_OS_DARWIN)
     1125                    /* Refer to the correct partition and use offset 0. */
     1126                    char *pszRawName;
     1127                    vrc = RTStrAPrintf(&pszRawName, "%ss%u", rawdisk.raw(),
    11111128                                       partitions.aPartitions[i].uIndex);
    11121129                    if (RT_FAILURE(vrc))
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