VirtualBox

Changeset 97260 in vbox for trunk


Ignore:
Timestamp:
Oct 20, 2022 11:02:43 PM (2 years ago)
Author:
vboxsync
Message:

Frontends/VBoxManage+Storage/VMDK+doc/manual: 'VBoxManage createmedium
disk --Variant Rawdisk ...' neglects to use the calculated raw disk size
but instead uses the passed in value which is zero (unless --size or
--sizebyte has been specified) when creating the VMDK image and also
forgets to update the physical disk geometry (PCHS) for the VMDK image.
bugref:9224 ticketref:21125

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/en_US/man_VBoxManage-createmedium.xml

    r96407 r97260  
    154154            <listitem><para>
    155155                <literal>Split2G</literal> indicates that the disk image
    156                 is split into 2GB segments. This value is for VMDK only.
     156                is split into 2GB segments. This value is valid for VMDK
     157                disk images only.
    157158              </para></listitem>
    158159            <listitem><para>
    159160                <literal>Stream</literal> optimizes the disk image for
    160                 downloading. This value is for VMDK only.
     161                downloading. This value is valid for VMDK disk images
     162                only.
    161163              </para></listitem>
    162164            <listitem><para>
    163165                <literal>ESX</literal> is used for some VMWare products.
    164                 This value is for VMDK only.
     166                This value is valid for VMDK disk images only.
    165167              </para></listitem>
    166168            <listitem><para>
     
    171173              </para></listitem>
    172174            <listitem><para>
    173                 <literal>RawDisk</literal> used for creating raw disks.
    174                 This value is for VMDK only. For detailed information
    175                 about raw disks, see <xref linkend="adv-storage-config"/>
    176               </para><para>
     175                <literal>RawDisk</literal> is used for creating a VMDK
     176                image which provides direct access to the hard disk on
     177                the host using its raw interface. This value is valid for
     178                VMDK disk images only. For detailed information about raw
     179                disk access, see <xref linkend="adv-storage-config"/>.
    177180              </para></listitem>
    178181          </itemizedlist><para>
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp

    r96407 r97260  
    486486            }
    487487        }
     488        if ((enmMediumVariant & MediumVariant_VmdkRawDisk) && strcmp(format, "VMDK"))
     489            return errorSyntax(Disk::tr("Variant 'Rawdisk' requires '--format=VMDK'"));
    488490    }
    489491    else
     
    491493        if (   !filename
    492494            || !*filename)
    493             return errorSyntax(Disk::tr("Parameters --filename is required"));
     495            return errorSyntax(Disk::tr("Parameter --filename is required"));
    494496        size = 0;
    495497        if (cmd != CMD_DISK)
     
    596598                if (!fPropertyFound)
    597599                    return RTMsgErrorExit(RTEXITCODE_FAILURE,
    598                                           Disk::tr("The %s is not found in the property list of the requested medium format."),
    599                                           pszKey);
     600                                          Disk::tr("Property '%s' was not found in the list of medium properties for the requested medium format (%s)."),
     601                                          pszKey, format);
    600602                if (!fBinary)
    601603                    CHECK_ERROR2I_RET(pMedium, SetProperty(Bstr(pszKey).raw(), Bstr(it->m_pszValue).raw()),
  • trunk/src/VBox/Storage/VMDK.cpp

    r97255 r97260  
    50465046        if (RT_SUCCESS(rc))
    50475047        {
     5048            pImage->cbSize = cbSize;
    50485049            /*
    50495050             * Create the raw-drive descriptor
     
    57465747            rc = vmdkMakeRawDescriptor(pImage, &pRaw);
    57475748            if (RT_FAILURE(rc))
    5748                 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could get raw descriptor for '%s'"), pImage->pszFilename);
     5749                return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create raw descriptor for '%s'"),
     5750                    pImage->pszFilename);
     5751            if (!cbSize)
     5752                cbSize = pImage->cbSize;
    57495753
    57505754            rc = vmdkCreateRawImage(pImage, pRaw, cbSize);
     
    57875791                vmdkDescExtRemoveDummy(pImage, &pImage->Descriptor);
    57885792
    5789             if (   RT_SUCCESS(rc)
    5790                 && pPCHSGeometry->cCylinders != 0
    5791                 && pPCHSGeometry->cHeads != 0
    5792                 && pPCHSGeometry->cSectors != 0)
    5793                 rc = vmdkDescSetPCHSGeometry(pImage, pPCHSGeometry);
     5793            pImage->LCHSGeometry = *pLCHSGeometry;
     5794            pImage->PCHSGeometry = *pPCHSGeometry;
     5795
     5796            if (RT_SUCCESS(rc))
     5797            {
     5798                if (   pPCHSGeometry->cCylinders != 0
     5799                    && pPCHSGeometry->cHeads != 0
     5800                    && pPCHSGeometry->cSectors != 0)
     5801                    rc = vmdkDescSetPCHSGeometry(pImage, pPCHSGeometry);
     5802                else if (uImageFlags & VD_VMDK_IMAGE_FLAGS_RAWDISK)
     5803                {
     5804                    VDGEOMETRY RawDiskPCHSGeometry;
     5805                    RawDiskPCHSGeometry.cCylinders = (uint32_t)RT_MIN(pImage->cbSize / 512 / 16 / 63, 16383);
     5806                    RawDiskPCHSGeometry.cHeads = 16;
     5807                    RawDiskPCHSGeometry.cSectors = 63;
     5808                    rc = vmdkDescSetPCHSGeometry(pImage, &RawDiskPCHSGeometry);
     5809                }
     5810            }
    57945811
    57955812            if (   RT_SUCCESS(rc)
     
    57985815                && pLCHSGeometry->cSectors != 0)
    57995816                rc = vmdkDescSetLCHSGeometry(pImage, pLCHSGeometry);
    5800 
    5801             pImage->LCHSGeometry = *pLCHSGeometry;
    5802             pImage->PCHSGeometry = *pPCHSGeometry;
    58035817
    58045818            pImage->ImageUuid = *pUuid;
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