VirtualBox

Changeset 16867 in vbox for trunk


Ignore:
Timestamp:
Feb 17, 2009 5:00:56 PM (16 years ago)
Author:
vboxsync
Message:

Main: rename IHardDiskImage2 to IHardDiskImage; rename IFloppyImage2 to IFloppyImage; rename all media-related methods with a '2' suffix

Location:
trunk/src/VBox
Files:
41 edited
1 moved

Legend:

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

    r16530 r16867  
    12481248    if (fRegister)
    12491249    {
    1250         ComPtr<IHardDisk2> hardDisk;
    1251         CHECK_ERROR(aVirtualBox, OpenHardDisk2(filename, hardDisk.asOutParam()));
     1250        ComPtr<IHardDisk> hardDisk;
     1251        CHECK_ERROR(aVirtualBox, OpenHardDisk(filename, hardDisk.asOutParam()));
    12521252    }
    12531253
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r16853 r16867  
    14141414                /* first assume it's a UUID */
    14151415                Guid uuid(a->argv[2]);
    1416                 ComPtr<IFloppyImage2> floppyImage;
     1416                ComPtr<IFloppyImage> floppyImage;
    14171417                rc = a->virtualBox->GetFloppyImage(uuid, floppyImage.asOutParam());
    14181418                if (FAILED(rc) || !floppyImage)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp

    r16853 r16867  
    122122        return errorArgument("Invalid hard disk type '%s' specified", Utf8Str(type).raw());
    123123
    124     ComPtr<IHardDisk2> hardDisk;
    125     CHECK_ERROR(a->virtualBox, CreateHardDisk2(format, filename, hardDisk.asOutParam()));
     124    ComPtr<IHardDisk> hardDisk;
     125    CHECK_ERROR(a->virtualBox, CreateHardDisk(format, filename, hardDisk.asOutParam()));
    126126    if (SUCCEEDED(rc) && hardDisk)
    127127    {
     
    215215        return errorSyntax(USAGE_MODIFYHD, "Incorrect number of parameters");
    216216
    217     ComPtr<IHardDisk2> hardDisk;
     217    ComPtr<IHardDisk> hardDisk;
    218218    Bstr filepath;
    219219
    220220    /* first guess is that it's a UUID */
    221221    Guid uuid(a->argv[0]);
    222     rc = a->virtualBox->GetHardDisk2(uuid, hardDisk.asOutParam());
     222    rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    223223    /* no? then it must be a filename */
    224224    if (!hardDisk)
    225225    {
    226226        filepath = a->argv[0];
    227         CHECK_ERROR(a->virtualBox, FindHardDisk2(filepath, hardDisk.asOutParam()));
     227        CHECK_ERROR(a->virtualBox, FindHardDisk(filepath, hardDisk.asOutParam()));
    228228    }
    229229
     
    277277        if (!hardDisk)
    278278        {
    279             a->virtualBox->OpenHardDisk2(Bstr(a->argv[0]), hardDisk.asOutParam());
     279            a->virtualBox->OpenHardDisk(Bstr(a->argv[0]), hardDisk.asOutParam());
    280280            if (!hardDisk)
    281281                return errorArgument("Hard disk image not found");
     
    354354        return errorSyntax(USAGE_CLONEHD, "Mandatory output file parameter missing");
    355355
    356     ComPtr<IHardDisk2> srcDisk;
    357     ComPtr<IHardDisk2> dstDisk;
     356    ComPtr<IHardDisk> srcDisk;
     357    ComPtr<IHardDisk> dstDisk;
    358358    bool unknown = false;
    359359
    360360    /* first guess is that it's a UUID */
    361361    Guid uuid(Utf8Str(src).raw());
    362     rc = a->virtualBox->GetHardDisk2(uuid, srcDisk.asOutParam());
     362    rc = a->virtualBox->GetHardDisk(uuid, srcDisk.asOutParam());
    363363    /* no? then it must be a filename */
    364364    if (FAILED (rc))
    365365    {
    366         rc = a->virtualBox->FindHardDisk2(src, srcDisk.asOutParam());
     366        rc = a->virtualBox->FindHardDisk(src, srcDisk.asOutParam());
    367367        /* no? well, then it's an unkwnown image */
    368368        if (FAILED (rc))
    369369        {
    370             CHECK_ERROR(a->virtualBox, OpenHardDisk2(src, srcDisk.asOutParam()));
     370            CHECK_ERROR(a->virtualBox, OpenHardDisk(src, srcDisk.asOutParam()));
    371371            if (SUCCEEDED (rc))
    372372            {
     
    387387        }
    388388
    389         CHECK_ERROR_BREAK(a->virtualBox, CreateHardDisk2(format, dst, dstDisk.asOutParam()));
     389        CHECK_ERROR_BREAK(a->virtualBox, CreateHardDisk(format, dst, dstDisk.asOutParam()));
    390390
    391391        ComPtr<IProgress> progress;
     
    679679    do
    680680    {
    681         ComPtr<IHardDisk2> hardDisk;
     681        ComPtr<IHardDisk> hardDisk;
    682682        CHECK_ERROR_BREAK (a->virtualBox,
    683             CreateHardDisk2(Bstr ("iSCSI"),
    684                             BstrFmt ("%ls/%ls", server.raw(), target.raw()),
    685                             hardDisk.asOutParam()));
     683            CreateHardDisk(Bstr ("iSCSI"),
     684                           BstrFmt ("%ls/%ls", server.raw(), target.raw()),
     685                           hardDisk.asOutParam()));
    686686        CheckComRCBreakRC (rc);
    687687
     
    749749        return errorSyntax(USAGE_SHOWHDINFO, "Incorrect number of parameters");
    750750
    751     ComPtr<IHardDisk2> hardDisk;
     751    ComPtr<IHardDisk> hardDisk;
    752752    Bstr filepath;
    753753
     
    756756    /* first guess is that it's a UUID */
    757757    Guid uuid(a->argv[0]);
    758     rc = a->virtualBox->GetHardDisk2(uuid, hardDisk.asOutParam());
     758    rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    759759    /* no? then it must be a filename */
    760760    if (FAILED (rc))
    761761    {
    762762        filepath = a->argv[0];
    763         rc = a->virtualBox->FindHardDisk2(filepath, hardDisk.asOutParam());
     763        rc = a->virtualBox->FindHardDisk(filepath, hardDisk.asOutParam());
    764764        /* no? well, then it's an unkwnown image */
    765765        if (FAILED (rc))
    766766        {
    767             CHECK_ERROR(a->virtualBox, OpenHardDisk2(filepath, hardDisk.asOutParam()));
     767            CHECK_ERROR(a->virtualBox, OpenHardDisk(filepath, hardDisk.asOutParam()));
    768768            if (SUCCEEDED (rc))
    769769            {
     
    891891        }
    892892
    893         ComPtr<IHardDisk2> hardDisk;
    894         CHECK_ERROR(a->virtualBox, OpenHardDisk2(filepath, hardDisk.asOutParam()));
     893        ComPtr<IHardDisk> hardDisk;
     894        CHECK_ERROR(a->virtualBox, OpenHardDisk(filepath, hardDisk.asOutParam()));
    895895        if (SUCCEEDED(rc) && hardDisk)
    896896        {
     
    914914    else if (strcmp(a->argv[0], "floppy") == 0)
    915915    {
    916         ComPtr<IFloppyImage2> floppyImage;
     916        ComPtr<IFloppyImage> floppyImage;
    917917        CHECK_ERROR(a->virtualBox, OpenFloppyImage(filepath, Guid(), floppyImage.asOutParam()));
    918918    }
     
    935935    if (strcmp(a->argv[0], "disk") == 0)
    936936    {
    937         ComPtr<IHardDisk2> hardDisk;
    938         rc = a->virtualBox->GetHardDisk2(uuid, hardDisk.asOutParam());
     937        ComPtr<IHardDisk> hardDisk;
     938        rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    939939        /* not a UUID or not registered? Then it must be a filename */
    940940        if (!hardDisk)
    941941        {
    942             CHECK_ERROR(a->virtualBox, FindHardDisk2(Bstr(a->argv[1]), hardDisk.asOutParam()));
     942            CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(a->argv[1]), hardDisk.asOutParam()));
    943943        }
    944944        if (SUCCEEDED(rc) && hardDisk)
     
    965965    if (strcmp(a->argv[0], "floppy") == 0)
    966966    {
    967         ComPtr<IFloppyImage2> floppyImage;
     967        ComPtr<IFloppyImage> floppyImage;
    968968        rc = a->virtualBox->GetFloppyImage(uuid, floppyImage.asOutParam());
    969969        /* not a UUID or not registered? Then it must be a filename */
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r16853 r16867  
    384384                case DriveState_ImageMounted:
    385385                {
    386                     ComPtr<IFloppyImage2> floppyImage;
     386                    ComPtr<IFloppyImage> floppyImage;
    387387                    rc = floppyDrive->GetImage(floppyImage.asOutParam());
    388388                    if (SUCCEEDED(rc) && floppyImage)
     
    461461    if (fSataEnabled)
    462462    {
    463         ComPtr<IHardDisk2> hardDisk;
     463        ComPtr<IHardDisk> hardDisk;
    464464        Bstr  filePath;
    465465        ULONG cSataPorts;
     
    468468        for (ULONG i = 0; i < cSataPorts; ++ i)
    469469        {
    470             rc = machine->GetHardDisk2(StorageBus_SATA, i, 0, hardDisk.asOutParam());
     470            rc = machine->GetHardDisk(StorageBus_SATA, i, 0, hardDisk.asOutParam());
    471471            if (SUCCEEDED(rc) && hardDisk)
    472472            {
     
    512512        RTPrintf("IDE Controller:  %s\n", pszIdeController);
    513513
    514     ComPtr<IHardDisk2> hardDisk;
     514    ComPtr<IHardDisk> hardDisk;
    515515    Bstr filePath;
    516     rc = machine->GetHardDisk2(StorageBus_IDE, 0, 0, hardDisk.asOutParam());
     516    rc = machine->GetHardDisk(StorageBus_IDE, 0, 0, hardDisk.asOutParam());
    517517    if (SUCCEEDED(rc) && hardDisk)
    518518    {
     
    532532            RTPrintf("hda=\"none\"\n");
    533533    }
    534     rc = machine->GetHardDisk2(StorageBus_IDE, 0, 1, hardDisk.asOutParam());
     534    rc = machine->GetHardDisk(StorageBus_IDE, 0, 1, hardDisk.asOutParam());
    535535    if (SUCCEEDED(rc) && hardDisk)
    536536    {
     
    550550            RTPrintf("hdb=\"none\"\n");
    551551    }
    552     rc = machine->GetHardDisk2(StorageBus_IDE, 1, 1, hardDisk.asOutParam());
     552    rc = machine->GetHardDisk(StorageBus_IDE, 1, 1, hardDisk.asOutParam());
    553553    if (SUCCEEDED(rc) && hardDisk)
    554554    {
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp

    r16853 r16867  
    389389    if (strcmp(a->argv[0], "hdds") == 0)
    390390    {
    391         com::SafeIfaceArray <IHardDisk2> hdds;
    392         CHECK_ERROR(a->virtualBox, COMGETTER(HardDisks2)(ComSafeArrayAsOutParam (hdds)));
     391        com::SafeIfaceArray<IHardDisk> hdds;
     392        CHECK_ERROR(a->virtualBox, COMGETTER(HardDisks)(ComSafeArrayAsOutParam (hdds)));
    393393        for (size_t i = 0; i < hdds.size(); ++ i)
    394394        {
    395             ComPtr<IHardDisk2> hdd = hdds[i];
     395            ComPtr<IHardDisk> hdd = hdds[i];
    396396            Guid uuid;
    397397            hdd->COMGETTER(Id)(uuid.asOutParam());
     
    452452    if (strcmp(a->argv[0], "floppies") == 0)
    453453    {
    454         com::SafeIfaceArray<IFloppyImage2> floppies;
     454        com::SafeIfaceArray<IFloppyImage> floppies;
    455455        CHECK_ERROR(a->virtualBox, COMGETTER(FloppyImages)(ComSafeArrayAsOutParam(floppies)));
    456456        for (size_t i = 0; i < floppies.size(); ++ i)
    457457        {
    458             ComPtr<IFloppyImage2> floppyImage = floppies[i];
     458            ComPtr<IFloppyImage> floppyImage = floppies[i];
    459459            Guid uuid;
    460460            floppyImage->COMGETTER(Id)(uuid.asOutParam());
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r16853 r16867  
    980980            if (strcmp(hdds[0], "none") == 0)
    981981            {
    982                 machine->DetachHardDisk2(StorageBus_IDE, 0, 0);
     982                machine->DetachHardDisk(StorageBus_IDE, 0, 0);
    983983            }
    984984            else
     
    986986                /* first guess is that it's a UUID */
    987987                Guid uuid(hdds[0]);
    988                 ComPtr<IHardDisk2> hardDisk;
    989                 rc = a->virtualBox->GetHardDisk2(uuid, hardDisk.asOutParam());
     988                ComPtr<IHardDisk> hardDisk;
     989                rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    990990                /* not successful? Then it must be a filename */
    991991                if (!hardDisk)
    992992                {
    993                     CHECK_ERROR(a->virtualBox, FindHardDisk2(Bstr(hdds[0]), hardDisk.asOutParam()));
     993                    CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[0]), hardDisk.asOutParam()));
    994994                    if (FAILED(rc))
    995995                    {
    996996                        /* open the new hard disk object */
    997                         CHECK_ERROR(a->virtualBox, OpenHardDisk2(Bstr(hdds[0]), hardDisk.asOutParam()));
     997                        CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[0]), hardDisk.asOutParam()));
    998998                    }
    999999                }
     
    10011001                {
    10021002                    hardDisk->COMGETTER(Id)(uuid.asOutParam());
    1003                     CHECK_ERROR(machine, AttachHardDisk2(uuid, StorageBus_IDE, 0, 0));
     1003                    CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 0, 0));
    10041004                }
    10051005                else
     
    10131013            if (strcmp(hdds[1], "none") == 0)
    10141014            {
    1015                 machine->DetachHardDisk2(StorageBus_IDE, 0, 1);
     1015                machine->DetachHardDisk(StorageBus_IDE, 0, 1);
    10161016            }
    10171017            else
     
    10191019                /* first guess is that it's a UUID */
    10201020                Guid uuid(hdds[1]);
    1021                 ComPtr<IHardDisk2> hardDisk;
    1022                 rc = a->virtualBox->GetHardDisk2(uuid, hardDisk.asOutParam());
     1021                ComPtr<IHardDisk> hardDisk;
     1022                rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    10231023                /* not successful? Then it must be a filename */
    10241024                if (!hardDisk)
    10251025                {
    1026                     CHECK_ERROR(a->virtualBox, FindHardDisk2(Bstr(hdds[1]), hardDisk.asOutParam()));
     1026                    CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[1]), hardDisk.asOutParam()));
    10271027                    if (FAILED(rc))
    10281028                    {
    10291029                        /* open the new hard disk object */
    1030                         CHECK_ERROR(a->virtualBox, OpenHardDisk2(Bstr(hdds[1]), hardDisk.asOutParam()));
     1030                        CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[1]), hardDisk.asOutParam()));
    10311031                    }
    10321032                }
     
    10341034                {
    10351035                    hardDisk->COMGETTER(Id)(uuid.asOutParam());
    1036                     CHECK_ERROR(machine, AttachHardDisk2(uuid, StorageBus_IDE, 0, 1));
     1036                    CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 0, 1));
    10371037                }
    10381038                else
     
    10461046            if (strcmp(hdds[2], "none") == 0)
    10471047            {
    1048                 machine->DetachHardDisk2(StorageBus_IDE, 1, 1);
     1048                machine->DetachHardDisk(StorageBus_IDE, 1, 1);
    10491049            }
    10501050            else
     
    10521052                /* first guess is that it's a UUID */
    10531053                Guid uuid(hdds[2]);
    1054                 ComPtr<IHardDisk2> hardDisk;
    1055                 rc = a->virtualBox->GetHardDisk2(uuid, hardDisk.asOutParam());
     1054                ComPtr<IHardDisk> hardDisk;
     1055                rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    10561056                /* not successful? Then it must be a filename */
    10571057                if (!hardDisk)
    10581058                {
    1059                     CHECK_ERROR(a->virtualBox, FindHardDisk2(Bstr(hdds[2]), hardDisk.asOutParam()));
     1059                    CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[2]), hardDisk.asOutParam()));
    10601060                    if (FAILED(rc))
    10611061                    {
    10621062                        /* open the new hard disk object */
    1063                         CHECK_ERROR(a->virtualBox, OpenHardDisk2(Bstr(hdds[2]), hardDisk.asOutParam()));
     1063                        CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[2]), hardDisk.asOutParam()));
    10641064                    }
    10651065                }
     
    10671067                {
    10681068                    hardDisk->COMGETTER(Id)(uuid.asOutParam());
    1069                     CHECK_ERROR(machine, AttachHardDisk2(uuid, StorageBus_IDE, 1, 1));
     1069                    CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 1, 1));
    10701070                }
    10711071                else
     
    12101210                    /* first assume it's a UUID */
    12111211                    Guid uuid(floppy);
    1212                     ComPtr<IFloppyImage2> floppyImage;
     1212                    ComPtr<IFloppyImage> floppyImage;
    12131213                    rc = a->virtualBox->GetFloppyImage(uuid, floppyImage.asOutParam());
    12141214                    if (FAILED(rc) || !floppyImage)
     
    17471747                if (strcmp(hdds[i], "none") == 0)
    17481748                {
    1749                     machine->DetachHardDisk2(StorageBus_SATA, i-4, 0);
     1749                    machine->DetachHardDisk(StorageBus_SATA, i-4, 0);
    17501750                }
    17511751                else
     
    17531753                    /* first guess is that it's a UUID */
    17541754                    Guid uuid(hdds[i]);
    1755                     ComPtr<IHardDisk2> hardDisk;
    1756                     rc = a->virtualBox->GetHardDisk2(uuid, hardDisk.asOutParam());
     1755                    ComPtr<IHardDisk> hardDisk;
     1756                    rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    17571757                    /* not successful? Then it must be a filename */
    17581758                    if (!hardDisk)
    17591759                    {
    1760                         CHECK_ERROR(a->virtualBox, FindHardDisk2(Bstr(hdds[i]), hardDisk.asOutParam()));
     1760                        CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[i]), hardDisk.asOutParam()));
    17611761                        if (FAILED(rc))
    17621762                        {
    17631763                            /* open the new hard disk object */
    1764                             CHECK_ERROR(a->virtualBox, OpenHardDisk2(Bstr(hdds[i]), hardDisk.asOutParam()));
     1764                            CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[i]), hardDisk.asOutParam()));
    17651765                        }
    17661766                    }
     
    17681768                    {
    17691769                        hardDisk->COMGETTER(Id)(uuid.asOutParam());
    1770                         CHECK_ERROR(machine, AttachHardDisk2(uuid, StorageBus_SATA, i-4, 0));
     1770                        CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_SATA, i-4, 0));
    17711771                    }
    17721772                    else
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r16853 r16867  
    16591659         */
    16601660        Bstr hdaFileBstr = hdaFile;
    1661         ComPtr<IHardDisk2> hardDisk;
    1662         virtualBox->FindHardDisk2(hdaFileBstr, hardDisk.asOutParam());
     1661        ComPtr<IHardDisk> hardDisk;
     1662        virtualBox->FindHardDisk(hdaFileBstr, hardDisk.asOutParam());
    16631663        if (!hardDisk)
    16641664        {
    16651665            /* we've not found the image */
    16661666            RTPrintf("Adding hard disk '%S'...\n", hdaFile);
    1667             virtualBox->OpenHardDisk2 (hdaFileBstr, hardDisk.asOutParam());
     1667            virtualBox->OpenHardDisk(hdaFileBstr, hardDisk.asOutParam());
    16681668        }
    16691669        /* do we have the right image now? */
     
    16751675            Guid uuid;
    16761676            hardDisk->COMGETTER(Id)(uuid.asOutParam());
    1677             gMachine->DetachHardDisk2(StorageBus_IDE, 0, 0);
    1678             gMachine->AttachHardDisk2(uuid, StorageBus_IDE, 0, 0);
     1677            gMachine->DetachHardDisk(StorageBus_IDE, 0, 0);
     1678            gMachine->AttachHardDisk(uuid, StorageBus_IDE, 0, 0);
    16791679            /// @todo why is this attachment saved?
    16801680        }
     
    17261726        {
    17271727            /* try to find an existing one */
    1728             ComPtr <IFloppyImage2> image;
     1728            ComPtr<IFloppyImage> image;
    17291729            rc = virtualBox->FindFloppyImage (medium, image.asOutParam());
    17301730            if (FAILED (rc))
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h

    r16853 r16867  
    146146    }
    147147
    148     const CHardDisk2 &hardDisk() const { return mHardDisk; }
     148    const CHardDisk &hardDisk() const { return mHardDisk; }
    149149    const CDVDImage &dvdImage() const { return mDVDImage; }
    150     const CFloppyImage2 &floppyImage() const { return mFloppyImage; }
     150    const CFloppyImage &floppyImage() const { return mFloppyImage; }
    151151
    152152    QUuid id() const { return mId; }
     
    246246    COMResult mResult;
    247247
    248     CHardDisk2 mHardDisk;
     248    CHardDisk mHardDisk;
    249249    CDVDImage mDVDImage;
    250     CFloppyImage2 mFloppyImage;
     250    CFloppyImage mFloppyImage;
    251251
    252252    QUuid mId;
     
    613613     * normal hard disks that have a parent.
    614614     */
    615     QString hardDiskTypeString (const CHardDisk2 &aHD) const
     615    QString hardDiskTypeString (const CHardDisk &aHD) const
    616616    {
    617617        if (!aHD.GetParent().isNull())
     
    799799    /* details generators */
    800800
    801     QString details (const CHardDisk2 &aHD, bool aPredictDiff);
     801    QString details (const CHardDisk &aHD, bool aPredictDiff);
    802802
    803803    QString details (const CUSBDevice &aDevice) const;
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxNewHDWzd.h

    r13580 r16867  
    3939    VBoxNewHDWzd (QWidget *aParent = 0);
    4040
    41     CHardDisk2 hardDisk() { return mHD; }
     41    CHardDisk hardDisk() { return mHD; }
    4242    void setRecommendedFileName (const QString &aName);
    4343    void setRecommendedSize (quint64 aSize);
     
    6666
    6767    QIWidgetValidator *mWValNameAndSize;
    68     CHardDisk2         mHD;
     68    CHardDisk          mHD;
    6969    int                mSliderScale;
    7070    quint64            mMaxVDISize;
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxNewVMWzd.h

    r14437 r16867  
    6767    QIWidgetValidator *mWvalMemory;
    6868    QIWidgetValidator *mWvalHDD;
    69     CHardDisk2 mHardDisk;
     69    CHardDisk mHardDisk;
    7070    CMachine mMachine;
    7171};
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r16617 r16867  
    264264    int confirmDeleteHardDiskStorage (QWidget *aParent,
    265265                                      const QString &aLocation);
    266     void cannotDeleteHardDiskStorage (QWidget *aParent, const CHardDisk2 &aHD,
     266    void cannotDeleteHardDiskStorage (QWidget *aParent, const CHardDisk &aHD,
    267267                                      const CProgress &aProgress);
    268268
     
    272272    void cannotCreateHardDiskStorage (QWidget *aParent, const CVirtualBox &aVBox,
    273273                                      const QString &aLocaiton,
    274                                       const CHardDisk2 &aHD,
     274                                      const CHardDisk &aHD,
    275275                                      const CProgress &aProgress);
    276276    void cannotAttachHardDisk (QWidget *aParent, const CMachine &aMachine,
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r16853 r16867  
    19171917        QString data;
    19181918        bool hasDisks = false;
    1919         CHardDisk2AttachmentVector vec = cmachine.GetHardDisk2Attachments();
    1920         for (CHardDisk2AttachmentVector::ConstIterator hda = vec.begin();
     1919        CHardDiskAttachmentVector vec = cmachine.GetHardDiskAttachments();
     1920        for (CHardDiskAttachmentVector::ConstIterator hda = vec.begin();
    19211921             hda != vec.end(); ++ hda)
    19221922        {
    1923             CHardDisk2 hd = hda->GetHardDisk();
     1923            CHardDisk hd = hda->GetHardDisk();
    19241924            data += QString ("<br><nobr><b>%1 %2</b>: %3</nobr>")
    19251925                .arg (vboxGlobal().toString (hda->GetBus(), hda->GetChannel()))
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r16853 r16867  
    219219         * to an item from VBoxGlobal::currentMediaList()) */
    220220
    221         CHardDisk2 parent = mHardDisk.GetParent();
     221        CHardDisk parent = mHardDisk.GetParent();
    222222        Assert (!parent.isNull() || mParent == NULL);
    223223
     
    19381938 *       @todo in VBoxMedium::details()).
    19391939 */
    1940 QString VBoxGlobal::details (const CHardDisk2 &aHD,
     1940QString VBoxGlobal::details (const CHardDisk &aHD,
    19411941                             bool aPredictDiff)
    19421942{
     
    21612161        int rows = 2; /* including section header and footer */
    21622162
    2163         CHardDisk2AttachmentVector vec = aMachine.GetHardDisk2Attachments();
     2163        CHardDiskAttachmentVector vec = aMachine.GetHardDiskAttachments();
    21642164        for (size_t i = 0; i < (size_t) vec.size(); ++ i)
    21652165        {
    2166             CHardDisk2Attachment hda = vec [i];
    2167             CHardDisk2 hd = hda.GetHardDisk();
     2166            CHardDiskAttachment hda = vec [i];
     2167            CHardDisk hd = hda.GetHardDisk();
    21682168
    21692169            /// @todo for the explaination of the below isOk() checks, see ***
     
    23322332            case KDriveState_ImageMounted:
    23332333            {
    2334                 CFloppyImage2 img = floppy.GetImage();
     2334                CFloppyImage img = floppy.GetImage();
    23352335                item = QString (sSectionItemTpl2)
    23362336                    .arg (tr ("Image", "details report (floppy)"),
     
    29152915 */
    29162916static
    2917 void AddHardDisksToList (const CHardDisk2Vector &aVector,
     2917void AddHardDisksToList (const CHardDiskVector &aVector,
    29182918                         VBoxMediaList &aList,
    29192919                         VBoxMediaList::iterator aWhere,
     
    29232923
    29242924    /* First pass: Add siblings sorted */
    2925     for (CHardDisk2Vector::ConstIterator it = aVector.begin();
     2925    for (CHardDiskVector::ConstIterator it = aVector.begin();
    29262926         it != aVector.end(); ++ it)
    29272927    {
     
    29452945    for (VBoxMediaList::iterator it = first; it != aWhere;)
    29462946    {
    2947         CHardDisk2Vector children = (*it).hardDisk().GetChildren();
     2947        CHardDiskVector children = (*it).hardDisk().GetChildren();
    29482948        VBoxMedium *parent = &(*it);
    29492949
     
    29972997    mMediaList.clear();
    29982998    {
    2999         AddHardDisksToList (mVBox.GetHardDisks2(), mMediaList, mMediaList.end());
     2999        AddHardDisksToList (mVBox.GetHardDisks(), mMediaList, mMediaList.end());
    30003000    }
    30013001    {
     
    30253025        VBoxMediaList::iterator first = mMediaList.end();
    30263026
    3027         CFloppyImage2Vector vec = mVBox.GetFloppyImages();
    3028         for (CFloppyImage2Vector::ConstIterator it = vec.begin();
     3027        CFloppyImageVector vec = mVBox.GetFloppyImages();
     3028        for (CFloppyImageVector::ConstIterator it = vec.begin();
    30293029             it != vec.end(); ++ it)
    30303030        {
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp

    r16853 r16867  
    972972    if (dlg.exec() == QDialog::Accepted)
    973973    {
    974         CHardDisk2 hd = dlg.hardDisk();
     974        CHardDisk hd = dlg.hardDisk();
    975975        /* Select the newly created hard disk */
    976976        MediaItem *item = searchItem (mHardDiskView, hd.GetId());
     
    10941094            }
    10951095
    1096             CHardDisk2 hardDisk = item->medium().hardDisk();
     1096            CHardDisk hardDisk = item->medium().hardDisk();
    10971097
    10981098            if (deleteStorage)
     
    11341134        case VBoxDefs::MediaType_Floppy:
    11351135        {
    1136             CFloppyImage2 image = item->medium().floppyImage();
     1136            CFloppyImage image = item->medium().floppyImage();
    11371137            image.Close();
    11381138            result = image;
     
    12321232        case VBoxDefs::MediaType_HardDisk:
    12331233        {
    1234             CHardDisk2AttachmentVector vec =machine.GetHardDisk2Attachments();
     1234            CHardDiskAttachmentVector vec =machine.GetHardDiskAttachments();
    12351235            for (int i = 0; i < vec.size(); ++ i)
    12361236            {
    1237                 CHardDisk2Attachment hda = vec [i];
     1237                CHardDiskAttachment hda = vec [i];
    12381238                if (hda.GetHardDisk().GetId() == aMedium.id())
    12391239                {
    1240                     machine.DetachHardDisk2 (hda.GetBus(),
    1241                                              hda.GetChannel(),
    1242                                              hda.GetDevice());
     1240                    machine.DetachHardDisk(hda.GetBus(),
     1241                                           hda.GetChannel(),
     1242                                           hda.GetDevice());
    12431243                    if (!machine.isOk())
    12441244                    {
     
    15431543        case VBoxDefs::MediaType_HardDisk:
    15441544        {
    1545             CHardDisk2 hd = mVBox.OpenHardDisk2 (aLocation);
     1545            CHardDisk hd = mVBox.OpenHardDisk(aLocation);
    15461546            if (mVBox.isOk())
    15471547            {
     
    15651565        case VBoxDefs::MediaType_Floppy:
    15661566        {
    1567             CFloppyImage2 image = mVBox.OpenFloppyImage (aLocation, uuid);
     1567            CFloppyImage image = mVBox.OpenFloppyImage (aLocation, uuid);
    15681568            if (mVBox.isOk())
    15691569            {
     
    15911591    MediaItem *item = 0;
    15921592
    1593     CHardDisk2 parent = aMedium.hardDisk().GetParent();
     1593    CHardDisk parent = aMedium.hardDisk().GetParent();
    15941594    if (parent.isNull())
    15951595    {
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxNewHDWzd.cpp

    r14540 r16867  
    384384    CProgress progress;
    385385
    386     CHardDisk2 hd = vbox.CreateHardDisk2 (QString ("VDI"), loc);
     386    CHardDisk hd = vbox.CreateHardDisk(QString ("VDI"), loc);
    387387
    388388    if (!vbox.isOk())
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxNewVMWzd.cpp

    r16633 r16867  
    352352        {
    353353            CMachine m = session.GetMachine();
    354             m.AttachHardDisk2 (mHDCombo->id(), KStorageBus_IDE, 0, 0);
     354            m.AttachHardDisk(mHDCombo->id(), KStorageBus_IDE, 0, 0);
    355355            if (m.isOk())
    356356            {
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r16656 r16867  
    12031203
    12041204void VBoxProblemReporter::cannotDeleteHardDiskStorage (QWidget *aParent,
    1205                                                        const CHardDisk2 &aHD,
     1205                                                       const CHardDisk &aHD,
    12061206                                                       const CProgress &aProgress)
    12071207{
    1208     /* below, we use CHardDisk2 (aHD) to preserve current error info
     1208    /* below, we use CHardDisk (aHD) to preserve current error info
    12091209     * for formatErrorInfo() */
    12101210
    12111211    message (aParent, Error,
    12121212        tr ("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    1213             .arg (CHardDisk2 (aHD).GetLocation()),
     1213            .arg (CHardDisk (aHD).GetLocation()),
    12141214        !aHD.isOk() ? formatErrorInfo (aHD) :
    12151215        !aProgress.isOk() ? formatErrorInfo (aProgress) :
     
    12481248void VBoxProblemReporter::cannotCreateHardDiskStorage (
    12491249    QWidget *aParent, const CVirtualBox &aVBox, const QString &aLocation,
    1250     const CHardDisk2 &aHD, const CProgress &aProgress)
     1250    const CHardDisk &aHD, const CProgress &aProgress)
    12511251{
    12521252    message (aParent, Error,
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp

    r16743 r16867  
    872872            CMachine machine = session.GetMachine();
    873873            /* Detach all attached Hard Disks */
    874             CHardDisk2AttachmentVector vec = machine.GetHardDisk2Attachments();
     874            CHardDiskAttachmentVector vec = machine.GetHardDiskAttachments();
    875875            for (int i = 0; i < vec.size(); ++ i)
    876876            {
    877                 CHardDisk2Attachment hda = vec [i];
    878                 machine.DetachHardDisk2 (hda.GetBus(), hda.GetChannel(), hda.GetDevice());
     877                CHardDiskAttachment hda = vec [i];
     878                machine.DetachHardDisk(hda.GetBus(), hda.GetChannel(), hda.GetDevice());
    879879                if (!machine.isOk())
    880880                    vboxProblem().cannotDetachHardDisk (this, machine,
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMFirstRunWzd.cpp

    r13580 r16867  
    3636
    3737    /* Hide unnecessary text labels */
    38     CHardDisk2AttachmentVector vec = mMachine.GetHardDisk2Attachments();
     38    CHardDiskAttachmentVector vec = mMachine.GetHardDiskAttachments();
    3939    if (vec.size() != 0)
    4040    {
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp

    r16087 r16867  
    467467
    468468        /* IDE Hard Disk (Primary Master) */
    469         if (!m.GetHardDisk2 (KStorageBus_IDE, 0, 0).isNull())
     469        if (!m.GetHardDisk(KStorageBus_IDE, 0, 0).isNull())
    470470        {
    471471            hdStat += formatHardDisk (KStorageBus_IDE, 0, 0, "IDE00");
     
    474474
    475475        /* IDE Hard Disk (Primary Slave) */
    476         if (!m.GetHardDisk2 (KStorageBus_IDE, 0, 1).isNull())
     476        if (!m.GetHardDisk(KStorageBus_IDE, 0, 1).isNull())
    477477        {
    478478            hdStat += formatHardDisk (KStorageBus_IDE, 0, 1, "IDE01");
     
    481481
    482482        /* IDE Hard Disk (Secondary Slave) */
    483         if (!m.GetHardDisk2 (KStorageBus_IDE, 1, 1).isNull())
     483        if (!m.GetHardDisk(KStorageBus_IDE, 1, 1).isNull())
    484484        {
    485485            hdStat += formatHardDisk (KStorageBus_IDE, 1, 1, "IDE11");
     
    490490        for (int i = 0; i < 30; ++ i)
    491491        {
    492             if (!m.GetHardDisk2 (KStorageBus_SATA, i, 0).isNull())
     492            if (!m.GetHardDisk(KStorageBus_SATA, i, 0).isNull())
    493493            {
    494494                hdStat += formatHardDisk (KStorageBus_SATA, i, 0,
     
    574574        return QString::null;
    575575
    576     CHardDisk2 hd = mSession.GetMachine().GetHardDisk2 (aBus, aChannel, aDevice);
     576    CHardDisk hd = mSession.GetMachine().GetHardDisk(aBus, aChannel, aDevice);
    577577    QString header = "<tr><td></td><td colspan=2><nobr><u>%1</u></nobr></td></tr>";
    578578    QString name = vboxGlobal().toFullString (aBus, aChannel, aDevice);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsFD.cpp

    r14039 r16867  
    110110        case KDriveState_ImageMounted:
    111111        {
    112             CFloppyImage2 img = floppy.GetImage();
     112            CFloppyImage img = floppy.GetImage();
    113113            QString src = img.GetLocation();
    114114            AssertMsg (!src.isNull(), ("Image file must not be null"));
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp

    r13580 r16867  
    7777
    7878    VBoxMedium medium = vboxGlobal().getMedium (
    79         CMedium (vboxGlobal().virtualBox().GetHardDisk2 (aId)));
     79        CMedium (vboxGlobal().virtualBox().GetHardDisk(aId)));
    8080    medium.refresh();
    8181    bool noDiffs = !HDSettings::instance()->showDiffs();
     
    662662
    663663    /* Load attachments list */
    664     CHardDisk2AttachmentVector vec = mMachine.GetHardDisk2Attachments();
     664    CHardDiskAttachmentVector vec = mMachine.GetHardDiskAttachments();
    665665    for (int i = 0; i < vec.size(); ++ i)
    666666    {
    667         CHardDisk2Attachment hda = vec [i];
     667        CHardDiskAttachment hda = vec [i];
    668668        SlotValue slot (hda.GetBus(), hda.GetChannel(), hda.GetDevice());
    669669        DiskValue disk (hda.GetHardDisk().GetId());
     
    687687
    688688    /* Detach all attached Hard Disks */
    689     CHardDisk2AttachmentVector vec = mMachine.GetHardDisk2Attachments();
     689    CHardDiskAttachmentVector vec = mMachine.GetHardDiskAttachments();
    690690    for (int i = 0; i < vec.size(); ++ i)
    691691    {
    692         CHardDisk2Attachment hda = vec [i];
    693         mMachine.DetachHardDisk2 (hda.GetBus(), hda.GetChannel(), hda.GetDevice());
     692        CHardDiskAttachment hda = vec [i];
     693        mMachine.DetachHardDisk(hda.GetBus(), hda.GetChannel(), hda.GetDevice());
    694694
    695695        /* [dsen] check this */
     
    708708            maxSATAPort = maxSATAPort < (list [i].slot.channel + 1) ?
    709709                          (list [i].slot.channel + 1) : maxSATAPort;
    710         mMachine.AttachHardDisk2 (list [i].disk.id,
     710        mMachine.AttachHardDisk(list [i].disk.id,
    711711            list [i].slot.bus, list [i].slot.channel, list [i].slot.device);
    712712
     
    715715            vboxProblem().cannotAttachHardDisk (this, mMachine,
    716716                vboxGlobal().getMedium (CMedium (vboxGlobal().virtualBox()
    717                 .GetHardDisk2 (list [i].disk.id))).location(),
     717                .GetHardDisk(list [i].disk.id))).location(),
    718718                list [i].slot.bus, list [i].slot.channel, list [i].slot.device);
    719719    }
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r16853 r16867  
    11991199{
    12001200    // @todo:
    1201     //  - don't use COM methods but the methods directly (faster, but needs appropriate locking of that objects itself (s. HardDisk2))
     1201    //  - don't use COM methods but the methods directly (faster, but needs appropriate locking of that objects itself (s. HardDisk))
    12021202    //  - Appropriate handle errors like not supported file formats
    12031203    AutoCaller autoCaller(this);
     
    16251625HRESULT Appliance::searchUniqueDiskImageFilePath(Utf8Str& aName) const
    16261626{
    1627     IHardDisk2 *harddisk = NULL;
     1627    IHardDisk *harddisk = NULL;
    16281628    char *tmpName = RTStrDup(aName.c_str());
    16291629    int i = 1;
     
    16321632    /* @todo: Maybe too cost-intensive; try to find a lighter way */
    16331633    while (RTPathExists(tmpName) ||
    1634            mVirtualBox->FindHardDisk2(Bstr(tmpName), &harddisk) != VBOX_E_OBJECT_NOT_FOUND)
     1634           mVirtualBox->FindHardDisk(Bstr(tmpName), &harddisk) != VBOX_E_OBJECT_NOT_FOUND)
    16351635    {
    16361636        RTStrFree(tmpName);
     
    16591659    Appliance *app = task->that;
    16601660
    1661     /// @todo ugly hack, fix ComAssert... (same as in HardDisk2::taskThread)
     1661    /// @todo ugly hack, fix ComAssert... (same as in HardDisk::taskThread)
    16621662    #define setError app->setError
    16631663
     
    19211921                   the machine, so make an extra try/catch block. */
    19221922                ComPtr<ISession> session;
    1923                 ComPtr<IHardDisk2> srcHdVBox;
     1923                ComPtr<IHardDisk> srcHdVBox;
    19241924                try
    19251925                {
     
    19731973                        rc = VirtualBox::ensureFilePathExists(pcszDstFilePath);
    19741974                        CheckComRCThrowRC(rc);
    1975                         ComPtr<IHardDisk2> dstHdVBox;
     1975                        ComPtr<IHardDisk> dstHdVBox;
    19761976                        /* If strHref is empty we have to create a new file */
    19771977                        if (di.strHref.c_str()[0] == 0)
     
    19831983                                srcFormat = L"VMDK";
    19841984                            /* Create an empty hard disk */
    1985                             rc = app->mVirtualBox->CreateHardDisk2(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam());
     1985                            rc = app->mVirtualBox->CreateHardDisk(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam());
    19861986                            CheckComRCThrowRC(rc);
    19871987                            /* Create a dynamic growing disk image with the given capacity */
     
    20332033                             * attached already from a previous import) */
    20342034                            /* First open the existing disk image */
    2035                             rc = app->mVirtualBox->OpenHardDisk2(Bstr(strSrcFilePath), srcHdVBox.asOutParam());
     2035                            rc = app->mVirtualBox->OpenHardDisk(Bstr(strSrcFilePath), srcHdVBox.asOutParam());
    20362036                            CheckComRCThrowRC(rc);
    20372037                            /* We need the format description of the source disk image */
     
    20402040                            CheckComRCThrowRC(rc);
    20412041                            /* Create a new hard disk interface for the destination disk image */
    2042                             rc = app->mVirtualBox->CreateHardDisk2(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam());
     2042                            rc = app->mVirtualBox->CreateHardDisk(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam());
    20432043                            CheckComRCThrowRC(rc);
    20442044                            /* Clone the source disk image */
     
    20962096                            default: break;
    20972097                        }
    2098                         rc = sMachine->AttachHardDisk2(hdId, sbt, hdc.ulBusNumber, 0);
     2098                        rc = sMachine->AttachHardDisk(hdId, sbt, hdc.ulBusNumber, 0);
    20992099                        CheckComRCThrowRC(rc);
    21002100                        rc = sMachine->SaveSettings();
     
    21502150    LogFlowFuncLeave();
    21512151
    2152     /// @todo ugly hack, fix ComAssert... (same as in HardDisk2::taskThread)
     2152    /// @todo ugly hack, fix ComAssert... (same as in HardDisk::taskThread)
    21532153    #undef setError
    21542154
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r16853 r16867  
    26572657        case DriveState_ImageMounted:
    26582658        {
    2659             ComPtr <IFloppyImage2> ImagePtr;
     2659            ComPtr<IFloppyImage> ImagePtr;
    26602660            rc = mFloppyDrive->GetImage (ImagePtr.asOutParam());
    26612661            if (SUCCEEDED (rc))
     
    43554355    /* lock all hard disks for writing and their parents for reading */
    43564356    {
    4357         com::SafeIfaceArray <IHardDisk2Attachment> atts;
     4357        com::SafeIfaceArray <IHardDiskAttachment> atts;
    43584358        rc = mMachine->
    4359             COMGETTER(HardDisk2Attachments) (ComSafeArrayAsOutParam (atts));
     4359            COMGETTER(HardDiskAttachments) (ComSafeArrayAsOutParam (atts));
    43604360        CheckComRCReturnRC (rc);
    43614361
    43624362        for (size_t i = 0; i < atts.size(); ++ i)
    43634363        {
    4364             ComPtr <IHardDisk2> hardDisk;
     4364            ComPtr <IHardDisk> hardDisk;
    43654365            rc = atts [i]->COMGETTER(HardDisk) (hardDisk.asOutParam());
    43664366            CheckComRCReturnRC (rc);
     
    43914391                    task->mediaToCheck.push_back (hardDisk);
    43924392
    4393                 ComPtr <IHardDisk2> parent;
     4393                ComPtr <IHardDisk> parent;
    43944394                rc = hardDisk->COMGETTER(Parent) (parent.asOutParam());
    43954395                CheckComRCReturnRC (rc);
     
    44364436        if (driveState == DriveState_ImageMounted)
    44374437        {
    4438             ComPtr <IFloppyImage2> image;
     4438            ComPtr<IFloppyImage> image;
    44394439            rc = drive->GetImage (image.asOutParam());
    44404440            CheckComRCReturnRC (rc);
     
    67826782 *  @return  VBox status code.
    67836783 */
    6784 static DECLCALLBACK(int) reconfigureHardDisks(PVM pVM, IHardDisk2Attachment *hda,
     6784static DECLCALLBACK(int) reconfigureHardDisks(PVM pVM, IHardDiskAttachment *hda,
    67856785                                              HRESULT *phrc)
    67866786{
     
    67976797     * Figure out which IDE device this is.
    67986798     */
    6799     ComPtr<IHardDisk2> hardDisk;
     6799    ComPtr<IHardDisk> hardDisk;
    68006800    hrc = hda->COMGETTER(HardDisk)(hardDisk.asOutParam());                      H();
    68016801    StorageBus_T enmBus;
     
    69476947
    69486948    /* Create an inversed tree of parents. */
    6949     ComPtr<IHardDisk2> parentHardDisk = hardDisk;
     6949    ComPtr<IHardDisk> parentHardDisk = hardDisk;
    69506950    for (PCFGMNODE pParent = pCfg;;)
    69516951    {
     
    70847084            LogFlowFunc (("Reattaching new differencing hard disks...\n"));
    70857085
    7086             com::SafeIfaceArray <IHardDisk2Attachment> atts;
     7086            com::SafeIfaceArray <IHardDiskAttachment> atts;
    70877087            rc = that->mMachine->
    7088                 COMGETTER(HardDisk2Attachments) (ComSafeArrayAsOutParam (atts));
     7088                COMGETTER(HardDiskAttachments) (ComSafeArrayAsOutParam (atts));
    70897089            if (FAILED (rc))
    70907090                break;
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r16856 r16867  
    577577        rc = CFGMR3InsertNode(pInst,    "LUN#0",     &pLunL0);                          RC_CHECK();
    578578
    579         ComPtr<IFloppyImage2> floppyImage;
     579        ComPtr<IFloppyImage> floppyImage;
    580580        hrc = floppyDrive->GetImage(floppyImage.asOutParam());                      H();
    581581        if (floppyImage)
     
    867867    /* Attach the hard disks */
    868868    {
    869         com::SafeIfaceArray <IHardDisk2Attachment> atts;
     869        com::SafeIfaceArray<IHardDiskAttachment> atts;
    870870        hrc = pMachine->
    871             COMGETTER(HardDisk2Attachments) (ComSafeArrayAsOutParam (atts));    H();
     871            COMGETTER(HardDiskAttachments) (ComSafeArrayAsOutParam (atts));    H();
    872872
    873873        for (size_t i = 0; i < atts.size(); ++ i)
    874874        {
    875             ComPtr <IHardDisk2> hardDisk;
     875            ComPtr<IHardDisk> hardDisk;
    876876            hrc = atts [i]->COMGETTER(HardDisk) (hardDisk.asOutParam());        H();
    877877            StorageBus_T enmBus;
     
    986986
    987987            /* Create an inversed tree of parents. */
    988             ComPtr <IHardDisk2> parentHardDisk = hardDisk;
     988            ComPtr<IHardDisk> parentHardDisk = hardDisk;
    989989            for (PCFGMNODE pParent = pCfg;;)
    990990            {
  • trunk/src/VBox/Main/FloppyDriveImpl.cpp

    r16560 r16867  
    273273     * We also don't lock mParent since its mParent field is const. */
    274274
    275     ComObjPtr <FloppyImage2> image;
    276     rc = mParent->virtualBox()->findFloppyImage2 (&imageId, NULL,
    277                                                   true /* aSetError */, &image);
     275    ComObjPtr<FloppyImage> image;
     276    rc = mParent->virtualBox()->findFloppyImage(&imageId, NULL,
     277                                                true /* aSetError */, &image);
    278278
    279279    if (SUCCEEDED (rc))
     
    377377}
    378378
    379 STDMETHODIMP FloppyDrive::GetImage (IFloppyImage2 **aFloppyImage)
     379STDMETHODIMP FloppyDrive::GetImage(IFloppyImage **aFloppyImage)
    380380{
    381381    CheckComArgOutPointerValid(aFloppyImage);
  • trunk/src/VBox/Main/HardDisk2Impl.cpp

    r16577 r16867  
    2222 */
    2323
    24 #include "HardDisk2Impl.h"
     24#include "HardDiskImpl.h"
    2525
    2626#include "ProgressImpl.h"
     
    5353 * task thread function will delete them when the task is complete!
    5454 *
    55  * @note The constructor of this class adds a caller on the managed HardDisk2
     55 * @note The constructor of this class adds a caller on the managed HardDisk
    5656 *       object which is automatically released upon destruction.
    5757 */
    58 struct HardDisk2::Task : public com::SupportErrorInfoBase
     58struct HardDisk::Task : public com::SupportErrorInfoBase
    5959{
    6060    enum Operation { CreateDynamic, CreateFixed, CreateDiff,
    6161                     Merge, Clone, Delete };
    6262
    63     HardDisk2 *that;
     63    HardDisk *that;
    6464    VirtualBoxBaseProto::AutoCaller autoCaller;
    6565
     
    7070    HRESULT rc;
    7171
    72     Task (HardDisk2 *aThat, Progress *aProgress, Operation aOperation)
     72    Task (HardDisk *aThat, Progress *aProgress, Operation aOperation)
    7373        : that (aThat), autoCaller (aThat)
    7474        , progress (aProgress)
     
    7878    ~Task();
    7979
    80     void setData (HardDisk2 *aTarget)
     80    void setData (HardDisk *aTarget)
    8181    {
    8282        d.target = aTarget;
     
    104104        /* CreateDiff */
    105105
    106         ComObjPtr <HardDisk2> target;
     106        ComObjPtr<HardDisk> target;
    107107
    108108        /* Merge */
     
    116116
    117117    // SupportErrorInfoBase interface
    118     const GUID &mainInterfaceID() const { return COM_IIDOF (IHardDisk2); }
    119     const char *componentName() const { return HardDisk2::ComponentName(); }
     118    const GUID &mainInterfaceID() const { return COM_IIDOF (IHardDisk); }
     119    const char *componentName() const { return HardDisk::ComponentName(); }
    120120};
    121121
    122 HardDisk2::Task::~Task()
     122HardDisk::Task::~Task()
    123123{
    124124    /* remove callers added by setData() */
     
    128128
    129129/**
    130  * Starts a new thread driven by the HardDisk2::taskThread() function and passes
     130 * Starts a new thread driven by the HardDisk::taskThread() function and passes
    131131 * this Task instance as an argument.
    132132 *
     
    140140 *       other threads asynchronously waiting for it.
    141141 */
    142 HRESULT HardDisk2::Task::startThread()
    143 {
    144     int vrc = RTThreadCreate (NULL, HardDisk2::taskThread, this,
     142HRESULT HardDisk::Task::startThread()
     143{
     144    int vrc = RTThreadCreate (NULL, HardDisk::taskThread, this,
    145145                              0, RTTHREADTYPE_MAIN_HEAVY_WORKER, 0,
    146146                              "HardDisk::Task");
     
    152152
    153153/**
    154  * Runs HardDisk2::taskThread() by passing it this Task instance as an argument
     154 * Runs HardDisk::taskThread() by passing it this Task instance as an argument
    155155 * on the current thread instead of creating a new one.
    156156 *
     
    169169 *       complete the progress object in this case.
    170170 */
    171 HRESULT HardDisk2::Task::runNow()
    172 {
    173     HardDisk2::taskThread (NIL_RTTHREAD, this);
     171HRESULT HardDisk::Task::runNow()
     172{
     173    HardDisk::taskThread (NIL_RTTHREAD, this);
    174174
    175175    return rc;
     
    182182 *
    183183 * @note It is assumed that when modifying methods of this class are called,
    184  *       HardDisk2::treeLock() is held in read mode.
     184 *       HardDisk::treeLock() is held in read mode.
    185185 */
    186 class HardDisk2::MergeChain : public HardDisk2::List,
    187                               public com::SupportErrorInfoBase
     186class HardDisk::MergeChain : public HardDisk::List,
     187                             public com::SupportErrorInfoBase
    188188{
    189189public:
     
    220220    }
    221221
    222     HRESULT addSource (HardDisk2 *aHardDisk)
     222    HRESULT addSource (HardDisk *aHardDisk)
    223223    {
    224224        HRESULT rc = aHardDisk->addCaller();
     
    284284    }
    285285
    286     HRESULT addTarget (HardDisk2 *aHardDisk)
     286    HRESULT addTarget (HardDisk *aHardDisk)
    287287    {
    288288        HRESULT rc = aHardDisk->addCaller();
     
    314314    }
    315315
    316     HRESULT addIntermediate (HardDisk2 *aHardDisk)
     316    HRESULT addIntermediate (HardDisk *aHardDisk)
    317317    {
    318318        HRESULT rc = aHardDisk->addCaller();
     
    345345
    346346    bool isForward() const { return mForward; }
    347     HardDisk2 *parent() const { return mParent; }
     347    HardDisk *parent() const { return mParent; }
    348348    const List &children() const { return mChildren; }
    349349
    350     HardDisk2 *source() const
     350    HardDisk *source() const
    351351    { AssertReturn (size() > 0, NULL); return mForward ? front() : back(); }
    352352
    353     HardDisk2 *target() const
     353    HardDisk *target() const
    354354    { AssertReturn (size() > 0, NULL); return mForward ? back() : front(); }
    355355
     
    357357
    358358    // SupportErrorInfoBase interface
    359     const GUID &mainInterfaceID() const { return COM_IIDOF (IHardDisk2); }
    360     const char *componentName() const { return HardDisk2::ComponentName(); }
     359    const GUID &mainInterfaceID() const { return COM_IIDOF (IHardDisk); }
     360    const char *componentName() const { return HardDisk::ComponentName(); }
    361361
    362362private:
    363363
    364     HRESULT check (HardDisk2 *aHardDisk, bool aChildren, bool aAttachments,
     364    HRESULT check (HardDisk *aHardDisk, bool aChildren, bool aAttachments,
    365365                   bool aImmutable)
    366366    {
     
    398398    }
    399399
    400     HRESULT checkChildren (HardDisk2 *aHardDisk)
     400    HRESULT checkChildren (HardDisk *aHardDisk)
    401401    { return check (aHardDisk, true, false, false); }
    402402
    403     HRESULT checkChildrenAndImmutable (HardDisk2 *aHardDisk)
     403    HRESULT checkChildrenAndImmutable (HardDisk *aHardDisk)
    404404    { return check (aHardDisk, true, false, true); }
    405405
    406     HRESULT checkChildrenAndAttachments (HardDisk2 *aHardDisk)
     406    HRESULT checkChildrenAndAttachments (HardDisk *aHardDisk)
    407407    { return check (aHardDisk, true, true, false); }
    408408
    409     HRESULT checkChildrenAndAttachmentsAndImmutable (HardDisk2 *aHardDisk)
     409    HRESULT checkChildrenAndAttachmentsAndImmutable (HardDisk *aHardDisk)
    410410    { return check (aHardDisk, true, true, true); }
    411411
     
    416416
    417417    /** Parent of the source when forward merge (if any) */
    418     ComObjPtr <HardDisk2> mParent;
     418    ComObjPtr <HardDisk> mParent;
    419419    /** Children of the source when backward merge (if any) */
    420420    List mChildren;
     
    422422
    423423////////////////////////////////////////////////////////////////////////////////
    424 // HardDisk2 class
     424// HardDisk class
    425425////////////////////////////////////////////////////////////////////////////////
    426426
     
    428428////////////////////////////////////////////////////////////////////////////////
    429429
    430 DEFINE_EMPTY_CTOR_DTOR (HardDisk2)
    431 
    432 HRESULT HardDisk2::FinalConstruct()
     430DEFINE_EMPTY_CTOR_DTOR (HardDisk)
     431
     432HRESULT HardDisk::FinalConstruct()
    433433{
    434434    /* Initialize the callbacks of the VD error interface */
     
    463463    int vrc;
    464464    vrc = VDInterfaceAdd (&mm.vdIfError,
    465                           "HardDisk2::vdInterfaceError",
     465                          "HardDisk::vdInterfaceError",
    466466                          VDINTERFACETYPE_ERROR,
    467467                          &mm.vdIfCallsError, this, &mm.vdDiskIfaces);
     
    469469
    470470    vrc = VDInterfaceAdd (&mm.vdIfProgress,
    471                           "HardDisk2::vdInterfaceProgress",
     471                          "HardDisk::vdInterfaceProgress",
    472472                          VDINTERFACETYPE_PROGRESS,
    473473                          &mm.vdIfCallsProgress, this, &mm.vdDiskIfaces);
     
    475475
    476476    vrc = VDInterfaceAdd (&mm.vdIfConfig,
    477                           "HardDisk2::vdInterfaceConfig",
     477                          "HardDisk::vdInterfaceConfig",
    478478                          VDINTERFACETYPE_CONFIG,
    479479                          &mm.vdIfCallsConfig, this, &mm.vdDiskIfaces);
     
    481481
    482482    vrc = VDInterfaceAdd (&mm.vdIfTcpNet,
    483                           "HardDisk2::vdInterfaceTcpNet",
     483                          "HardDisk::vdInterfaceTcpNet",
    484484                          VDINTERFACETYPE_TCPNET,
    485485                          &mm.vdIfCallsTcpNet, this, &mm.vdDiskIfaces);
     
    489489}
    490490
    491 void HardDisk2::FinalRelease()
     491void HardDisk::FinalRelease()
    492492{
    493493    uninit();
     
    509509 * @param aLocaiton     Storage unit location.
    510510 */
    511 HRESULT HardDisk2::init (VirtualBox *aVirtualBox, CBSTR aFormat,
    512                          CBSTR aLocation)
     511HRESULT HardDisk::init(VirtualBox *aVirtualBox, CBSTR aFormat,
     512                       CBSTR aLocation)
    513513{
    514514    AssertReturn (aVirtualBox != NULL, E_FAIL);
     
    561561        m.state = MediaState_Created;
    562562        unconst (m.id).create();
    563         rc = mVirtualBox->registerHardDisk2 (this);
     563        rc = mVirtualBox->registerHardDisk (this);
    564564
    565565        /// @todo later we may want to use a pfnIsConfigSufficient backend info
     
    589589 * @param aLocaiton     Storage unit location.
    590590 */
    591 HRESULT HardDisk2::init (VirtualBox *aVirtualBox, CBSTR aLocation)
     591HRESULT HardDisk::init (VirtualBox *aVirtualBox, CBSTR aLocation)
    592592{
    593593    AssertReturn (aVirtualBox, E_INVALIDARG);
     
    649649 * @note Locks VirtualBox lock for writing, treeLock() for writing.
    650650 */
    651 HRESULT HardDisk2::init (VirtualBox *aVirtualBox, HardDisk2 *aParent,
    652                          const settings::Key &aNode)
     651HRESULT HardDisk::init(VirtualBox *aVirtualBox, HardDisk *aParent,
     652                       const settings::Key &aNode)
    653653{
    654654    using namespace settings;
     
    746746         it != hardDisks.end(); ++ it)
    747747    {
    748         ComObjPtr <HardDisk2> hardDisk;
     748        ComObjPtr<HardDisk> hardDisk;
    749749        hardDisk.createObject();
    750750        rc = hardDisk->init (aVirtualBox, this, *it);
    751751        CheckComRCBreakRC (rc);
    752752
    753         rc = mVirtualBox->registerHardDisk2 (hardDisk, false /* aSaveRegistry */);
     753        rc = mVirtualBox->registerHardDisk(hardDisk, false /* aSaveRegistry */);
    754754        CheckComRCBreakRC (rc);
    755755    }
     
    772772 * @note Locks treeLock() for writing, VirtualBox for writing.
    773773 */
    774 void HardDisk2::uninit()
     774void HardDisk::uninit()
    775775{
    776776    /* Enclose the state transition Ready->InUninit->NotReady */
     
    814814}
    815815
    816 // IHardDisk2 properties
     816// IHardDisk properties
    817817////////////////////////////////////////////////////////////////////////////////
    818818
    819 STDMETHODIMP HardDisk2::COMGETTER(Format) (BSTR *aFormat)
     819STDMETHODIMP HardDisk::COMGETTER(Format) (BSTR *aFormat)
    820820{
    821821    if (aFormat == NULL)
     
    831831}
    832832
    833 STDMETHODIMP HardDisk2::COMGETTER(Type) (HardDiskType_T *aType)
     833STDMETHODIMP HardDisk::COMGETTER(Type) (HardDiskType_T *aType)
    834834{
    835835    if (aType == NULL)
     
    846846}
    847847
    848 STDMETHODIMP HardDisk2::COMSETTER(Type) (HardDiskType_T aType)
     848STDMETHODIMP HardDisk::COMSETTER(Type) (HardDiskType_T aType)
    849849{
    850850    AutoCaller autoCaller (this);
     
    914914}
    915915
    916 STDMETHODIMP HardDisk2::COMGETTER(Parent) (IHardDisk2 **aParent)
     916STDMETHODIMP HardDisk::COMGETTER(Parent) (IHardDisk **aParent)
    917917{
    918918    if (aParent == NULL)
     
    930930}
    931931
    932 STDMETHODIMP HardDisk2::COMGETTER(Children) (ComSafeArrayOut (IHardDisk2 *, aChildren))
     932STDMETHODIMP HardDisk::COMGETTER(Children) (ComSafeArrayOut (IHardDisk *, aChildren))
    933933{
    934934    if (ComSafeArrayOutIsNull (aChildren))
     
    941941    AutoReadLock treeLock (this->treeLock());
    942942
    943     SafeIfaceArray <IHardDisk2> children (this->children());
     943    SafeIfaceArray<IHardDisk> children (this->children());
    944944    children.detachTo (ComSafeArrayOutArg (aChildren));
    945945
     
    947947}
    948948
    949 STDMETHODIMP HardDisk2::COMGETTER(Root) (IHardDisk2 **aRoot)
     949STDMETHODIMP HardDisk::COMGETTER(Root)(IHardDisk **aRoot)
    950950{
    951951    if (aRoot == NULL)
     
    959959}
    960960
    961 STDMETHODIMP HardDisk2::COMGETTER(ReadOnly) (BOOL *aReadOnly)
     961STDMETHODIMP HardDisk::COMGETTER(ReadOnly) (BOOL *aReadOnly)
    962962{
    963963    if (aReadOnly == NULL)
     
    974974}
    975975
    976 STDMETHODIMP HardDisk2::COMGETTER(LogicalSize) (ULONG64 *aLogicalSize)
     976STDMETHODIMP HardDisk::COMGETTER(LogicalSize) (ULONG64 *aLogicalSize)
    977977{
    978978    if (aLogicalSize == NULL)
     
    10051005}
    10061006
    1007 // IHardDisk2 methods
     1007// IHardDisk methods
    10081008////////////////////////////////////////////////////////////////////////////////
    10091009
    1010 STDMETHODIMP HardDisk2::GetProperty (IN_BSTR aName, BSTR *aValue)
     1010STDMETHODIMP HardDisk::GetProperty (IN_BSTR aName, BSTR *aValue)
    10111011{
    10121012    CheckComArgStrNotEmptyOrNull (aName);
     
    10281028}
    10291029
    1030 STDMETHODIMP HardDisk2::SetProperty (IN_BSTR aName, IN_BSTR aValue)
     1030STDMETHODIMP HardDisk::SetProperty (IN_BSTR aName, IN_BSTR aValue)
    10311031{
    10321032    CheckComArgStrNotEmptyOrNull (aName);
     
    10591059}
    10601060
    1061 STDMETHODIMP HardDisk2::GetProperties (IN_BSTR aNames,
    1062                                        ComSafeArrayOut (BSTR, aReturnNames),
    1063                                        ComSafeArrayOut (BSTR, aReturnValues))
     1061STDMETHODIMP HardDisk::GetProperties(IN_BSTR aNames,
     1062                                     ComSafeArrayOut (BSTR, aReturnNames),
     1063                                     ComSafeArrayOut (BSTR, aReturnValues))
    10641064{
    10651065    CheckComArgOutSafeArrayPointerValid (aReturnNames);
     
    10921092}
    10931093
    1094 STDMETHODIMP HardDisk2::SetProperties (ComSafeArrayIn (IN_BSTR, aNames),
    1095                                        ComSafeArrayIn (IN_BSTR, aValues))
     1094STDMETHODIMP HardDisk::SetProperties(ComSafeArrayIn (IN_BSTR, aNames),
     1095                                      ComSafeArrayIn (IN_BSTR, aValues))
    10961096{
    10971097    CheckComArgSafeArrayNotNull (aNames);
     
    11291129}
    11301130
    1131 STDMETHODIMP HardDisk2::CreateDynamicStorage (ULONG64 aLogicalSize,
    1132                                               IProgress **aProgress)
     1131STDMETHODIMP HardDisk::CreateDynamicStorage(ULONG64 aLogicalSize,
     1132                                            IProgress **aProgress)
    11331133{
    11341134    CheckComArgOutPointerValid (aProgress);
     
    11551155    ComObjPtr <Progress> progress;
    11561156    progress.createObject();
    1157     HRESULT rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *> (this),
     1157    HRESULT rc = progress->init (mVirtualBox, static_cast<IHardDisk*>(this),
    11581158        BstrFmt (tr ("Creating dynamic hard disk storage unit '%ls'"),
    11591159                 m.locationFull.raw()),
     
    11841184}
    11851185
    1186 STDMETHODIMP HardDisk2::CreateFixedStorage (ULONG64 aLogicalSize,
    1187                                             IProgress **aProgress)
     1186STDMETHODIMP HardDisk::CreateFixedStorage(ULONG64 aLogicalSize,
     1187                                          IProgress **aProgress)
    11881188{
    11891189    CheckComArgOutPointerValid (aProgress);
     
    12101210    ComObjPtr <Progress> progress;
    12111211    progress.createObject();
    1212     HRESULT rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *> (this),
     1212    HRESULT rc = progress->init (mVirtualBox, static_cast<IHardDisk*>(this),
    12131213        BstrFmt (tr ("Creating fixed hard disk storage unit '%ls'"),
    12141214                 m.locationFull.raw()),
     
    12391239}
    12401240
    1241 STDMETHODIMP HardDisk2::DeleteStorage (IProgress **aProgress)
     1241STDMETHODIMP HardDisk::DeleteStorage (IProgress **aProgress)
    12421242{
    12431243    CheckComArgOutPointerValid (aProgress);
     
    12581258}
    12591259
    1260 STDMETHODIMP HardDisk2::CreateDiffStorage (IHardDisk2 *aTarget, IProgress **aProgress)
     1260STDMETHODIMP HardDisk::CreateDiffStorage (IHardDisk *aTarget, IProgress **aProgress)
    12611261{
    12621262    CheckComArgNotNull (aTarget);
     
    12661266    CheckComRCReturnRC (autoCaller.rc());
    12671267
    1268     ComObjPtr <HardDisk2> diff;
     1268    ComObjPtr<HardDisk> diff;
    12691269    HRESULT rc = mVirtualBox->cast (aTarget, diff);
    12701270    CheckComRCReturnRC (rc);
     
    13001300}
    13011301
    1302 STDMETHODIMP HardDisk2::MergeTo (IN_GUID aTargetId, IProgress **aProgress)
     1302STDMETHODIMP HardDisk::MergeTo (IN_GUID aTargetId, IProgress **aProgress)
    13031303{
    13041304    AutoCaller autoCaller (this);
     
    13081308}
    13091309
    1310 STDMETHODIMP HardDisk2::CloneTo (IHardDisk2 *aTarget, IProgress **aProgress)
     1310STDMETHODIMP HardDisk::CloneTo (IHardDisk *aTarget, IProgress **aProgress)
    13111311{
    13121312    CheckComArgNotNull (aTarget);
     
    13161316    CheckComRCReturnRC (autoCaller.rc());
    13171317
    1318     ComObjPtr <HardDisk2> target;
     1318    ComObjPtr <HardDisk> target;
    13191319    HRESULT rc = mVirtualBox->cast (aTarget, target);
    13201320    CheckComRCReturnRC (rc);
     
    13351335
    13361336        progress.createObject();
    1337         rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *> (this),
     1337        rc = progress->init (mVirtualBox, static_cast <IHardDisk *> (this),
    13381338            BstrFmt (tr ("Creating clone hard disk '%ls'"),
    13391339                     target->m.locationFull.raw()),
     
    13781378}
    13791379
    1380 STDMETHODIMP HardDisk2::FlattenTo (IHardDisk2 *aTarget, IProgress **aProgress)
     1380STDMETHODIMP HardDisk::FlattenTo (IHardDisk *aTarget, IProgress **aProgress)
    13811381{
    13821382    AutoCaller autoCaller (this);
     
    13861386}
    13871387
    1388 STDMETHODIMP HardDisk2::Compact (IProgress **aProgress)
     1388STDMETHODIMP HardDisk::Compact (IProgress **aProgress)
    13891389{
    13901390    AutoCaller autoCaller (this);
     
    14071407 * @note Locks treeLock() for reading, this object and all children for writing.
    14081408 */
    1409 void HardDisk2::updatePaths (const char *aOldPath, const char *aNewPath)
     1409void HardDisk::updatePaths (const char *aOldPath, const char *aNewPath)
    14101410{
    14111411    AssertReturnVoid (aOldPath);
     
    14431443 * @note Locks treeLock() for reading.
    14441444 */
    1445 ComObjPtr <HardDisk2> HardDisk2::root (uint32_t *aLevel /*= NULL*/)
    1446 {
    1447     ComObjPtr <HardDisk2> root;
     1445ComObjPtr <HardDisk> HardDisk::root (uint32_t *aLevel /*= NULL*/)
     1446{
     1447    ComObjPtr <HardDisk> root;
    14481448    uint32_t level;
    14491449
     
    14851485 * @note Locks this object and treeLock() for reading.
    14861486 */
    1487 bool HardDisk2::isReadOnly()
     1487bool HardDisk::isReadOnly()
    14881488{
    14891489    AutoCaller autoCaller (this);
     
    15321532 * @note Locks this object, treeLock() and children for reading.
    15331533 */
    1534 HRESULT HardDisk2::saveSettings (settings::Key &aParentNode)
     1534HRESULT HardDisk::saveSettings (settings::Key &aParentNode)
    15351535{
    15361536    using namespace settings;
     
    16081608 *                      the specified location, and -1 otherwise.
    16091609 */
    1610 HRESULT HardDisk2::compareLocationTo (const char *aLocation, int &aResult)
     1610HRESULT HardDisk::compareLocationTo (const char *aLocation, int &aResult)
    16111611{
    16121612    AutoCaller autoCaller (this);
     
    16541654 * @note Must be called from under this object's read or write lock.
    16551655 */
    1656 Utf8Str HardDisk2::name()
     1656Utf8Str HardDisk::name()
    16571657{
    16581658    /// @todo NEWMEDIA treat non-FS-paths specially! (may require to requiest
     
    16821682 *       intermediate hard disks for writing.
    16831683 */
    1684 HRESULT HardDisk2::prepareDiscard (MergeChain * &aChain)
     1684HRESULT HardDisk::prepareDiscard (MergeChain * &aChain)
    16851685{
    16861686    AutoCaller autoCaller (this);
     
    17381738                  m.backRefs.front().snapshotIds.size() == 1, E_FAIL);
    17391739
    1740     ComObjPtr <HardDisk2> child = children().front();
     1740    ComObjPtr<HardDisk> child = children().front();
    17411741
    17421742    /* we keep this locked, so lock the affected child to make sure the lock
     
    18121812 *       reading or writing.
    18131813 */
    1814 HRESULT HardDisk2::discard (ComObjPtr <Progress> &aProgress, MergeChain *aChain)
     1814HRESULT HardDisk::discard (ComObjPtr <Progress> &aProgress, MergeChain *aChain)
    18151815{
    18161816    AssertReturn (!aProgress.isNull(), E_FAIL);
    18171817
    1818     ComObjPtr <HardDisk2> hdFrom;
     1818    ComObjPtr <HardDisk> hdFrom;
    18191819
    18201820    HRESULT rc = S_OK;
     
    18851885 *       reading.
    18861886 */
    1887 void HardDisk2::cancelDiscard (MergeChain *aChain)
     1887void HardDisk::cancelDiscard (MergeChain *aChain)
    18881888{
    18891889    AutoCaller autoCaller (this);
     
    19241924 * Returns a preferred format for differencing hard disks.
    19251925 */
    1926 Bstr HardDisk2::preferredDiffFormat()
     1926Bstr HardDisk::preferredDiffFormat()
    19271927{
    19281928    Bstr format;
     
    19701970 *       writing.
    19711971 */
    1972 HRESULT HardDisk2::deleteStorage (ComObjPtr <Progress> *aProgress, bool aWait)
     1972HRESULT HardDisk::deleteStorage (ComObjPtr <Progress> *aProgress, bool aWait)
    19731973{
    19741974    AssertReturn (aProgress != NULL || aWait == true, E_FAIL);
     
    19771977     * ourselves atomically after detecting that deletion is possible to make
    19781978     * sure that we don't do that after another thread has done
    1979      * VirtualBox::findHardDisk2() but before it starts using us (provided that
     1979     * VirtualBox::findHardDisk() but before it starts using us (provided that
    19801980     * it holds a mVirtualBox lock too of course). */
    19811981
     
    20472047        {
    20482048            progress.createObject();
    2049             rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *> (this),
     2049            rc = progress->init (mVirtualBox, static_cast<IHardDisk*>(this),
    20502050                BstrFmt (tr ("Deleting hard disk storage unit '%ls'"),
    20512051                         m.locationFull.raw()),
     
    21202120 * @note Locks this object and @a aTarget for writing.
    21212121 */
    2122 HRESULT HardDisk2::createDiffStorage (ComObjPtr <HardDisk2> &aTarget,
    2123                                       ComObjPtr <Progress> *aProgress,
    2124                                       bool aWait)
     2122HRESULT HardDisk::createDiffStorage(ComObjPtr<HardDisk> &aTarget,
     2123                                    ComObjPtr<Progress> *aProgress,
     2124                                     bool aWait)
    21252125{
    21262126    AssertReturn (!aTarget.isNull(), E_FAIL);
     
    21572157             * SnapshotMachine::init()) before deassociating them from the
    21582158             * current state (which takes place only on success in
    2159              * Machine::fixupHardDisks2()), so that the size of snapshotIds
     2159             * Machine::fixupHardDisks()), so that the size of snapshotIds
    21602160             * will be 1 in this case. The given condition is used to filter out
    21612161             * this legal situatinon and do not report an error. */
     
    21852185        {
    21862186            progress.createObject();
    2187             rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *> (this),
     2187            rc = progress->init (mVirtualBox, static_cast<IHardDisk*> (this),
    21882188                BstrFmt (tr ("Creating differencing hard disk storage unit '%ls'"),
    21892189                         aTarget->m.locationFull.raw()),
     
    22562256 *       intermediate hard disks for writing.
    22572257 */
    2258 HRESULT HardDisk2::prepareMergeTo (HardDisk2 *aTarget,
    2259                                    MergeChain * &aChain,
    2260                                    bool aIgnoreAttachments /*= false*/)
     2258HRESULT HardDisk::prepareMergeTo(HardDisk *aTarget,
     2259                                 MergeChain * &aChain,
     2260                                 bool aIgnoreAttachments /*= false*/)
    22612261{
    22622262    AssertReturn (aTarget != NULL, E_FAIL);
     
    22782278    bool forward;
    22792279    {
    2280         HardDisk2 *parent = mParent;
     2280        HardDisk *parent = mParent;
    22812281        while (parent != NULL && parent != aTarget)
    22822282            parent = parent->mParent;
     
    23102310                                                      aIgnoreAttachments));
    23112311    {
    2312         HardDisk2 *last = forward ? aTarget : this;
    2313         HardDisk2 *first = forward ? this : aTarget;
     2312        HardDisk *last = forward ? aTarget : this;
     2313        HardDisk *first = forward ? this : aTarget;
    23142314
    23152315        for (;;)
     
    23752375 * Note that this (source) hard disk is not uninitialized because of possible
    23762376 * AutoCaller instances held by the caller of this method on the current thread.
    2377  * It's therefore the responsibility of the caller to call HardDisk2::uninit()
     2377 * It's therefore the responsibility of the caller to call HardDisk::uninit()
    23782378 * after releasing all callers in this case!
    23792379 *
     
    24052405 *       for writing.
    24062406 */
    2407 HRESULT HardDisk2::mergeTo (MergeChain *aChain,
    2408                             ComObjPtr <Progress> *aProgress,
    2409                             bool aWait)
     2407HRESULT HardDisk::mergeTo(MergeChain *aChain,
     2408                          ComObjPtr <Progress> *aProgress,
     2409                          bool aWait)
    24102410{
    24112411    AssertReturn (aChain != NULL, E_FAIL);
     
    24302430
    24312431            progress.createObject();
    2432             rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *> (this),
     2432            rc = progress->init (mVirtualBox, static_cast<IHardDisk*>(this),
    24332433                BstrFmt (tr ("Merging hard disk '%s' to '%s'"),
    24342434                         name().raw(), aChain->target()->name().raw()),
     
    24812481 * @note Locks the hard disks from the chain for writing.
    24822482 */
    2483 void HardDisk2::cancelMergeTo (MergeChain *aChain)
     2483void HardDisk::cancelMergeTo (MergeChain *aChain)
    24842484{
    24852485    AutoCaller autoCaller (this);
     
    25142514 * @note Must be called from under this object's write lock.
    25152515 */
    2516 HRESULT HardDisk2::setLocation (CBSTR aLocation)
     2516HRESULT HardDisk::setLocation (CBSTR aLocation)
    25172517{
    25182518    /// @todo so far, we assert but later it makes sense to support null
     
    26662666 * @note Must be called from under this object's write lock.
    26672667 */
    2668 HRESULT HardDisk2::setFormat (CBSTR aFormat)
     2668HRESULT HardDisk::setFormat (CBSTR aFormat)
    26692669{
    26702670    /* get the format object first */
     
    27192719 *       writing.
    27202720 */
    2721 HRESULT HardDisk2::queryInfo()
     2721HRESULT HardDisk::queryInfo()
    27222722{
    27232723    AutoWriteLock alock (this);
     
    28732873
    28742874                    Guid id = parentId;
    2875                     ComObjPtr <HardDisk2> parent;
    2876                     rc = mVirtualBox->findHardDisk2 (&id, NULL,
    2877                                                      false /* aSetError */,
    2878                                                      &parent);
     2875                    ComObjPtr<HardDisk> parent;
     2876                    rc = mVirtualBox->findHardDisk(&id, NULL,
     2877                                                   false /* aSetError */,
     2878                                                   &parent);
    28792879                    if (FAILED (rc))
    28802880                    {
     
    30053005 * @note Locks treeLock() for reading.
    30063006 */
    3007 HRESULT HardDisk2::canClose()
     3007HRESULT HardDisk::canClose()
    30083008{
    30093009    /* we access children */
     
    30213021 * @note Called from within this object's AutoWriteLock.
    30223022 */
    3023 HRESULT HardDisk2::canAttach (const Guid &aMachineId,
    3024                               const Guid &aSnapshotId)
     3023HRESULT HardDisk::canAttach(const Guid &aMachineId,
     3024                            const Guid &aSnapshotId)
    30253025{
    30263026    if (mm.numCreateDiffTasks > 0)
     
    30393039 * @note Locks treeLock() for writing.
    30403040 */
    3041 HRESULT HardDisk2::unregisterWithVirtualBox()
     3041HRESULT HardDisk::unregisterWithVirtualBox()
    30423042{
    30433043    /* Note that we need to de-associate ourselves from the parent to let
    3044      * unregisterHardDisk2() properly save the registry */
     3044     * unregisterHardDisk() properly save the registry */
    30453045
    30463046    /* we modify mParent and access children */
    30473047    AutoWriteLock treeLock (this->treeLock());
    30483048
    3049     const ComObjPtr <HardDisk2, ComWeakRef> parent = mParent;
     3049    const ComObjPtr<HardDisk, ComWeakRef> parent = mParent;
    30503050
    30513051    AssertReturn (children().size() == 0, E_FAIL);
     
    30593059    }
    30603060
    3061     HRESULT rc = mVirtualBox->unregisterHardDisk2 (this);
     3061    HRESULT rc = mVirtualBox->unregisterHardDisk(this);
    30623062
    30633063    if (FAILED (rc))
     
    30983098 * @param aVRC  VBox error code to use when no error message is provided.
    30993099 */
    3100 Utf8Str HardDisk2::vdError (int aVRC)
     3100Utf8Str HardDisk::vdError (int aVRC)
    31013101{
    31023102    Utf8Str error;
     
    31273127 */
    31283128/*static*/
    3129 DECLCALLBACK(void) HardDisk2::vdErrorCall (void *pvUser, int rc, RT_SRC_POS_DECL,
    3130                                            const char *pszFormat, va_list va)
    3131 {
    3132     HardDisk2 *that = static_cast <HardDisk2 *> (pvUser);
     3129DECLCALLBACK(void) HardDisk::vdErrorCall(void *pvUser, int rc, RT_SRC_POS_DECL,
     3130                                         const char *pszFormat, va_list va)
     3131{
     3132    HardDisk *that = static_cast<HardDisk*>(pvUser);
    31333133    AssertReturnVoid (that != NULL);
    31343134
     
    31493149 */
    31503150/*static*/
    3151 DECLCALLBACK(int) HardDisk2::vdProgressCall (PVM /* pVM */, unsigned uPercent,
    3152                                              void *pvUser)
    3153 {
    3154     HardDisk2 *that = static_cast <HardDisk2 *> (pvUser);
     3151DECLCALLBACK(int) HardDisk::vdProgressCall(PVM /* pVM */, unsigned uPercent,
     3152                                           void *pvUser)
     3153{
     3154    HardDisk *that = static_cast<HardDisk*>(pvUser);
    31553155    AssertReturn (that != NULL, VERR_GENERAL_FAILURE);
    31563156
     
    31663166
    31673167/* static */
    3168 DECLCALLBACK(bool) HardDisk2::vdConfigAreKeysValid (void *pvUser,
     3168DECLCALLBACK(bool) HardDisk::vdConfigAreKeysValid (void *pvUser,
    31693169                                                    const char *pszzValid)
    31703170{
    3171     HardDisk2 *that = static_cast <HardDisk2 *> (pvUser);
     3171    HardDisk *that = static_cast<HardDisk*>(pvUser);
    31723172    AssertReturn (that != NULL, false);
    31733173
     
    31783178
    31793179/* static */
    3180 DECLCALLBACK(int) HardDisk2::vdConfigQuerySize (void *pvUser, const char *pszName,
    3181                                                 size_t *pcbValue)
     3180DECLCALLBACK(int) HardDisk::vdConfigQuerySize(void *pvUser, const char *pszName,
     3181                                              size_t *pcbValue)
    31823182{
    31833183    AssertReturn (VALID_PTR (pcbValue), VERR_INVALID_POINTER);
    31843184
    3185     HardDisk2 *that = static_cast <HardDisk2 *> (pvUser);
     3185    HardDisk *that = static_cast<HardDisk*>(pvUser);
    31863186    AssertReturn (that != NULL, VERR_GENERAL_FAILURE);
    31873187
     
    31913191        return VERR_CFGM_VALUE_NOT_FOUND;
    31923192
    3193     /* we interpret null values as "no value" in HardDisk2 */
     3193    /* we interpret null values as "no value" in HardDisk */
    31943194    if (it->second.isNull())
    31953195        return VERR_CFGM_VALUE_NOT_FOUND;
     
    32013201
    32023202/* static */
    3203 DECLCALLBACK(int) HardDisk2::vdConfigQuery (void *pvUser, const char *pszName,
     3203DECLCALLBACK(int) HardDisk::vdConfigQuery (void *pvUser, const char *pszName,
    32043204                                            char *pszValue, size_t cchValue)
    32053205{
    32063206    AssertReturn (VALID_PTR (pszValue), VERR_INVALID_POINTER);
    32073207
    3208     HardDisk2 *that = static_cast <HardDisk2 *> (pvUser);
     3208    HardDisk *that = static_cast<HardDisk*>(pvUser);
    32093209    AssertReturn (that != NULL, VERR_GENERAL_FAILURE);
    32103210
     
    32183218        return VERR_CFGM_NOT_ENOUGH_SPACE;
    32193219
    3220     /* we interpret null values as "no value" in HardDisk2 */
     3220    /* we interpret null values as "no value" in HardDisk */
    32213221    if (it->second.isNull())
    32223222        return VERR_CFGM_VALUE_NOT_FOUND;
     
    32363236 */
    32373237/* static */
    3238 DECLCALLBACK(int) HardDisk2::taskThread (RTTHREAD thread, void *pvUser)
     3238DECLCALLBACK(int) HardDisk::taskThread (RTTHREAD thread, void *pvUser)
    32393239{
    32403240    std::auto_ptr <Task> task (static_cast <Task *> (pvUser));
     
    32433243    bool isAsync = thread != NIL_RTTHREAD;
    32443244
    3245     HardDisk2 *that = task->that;
     3245    HardDisk *that = task->that;
    32463246
    32473247    /// @todo ugly hack, fix ComAssert... later
     
    32763276            {
    32773277                id.create();
    3278                 /* VirtualBox::registerHardDisk2() will need UUID */
     3278                /* VirtualBox::registerHardDisk() will need UUID */
    32793279                unconst (that->m.id) = id;
    32803280            }
     
    33373337                 * Created state only on success (leaving an orphan file is
    33383338                 * better than breaking media registry consistency) */
    3339                 rc = that->mVirtualBox->registerHardDisk2 (that);
     3339                rc = that->mVirtualBox->registerHardDisk(that);
    33403340            }
    33413341
     
    33663366        case Task::CreateDiff:
    33673367        {
    3368             ComObjPtr <HardDisk2> &target = task->d.target;
     3368            ComObjPtr<HardDisk> &target = task->d.target;
    33693369
    33703370            /* Lock both in {parent,child} order. The lock is also used as a
     
    33823382            {
    33833383                targetId.create();
    3384                 /* VirtualBox::registerHardDisk2() will need UUID */
     3384                /* VirtualBox::registerHardDisk() will need UUID */
    33853385                unconst (target->m.id) = targetId;
    33863386            }
     
    34743474                 * Created state only on success (leaving an orphan file is
    34753475                 * better than breaking media registry consistency) */
    3476                 rc = that->mVirtualBox->registerHardDisk2 (target);
     3476                rc = that->mVirtualBox->registerHardDisk(target);
    34773477
    34783478                if (FAILED (rc))
     
    36773677                                           that->treeLock());
    36783678
    3679                 HardDisk2 *source = chain->source();
    3680                 HardDisk2 *target = chain->target();
     3679                HardDisk *source = chain->source();
     3680                HardDisk *target = chain->target();
    36813681
    36823682                if (chain->isForward())
     
    36853685                     * hard disk which needs re-registration */
    36863686                    rc2 = target->mVirtualBox->
    3687                         unregisterHardDisk2 (target, false /* aSaveSettings */);
     3687                        unregisterHardDisk (target, false /* aSaveSettings */);
    36883688                    AssertComRC (rc2);
    36893689
     
    37063706                    /* then, register again */
    37073707                    rc2 = target->mVirtualBox->
    3708                         registerHardDisk2 (target, false /* aSaveSettings */);
     3708                        registerHardDisk (target, false /* aSaveSettings */);
    37093709                    AssertComRC (rc2);
    37103710                }
     
    37123712                {
    37133713                    Assert (target->children().size() == 1);
    3714                     HardDisk2 *targetChild = target->children().front();
     3714                    HardDisk *targetChild = target->children().front();
    37153715
    37163716                    /* disconnect the deleted branch at the elder end */
     
    37573757
    37583758                        rc2 = (*it)->mVirtualBox->
    3759                             unregisterHardDisk2 (*it, false /* aSaveSettings */);
     3759                            unregisterHardDisk(*it, false /* aSaveSettings */);
    37603760                        AssertComRC (rc2);
    37613761
     
    38303830        case Task::Clone:
    38313831        {
    3832             ComObjPtr <HardDisk2> &target = task->d.target;
     3832            ComObjPtr<HardDisk> &target = task->d.target;
    38333833
    38343834            /* Lock both in {parent,child} order. The lock is also used as a
     
    38463846            {
    38473847                targetId.create();
    3848                 /* VirtualBox::registerHardDisk2() will need UUID */
     3848                /* VirtualBox::registerHardDisk() will need UUID */
    38493849                unconst (target->m.id) = targetId;
    38503850            }
     
    39413941                     * Created state only on success (leaving an orphan file is
    39423942                     * better than breaking media registry consistency) */
    3943                     rc = that->mVirtualBox->registerHardDisk2 (target);
     3943                    rc = that->mVirtualBox->registerHardDisk(target);
    39443944
    39453945                    if (FAILED (rc))
     
    39543954                {
    39553955                    /* just register  */
    3956                     rc = that->mVirtualBox->registerHardDisk2 (target);
     3956                    rc = that->mVirtualBox->registerHardDisk(target);
    39573957                }
    39583958            }
  • trunk/src/VBox/Main/HardDiskAttachmentImpl.cpp

    r14972 r16867  
    2727/////////////////////////////////////////////////////////////////////////////
    2828
    29 HRESULT HardDisk2Attachment::FinalConstruct()
     29HRESULT HardDiskAttachment::FinalConstruct()
    3030{
    3131    return S_OK;
    3232}
    3333
    34 void HardDisk2Attachment::FinalRelease()
     34void HardDiskAttachment::FinalRelease()
    3535{
    3636    uninit();
     
    4949 * @param aImplicit Wether the attachment contains an implicitly created diff.
    5050 */
    51 HRESULT HardDisk2Attachment::init (HardDisk2 *aHD, StorageBus_T aBus, LONG aChannel,
    52                                    LONG aDevice, bool aImplicit /*= false*/)
     51HRESULT HardDiskAttachment::init(HardDisk *aHD, StorageBus_T aBus, LONG aChannel,
     52                                 LONG aDevice, bool aImplicit /*= false*/)
    5353{
    5454    AssertReturn (aHD, E_INVALIDARG);
     
    7575 * Called from FinalRelease().
    7676 */
    77 void HardDisk2Attachment::uninit()
     77void HardDiskAttachment::uninit()
    7878{
    7979    /* Enclose the state transition Ready->InUninit->NotReady */
     
    8383}
    8484
    85 // IHardDisk2Attachment properties
     85// IHardDiskAttachment properties
    8686/////////////////////////////////////////////////////////////////////////////
    8787
    88 STDMETHODIMP HardDisk2Attachment::COMGETTER(HardDisk) (IHardDisk2 **aHardDisk)
     88STDMETHODIMP HardDiskAttachment::COMGETTER(HardDisk) (IHardDisk **aHardDisk)
    8989{
    9090    CheckComArgOutPointerValid(aHardDisk);
     
    100100}
    101101
    102 STDMETHODIMP HardDisk2Attachment::COMGETTER(Bus) (StorageBus_T *aBus)
     102STDMETHODIMP HardDiskAttachment::COMGETTER(Bus) (StorageBus_T *aBus)
    103103{
    104104    CheckComArgOutPointerValid(aBus);
     
    113113}
    114114
    115 STDMETHODIMP HardDisk2Attachment::COMGETTER(Channel) (LONG *aChannel)
     115STDMETHODIMP HardDiskAttachment::COMGETTER(Channel) (LONG *aChannel)
    116116{
    117117    CheckComArgOutPointerValid(aChannel);
     
    126126}
    127127
    128 STDMETHODIMP HardDisk2Attachment::COMGETTER(Device) (LONG *aDevice)
     128STDMETHODIMP HardDiskAttachment::COMGETTER(Device) (LONG *aDevice)
    129129{
    130130    CheckComArgOutPointerValid(aDevice);
  • trunk/src/VBox/Main/MachineImpl.cpp

    r16560 r16867  
    14271427
    14281428STDMETHODIMP Machine::
    1429 COMGETTER(HardDisk2Attachments) (ComSafeArrayOut (IHardDisk2Attachment *, aAttachments))
     1429COMGETTER(HardDiskAttachments) (ComSafeArrayOut(IHardDiskAttachment *, aAttachments))
    14301430{
    14311431    if (ComSafeArrayOutIsNull (aAttachments))
     
    14371437    AutoReadLock alock (this);
    14381438
    1439     SafeIfaceArray <IHardDisk2Attachment> attachments (mHDData->mAttachments);
     1439    SafeIfaceArray<IHardDiskAttachment> attachments (mHDData->mAttachments);
    14401440    attachments.detachTo (ComSafeArrayOutArg (aAttachments));
    14411441
     
    18821882}
    18831883
    1884 STDMETHODIMP Machine::AttachHardDisk2 (IN_GUID aId,
    1885                                        StorageBus_T aBus, LONG aChannel,
    1886                                        LONG aDevice)
     1884STDMETHODIMP Machine::AttachHardDisk(IN_GUID aId,
     1885                                     StorageBus_T aBus, LONG aChannel,
     1886                                     LONG aDevice)
    18871887{
    18881888    if (aBus == StorageBus_SATA)
     
    19341934    CheckComRCReturnRC (autoCaller.rc());
    19351935
    1936     /* VirtualBox::findHardDisk2() need read lock; also we want to make sure the
     1936    /* VirtualBox::findHardDisk() need read lock; also we want to make sure the
    19371937     * hard disk object we pick up doesn't get unregistered before we finish. */
    19381938    AutoReadLock vboxLock (mParent);
     
    19571957        std::find_if (mHDData->mAttachments.begin(),
    19581958                      mHDData->mAttachments.end(),
    1959                       HardDisk2Attachment::EqualsTo (aBus, aChannel, aDevice));
     1959                      HardDiskAttachment::EqualsTo (aBus, aChannel, aDevice));
    19601960
    19611961    if (it != mHDData->mAttachments.end())
    19621962    {
    1963         ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
     1963        ComObjPtr<HardDisk> hd = (*it)->hardDisk();
    19641964        AutoReadLock hdLock (hd);
    19651965        return setError (VBOX_E_OBJECT_IN_USE,
     
    19721972
    19731973    /* find a hard disk by UUID */
    1974     ComObjPtr <HardDisk2> hd;
    1975     rc = mParent->findHardDisk2 (&id, NULL, true /* aSetError */, &hd);
     1974    ComObjPtr<HardDisk> hd;
     1975    rc = mParent->findHardDisk(&id, NULL, true /* aSetError */, &hd);
    19761976    CheckComRCReturnRC (rc);
    19771977
     
    19831983    if (std::find_if (mHDData->mAttachments.begin(),
    19841984                      mHDData->mAttachments.end(),
    1985                       HardDisk2Attachment::RefersTo (hd)) !=
     1985                      HardDiskAttachment::RefersTo (hd)) !=
    19861986            mHDData->mAttachments.end())
    19871987    {
     
    20062006            HDData::AttachmentList::const_iterator it =
    20072007                std::find_if (oldAtts.begin(), oldAtts.end(),
    2008                               HardDisk2Attachment::RefersTo (hd));
     2008                              HardDiskAttachment::RefersTo (hd));
    20092009            if (it != oldAtts.end())
    20102010            {
     
    20602060                        if (std::find_if (mHDData->mAttachments.begin(),
    20612061                                          mHDData->mAttachments.end(),
    2062                                           HardDisk2Attachment::RefersTo (
     2062                                          HardDiskAttachment::RefersTo (
    20632063                                              (*it)->hardDisk())) !=
    20642064                                mHDData->mAttachments.end())
     
    20992099                    indirect = false;
    21002100                    associate = false;
    2101                     /* go right to the HardDisk2Attachment creation */
     2101                    /* go right to the HardDiskAttachment creation */
    21022102                    break;
    21032103                }
     
    21072107             * hard disk's chain to base the new diff on */
    21082108
    2109             ComObjPtr <HardDisk2> base;
    2110             ComObjPtr <Snapshot> snap = mData->mCurrentSnapshot;
     2109            ComObjPtr<HardDisk> base;
     2110            ComObjPtr<Snapshot> snap = mData->mCurrentSnapshot;
    21112111            while (snap)
    21122112            {
     
    21662166        }
    21672167
    2168         ComObjPtr <HardDisk2> diff;
     2168        ComObjPtr<HardDisk> diff;
    21692169        diff.createObject();
    21702170        rc = diff->init (mParent, hd->preferredDiffFormat(),
     
    22052205    while (0);
    22062206
    2207     ComObjPtr <HardDisk2Attachment> attachment;
     2207    ComObjPtr<HardDiskAttachment> attachment;
    22082208    attachment.createObject();
    22092209    rc = attachment->init (hd, aBus, aChannel, aDevice, indirect);
     
    22262226}
    22272227
    2228 STDMETHODIMP Machine::GetHardDisk2 (StorageBus_T aBus, LONG aChannel,
    2229                                     LONG aDevice, IHardDisk2 **aHardDisk)
     2228STDMETHODIMP Machine::GetHardDisk(StorageBus_T aBus, LONG aChannel,
     2229                                  LONG aDevice, IHardDisk **aHardDisk)
    22302230{
    22312231    CheckComArgExpr (aBus, aBus != StorageBus_Null);
     
    22422242        std::find_if (mHDData->mAttachments.begin(),
    22432243                      mHDData->mAttachments.end(),
    2244                       HardDisk2Attachment::EqualsTo (aBus, aChannel, aDevice));
     2244                      HardDiskAttachment::EqualsTo (aBus, aChannel, aDevice));
    22452245
    22462246    if (it == mHDData->mAttachments.end())
     
    22542254}
    22552255
    2256 STDMETHODIMP Machine::DetachHardDisk2 (StorageBus_T aBus, LONG aChannel,
    2257                                        LONG aDevice)
     2256STDMETHODIMP Machine::DetachHardDisk(StorageBus_T aBus, LONG aChannel,
     2257                                     LONG aDevice)
    22582258{
    22592259    CheckComArgExpr (aBus, aBus != StorageBus_Null);
     
    22762276        std::find_if (mHDData->mAttachments.begin(),
    22772277                      mHDData->mAttachments.end(),
    2278                       HardDisk2Attachment::EqualsTo (aBus, aChannel, aDevice));
     2278                      HardDiskAttachment::EqualsTo (aBus, aChannel, aDevice));
    22792279
    22802280    if (it == mHDData->mAttachments.end())
     
    22832283            aDevice, aChannel, aBus);
    22842284
    2285     ComObjPtr <HardDisk2Attachment> hda = *it;
    2286     ComObjPtr <HardDisk2> hd = hda->hardDisk();
     2285    ComObjPtr<HardDiskAttachment> hda = *it;
     2286    ComObjPtr<HardDisk> hd = hda->hardDisk();
    22872287
    22882288    if (hda->isImplicit())
     
    22902290        /* attempt to implicitly delete the implicitly created diff */
    22912291
    2292         /// @todo move the implicit flag from HardDisk2Attachment to HardDisk2
     2292        /// @todo move the implicit flag from HardDiskAttachment to HardDisk
    22932293        /// and forbid any hard disk operation when it is implicit. Or maybe
    22942294        /// a special media state for it to make it even more simple.
     
    53325332
    53335333        /* find a hard disk by UUID */
    5334         ComObjPtr <HardDisk2> hd;
    5335         rc = mParent->findHardDisk2 (&uuid, NULL, true /* aDoSetError */, &hd);
     5334        ComObjPtr<HardDisk> hd;
     5335        rc = mParent->findHardDisk(&uuid, NULL, true /* aDoSetError */, &hd);
    53365336        CheckComRCReturnRC (rc);
    53375337
     
    53675367        if (std::find_if (mHDData->mAttachments.begin(),
    53685368                          mHDData->mAttachments.end(),
    5369                           HardDisk2Attachment::RefersTo (hd)) !=
     5369                          HardDiskAttachment::RefersTo (hd)) !=
    53705370                mHDData->mAttachments.end())
    53715371        {
     
    53865386            AssertFailedReturn (E_FAIL);
    53875387
    5388         ComObjPtr <HardDisk2Attachment> attachment;
     5388        ComObjPtr<HardDiskAttachment> attachment;
    53895389        attachment.createObject();
    53905390        rc = attachment->init (hd, bus, channel, device);
     
    66686668         ++ it)
    66696669    {
    6670         ComObjPtr <HardDisk2Attachment> att = *it;
     6670        ComObjPtr <HardDiskAttachment> att = *it;
    66716671
    66726672        Key hdNode = aNode.appendKey ("HardDiskAttachment");
     
    68296829    HRESULT rc = S_OK;
    68306830
    6831     typedef std::list <ComObjPtr <HardDisk2> > LockedMedia;
     6831    typedef std::list< ComObjPtr<HardDisk> > LockedMedia;
    68326832    LockedMedia lockedMedia;
    68336833
     
    68436843                 ++ it)
    68446844            {
    6845                 ComObjPtr <HardDisk2Attachment> hda = *it;
    6846                 ComObjPtr <HardDisk2> hd = hda->hardDisk();
     6845                ComObjPtr<HardDiskAttachment> hda = *it;
     6846                ComObjPtr<HardDisk> hd = hda->hardDisk();
    68476847
    68486848                rc = hd->LockRead (NULL);
     
    68666866             it = atts.begin(); it != atts.end(); ++ it)
    68676867        {
    6868             ComObjPtr <HardDisk2Attachment> hda = *it;
    6869             ComObjPtr <HardDisk2> hd = hda->hardDisk();
     6868            ComObjPtr<HardDiskAttachment> hda = *it;
     6869            ComObjPtr<HardDisk> hd = hda->hardDisk();
    68706870
    68716871            /* type cannot be changed while attached => no need to lock */
     
    68926892            CheckComRCThrowRC (rc);
    68936893
    6894             ComObjPtr <HardDisk2> diff;
     6894            ComObjPtr<HardDisk> diff;
    68956895            diff.createObject();
    68966896            rc = diff->init (mParent, hd->preferredDiffFormat(),
     
    69126912
    69136913            /* add a new attachment */
    6914             ComObjPtr <HardDisk2Attachment> attachment;
     6914            ComObjPtr<HardDiskAttachment> attachment;
    69156915            attachment.createObject();
    69166916            rc = attachment->init (diff, hda->bus(), hda->channel(),
     
    69486948/**
    69496949 * Deletes implicit differencing hard disks created either by
    6950  * #createImplicitDiffs() or by #AttachHardDisk2() and rolls back mHDData.
    6951  *
    6952  * Note that to delete hard disks created by #AttachHardDisk2() this method is
    6953  * called from #fixupHardDisks2() when the changes are rolled back.
     6950 * #createImplicitDiffs() or by #AttachHardDisk() and rolls back mHDData.
     6951 *
     6952 * Note that to delete hard disks created by #AttachHardDisk() this method is
     6953 * called from #fixupHardDisks() when the changes are rolled back.
    69546954 *
    69556955 * @note Locks this object for writing.
     
    69766976         it != mHDData->mAttachments.end(); ++ it)
    69776977    {
    6978         ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
     6978        ComObjPtr<HardDisk> hd = (*it)->hardDisk();
    69796979
    69806980        if ((*it)->isImplicit())
     
    69896989        /* was this hard disk attached before? */
    69906990        HDData::AttachmentList::const_iterator oldIt =
    6991             std::find_if (oldAtts.begin(), oldAtts.end(),
    6992                           HardDisk2Attachment::RefersTo (hd));
     6991            std::find_if(oldAtts.begin(), oldAtts.end(),
     6992                         HardDiskAttachment::RefersTo (hd));
    69936993        if (oldIt == oldAtts.end())
    69946994        {
     
    70247024             it != implicitAtts.end(); ++ it)
    70257025        {
    7026             ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
     7026            ComObjPtr<HardDisk> hd = (*it)->hardDisk();
    70277027
    70287028            mrc = hd->deleteStorageAndWait();
     
    70607060 * @note Locks this object for writing!
    70617061 */
    7062 void Machine::fixupHardDisks2 (bool aCommit, bool aOnline /*= false*/)
     7062void Machine::fixupHardDisks(bool aCommit, bool aOnline /*= false*/)
    70637063{
    70647064    AutoCaller autoCaller (this);
     
    70837083             it != mHDData->mAttachments.end(); ++ it)
    70847084        {
    7085             ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
     7085            ComObjPtr<HardDisk> hd = (*it)->hardDisk();
    70867086
    70877087            if ((*it)->isImplicit())
     
    70987098                     * new diff for reading if the VM is online */
    70997099
    7100                     ComObjPtr <HardDisk2> parent = hd->parent();
     7100                    ComObjPtr<HardDisk> parent = hd->parent();
    71017101                    /* make the relock atomic */
    71027102                    AutoWriteLock parentLock (parent);
     
    71137113            HDData::AttachmentList::iterator oldIt =
    71147114                std::find_if (oldAtts.begin(), oldAtts.end(),
    7115                               HardDisk2Attachment::RefersTo (hd));
     7115                              HardDiskAttachment::RefersTo (hd));
    71167116            if (oldIt != oldAtts.end())
    71177117            {
     
    71267126             it != oldAtts.end(); ++ it)
    71277127        {
    7128             ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
     7128            ComObjPtr<HardDisk> hd = (*it)->hardDisk();
    71297129
    71307130            /* now de-associate from the current machine state */
     
    73767376
    73777377    if (mHDData.isBackedUp())
    7378         fixupHardDisks2 (false /* aCommit */);
     7378        fixupHardDisks(false /* aCommit */);
    73797379
    73807380    /* check for changes in child objects */
     
    74817481
    74827482    if (mHDData.isBackedUp())
    7483         fixupHardDisks2 (true /* aCommit */);
     7483        fixupHardDisks(true /* aCommit */);
    74847484
    74857485    mBIOSSettings->commit();
     
    75057505        mPeer->mUserData.attach (mUserData);
    75067506        mPeer->mHWData.attach (mHWData);
    7507         /* mHDData is reshared by fixupHardDisks2 */
     7507        /* mHDData is reshared by fixupHardDisks */
    75087508        // mPeer->mHDData.attach (mHDData);
    75097509        Assert (mPeer->mHDData.data() == mHDData.data());
     
    84828482         ++ it)
    84838483    {
    8484         ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
     8484        ComObjPtr <HardDisk> hd = (*it)->hardDisk();
    84858485        AutoReadLock hdLock (hd);
    84868486        if (hd->type() == HardDiskType_Writethrough)
     
    94999499
    95009500        /* associate old hard disks with the snapshot and do locking/unlocking*/
    9501         fixupHardDisks2 (true /* aCommit */, online);
     9501        fixupHardDisks(true /* aCommit */, online);
    95029502
    95039503        /* inform callbacks */
     
    95149514        /* delete all differencing hard disks created (this will also attach
    95159515         * their parents back by rolling back mHDData) */
    9516         fixupHardDisks2 (false /* aCommit */);
     9516        fixupHardDisks(false /* aCommit */);
    95179517
    95189518        /* delete the saved state file (it might have been already created) */
     
    96429642    HardDiskDiscardRec() : chain (NULL) {}
    96439643
    9644     HardDiskDiscardRec (const ComObjPtr <HardDisk2> &aHd,
    9645                 HardDisk2::MergeChain *aChain = NULL)
     9644    HardDiskDiscardRec (const ComObjPtr<HardDisk> &aHd,
     9645                HardDisk::MergeChain *aChain = NULL)
    96469646        : hd (aHd), chain (aChain) {}
    96479647
    9648     HardDiskDiscardRec (const ComObjPtr <HardDisk2> &aHd,
    9649                         HardDisk2::MergeChain *aChain,
    9650                         const ComObjPtr <HardDisk2> &aReplaceHd,
    9651                         const ComObjPtr <HardDisk2Attachment> &aReplaceHda,
     9648    HardDiskDiscardRec (const ComObjPtr<HardDisk> &aHd,
     9649                        HardDisk::MergeChain *aChain,
     9650                        const ComObjPtr<HardDisk> &aReplaceHd,
     9651                        const ComObjPtr<HardDiskAttachment> &aReplaceHda,
    96529652                        const Guid &aSnapshotId)
    96539653        : hd (aHd), chain (aChain)
     
    96559655        , snapshotId (aSnapshotId) {}
    96569656
    9657     ComObjPtr <HardDisk2> hd;
    9658     HardDisk2::MergeChain *chain;
     9657    ComObjPtr<HardDisk> hd;
     9658    HardDisk::MergeChain *chain;
    96599659    /* these are for the replace hard disk case: */
    9660     ComObjPtr <HardDisk2> replaceHd;
    9661     ComObjPtr <HardDisk2Attachment> replaceHda;
     9660    ComObjPtr<HardDisk> replaceHd;
     9661    ComObjPtr<HardDiskAttachment> replaceHda;
    96629662    Guid snapshotId;
    96639663};
     
    97299729             ++ it)
    97309730        {
    9731             ComObjPtr <HardDisk2Attachment> hda = *it;
    9732             ComObjPtr <HardDisk2> hd = hda->hardDisk();
    9733 
    9734             /* HardDisk2::prepareDiscard() reqiuires a write lock */
     9731            ComObjPtr<HardDiskAttachment> hda = *it;
     9732            ComObjPtr<HardDisk> hd = hda->hardDisk();
     9733
     9734            /* HardDisk::prepareDiscard() reqiuires a write lock */
    97359735            AutoWriteLock hdLock (hd);
    97369736
     
    97499749            }
    97509750
    9751             HardDisk2::MergeChain *chain = NULL;
     9751            HardDisk::MergeChain *chain = NULL;
    97529752
    97539753            /* needs to be discarded (merged with the child if any), check
     
    97669766
    97679767                /* The below assert would be nice but I don't want to move
    9768                  * HardDisk2::MergeChain to the header just for that
     9768                 * HardDisk::MergeChain to the header just for that
    97699769                 * Assert (!chain->isForward()); */
    97709770
    97719771                Assert (hd->children().size() == 1);
    97729772
    9773                 ComObjPtr <HardDisk2> replaceHd = hd->children().front();
     9773                ComObjPtr<HardDisk> replaceHd = hd->children().front();
    97749774
    97759775                Assert (replaceHd->backRefs().front().machineId == mData->mUuid);
     
    97969796                    it = std::find_if (mHDData->mAttachments.begin(),
    97979797                                       mHDData->mAttachments.end(),
    9798                                        HardDisk2Attachment::RefersTo (replaceHd));
     9798                                       HardDiskAttachment::RefersTo (replaceHd));
    97999799                    AssertBreak (it != mHDData->mAttachments.end());
    98009800                }
     
    98119811                    it = std::find_if (snapAtts.begin(),
    98129812                                       snapAtts.end(),
    9813                                        HardDisk2Attachment::RefersTo (replaceHd));
     9813                                       HardDiskAttachment::RefersTo (replaceHd));
    98149814                    AssertBreak (it != snapAtts.end());
    98159815                }
     
    1017110171         * become unused and need to be auto-deleted */
    1017210172
    10173         std::list <ComObjPtr <HardDisk2> > diffs;
     10173        std::list< ComObjPtr<HardDisk> > diffs;
    1017410174
    1017510175        for (HDData::AttachmentList::const_iterator
     
    1017710177             it != mHDData.backedUpData()->mAttachments.end(); ++ it)
    1017810178        {
    10179             ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
     10179            ComObjPtr<HardDisk> hd = (*it)->hardDisk();
    1018010180
    1018110181            /* while the hard disk is attached, the number of children or the
     
    1019610196             * may fail otherwise (too many children of the hard disk to be
    1019710197             * discarded) */
    10198             for (std::list <ComObjPtr <HardDisk2> >::const_iterator
     10198            for (std::list< ComObjPtr<HardDisk> >::const_iterator
    1019910199                 it = diffs.begin(); it != diffs.end(); ++ it)
    1020010200            {
     
    1027310273        {
    1027410274            /* now, delete the unused diffs (only on success!) and uninit them*/
    10275             for (std::list <ComObjPtr <HardDisk2> >::const_iterator
     10275            for (std::list< ComObjPtr<HardDisk> >::const_iterator
    1027610276                 it = diffs.begin(); it != diffs.end(); ++ it)
    1027710277            {
     
    1037810378             it != mHDData->mAttachments.end(); ++ it)
    1037910379        {
    10380             ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
     10380            ComObjPtr<HardDisk> hd = (*it)->hardDisk();
    1038110381
    1038210382            bool first = true;
  • trunk/src/VBox/Main/MediumImpl.cpp

    r16853 r16867  
    11111111
    11121112////////////////////////////////////////////////////////////////////////////////
    1113 // FloppyImage2 class
    1114 ////////////////////////////////////////////////////////////////////////////////
    1115 
    1116 DEFINE_EMPTY_CTOR_DTOR (FloppyImage2)
     1113// FloppyImage class
     1114////////////////////////////////////////////////////////////////////////////////
     1115
     1116DEFINE_EMPTY_CTOR_DTOR (FloppyImage)
    11171117
    11181118/**
     
    11201120 *       mVirtualBox write lock.
    11211121 */
    1122 HRESULT FloppyImage2::unregisterWithVirtualBox()
     1122HRESULT FloppyImage::unregisterWithVirtualBox()
    11231123{
    11241124    return mVirtualBox->unregisterFloppyImage (this);
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r16853 r16867  
    5353#include "Global.h"
    5454#include "MachineImpl.h"
    55 #include "HardDisk2Impl.h"
     55#include "HardDiskImpl.h"
    5656#include "MediumImpl.h"
    5757#include "SharedFolderImpl.h"
     
    387387    uninitDependentChildren();
    388388
    389     mData.mHardDisk2Map.clear();
    390 
    391     mData.mFloppyImages2.clear();
    392     mData.mDVDImages2.clear();
    393     mData.mHardDisks2.clear();
     389    mData.mHardDiskMap.clear();
     390
     391    mData.mFloppyImages.clear();
     392    mData.mDVDImages.clear();
     393    mData.mHardDisks.clear();
    394394
    395395    mData.mProgressOperations.clear();
     
    401401     * some resources of the singletons which would prevent them from
    402402     * uninitializing (as for example, mSystemProperties which owns
    403      * HardDiskFormat objects which HardDisk2 objects refer to) */
     403     * HardDiskFormat objects which HardDisk objects refer to) */
    404404    if (mData.mSystemProperties)
    405405    {
     
    626626}
    627627
    628 STDMETHODIMP VirtualBox::COMGETTER(HardDisks2) (ComSafeArrayOut (IHardDisk2 *, aHardDisks))
     628STDMETHODIMP VirtualBox::COMGETTER(HardDisks) (ComSafeArrayOut (IHardDisk *, aHardDisks))
    629629{
    630630    if (ComSafeArrayOutIsNull (aHardDisks))
     
    636636    AutoReadLock alock (this);
    637637
    638     SafeIfaceArray <IHardDisk2> hardDisks (mData.mHardDisks2);
     638    SafeIfaceArray<IHardDisk> hardDisks (mData.mHardDisks);
    639639    hardDisks.detachTo (ComSafeArrayOutArg (aHardDisks));
    640640
     
    653653    AutoReadLock alock (this);
    654654
    655     SafeIfaceArray <IDVDImage> images (mData.mDVDImages2);
     655    SafeIfaceArray <IDVDImage> images (mData.mDVDImages);
    656656    images.detachTo (ComSafeArrayOutArg (aDVDImages));
    657657
     
    660660
    661661STDMETHODIMP
    662 VirtualBox::COMGETTER(FloppyImages) (ComSafeArrayOut (IFloppyImage2 *, aFloppyImages))
     662VirtualBox::COMGETTER(FloppyImages) (ComSafeArrayOut(IFloppyImage *, aFloppyImages))
    663663{
    664664    if (ComSafeArrayOutIsNull (aFloppyImages))
     
    670670    AutoReadLock alock (this);
    671671
    672     SafeIfaceArray <IFloppyImage2> images (mData.mFloppyImages2);
     672    SafeIfaceArray<IFloppyImage> images (mData.mFloppyImages);
    673673    images.detachTo (ComSafeArrayOutArg (aFloppyImages));
    674674
     
    10631063}
    10641064
    1065 STDMETHODIMP VirtualBox::CreateHardDisk2 (IN_BSTR aFormat,
    1066                                           IN_BSTR aLocation,
    1067                                           IHardDisk2 **aHardDisk)
     1065STDMETHODIMP VirtualBox::CreateHardDisk(IN_BSTR aFormat,
     1066                                        IN_BSTR aLocation,
     1067                                        IHardDisk **aHardDisk)
    10681068{
    10691069    CheckComArgStrNotEmptyOrNull (aFormat);
     
    10841084    HRESULT rc = E_FAIL;
    10851085
    1086     ComObjPtr <HardDisk2> hardDisk;
     1086    ComObjPtr<HardDisk> hardDisk;
    10871087    hardDisk.createObject();
    10881088    rc = hardDisk->init (this, format, aLocation);
     
    10941094}
    10951095
    1096 STDMETHODIMP VirtualBox::OpenHardDisk2 (IN_BSTR aLocation,
    1097                                         IHardDisk2 **aHardDisk)
     1096STDMETHODIMP VirtualBox::OpenHardDisk(IN_BSTR aLocation,
     1097                                      IHardDisk **aHardDisk)
    10981098{
    10991099    CheckComArgNotNull(aLocation);
     
    11071107    HRESULT rc = E_FAIL;
    11081108
    1109     ComObjPtr <HardDisk2> hardDisk;
     1109    ComObjPtr<HardDisk> hardDisk;
    11101110    hardDisk.createObject();
    11111111    rc = hardDisk->init (this, aLocation);
     
    11131113    if (SUCCEEDED (rc))
    11141114    {
    1115         rc = registerHardDisk2 (hardDisk);
     1115        rc = registerHardDisk (hardDisk);
    11161116
    11171117        /* Note that it's important to call uninit() on failure to register
     
    11281128}
    11291129
    1130 STDMETHODIMP VirtualBox::GetHardDisk2 (IN_GUID aId,
    1131                                        IHardDisk2 **aHardDisk)
     1130STDMETHODIMP VirtualBox::GetHardDisk(IN_GUID aId,
     1131                                     IHardDisk **aHardDisk)
    11321132{
    11331133    CheckComArgOutSafeArrayPointerValid(aHardDisk);
     
    11371137
    11381138    Guid id = aId;
    1139     ComObjPtr <HardDisk2> hardDisk;
    1140     HRESULT rc = findHardDisk2 (&id, NULL, true /* setError */, &hardDisk);
     1139    ComObjPtr<HardDisk> hardDisk;
     1140    HRESULT rc = findHardDisk(&id, NULL, true /* setError */, &hardDisk);
    11411141
    11421142    /* the below will set *aHardDisk to NULL if hardDisk is null */
     
    11461146}
    11471147
    1148 STDMETHODIMP VirtualBox::FindHardDisk2 (IN_BSTR aLocation,
    1149                                         IHardDisk2 **aHardDisk)
     1148STDMETHODIMP VirtualBox::FindHardDisk(IN_BSTR aLocation,
     1149                                      IHardDisk **aHardDisk)
    11501150{
    11511151    CheckComArgNotNull(aLocation);
     
    11551155    CheckComRCReturnRC (autoCaller.rc());
    11561156
    1157     ComObjPtr <HardDisk2> hardDisk;
    1158     HRESULT rc = findHardDisk2 (NULL, aLocation, true /* setError */, &hardDisk);
     1157    ComObjPtr<HardDisk> hardDisk;
     1158    HRESULT rc = findHardDisk(NULL, aLocation, true /* setError */, &hardDisk);
    11591159
    11601160    /* the below will set *aHardDisk to NULL if hardDisk is null */
     
    12331233/** @note Doesn't lock anything. */
    12341234STDMETHODIMP VirtualBox::OpenFloppyImage (IN_BSTR aLocation, IN_GUID aId,
    1235                                           IFloppyImage2 **aFloppyImage)
     1235                                          IFloppyImage **aFloppyImage)
    12361236{
    12371237    CheckComArgStrNotEmptyOrNull(aLocation);
     
    12481248        id.create();
    12491249
    1250     ComObjPtr <FloppyImage2> image;
     1250    ComObjPtr<FloppyImage> image;
    12511251    image.createObject();
    12521252    rc = image->init (this, aLocation, id);
     
    12641264/** @note Locks objects! */
    12651265STDMETHODIMP VirtualBox::GetFloppyImage (IN_GUID aId,
    1266                                          IFloppyImage2 **aFloppyImage)
     1266                                         IFloppyImage **aFloppyImage)
    12671267
    12681268{
     
    12731273
    12741274    Guid id = aId;
    1275     ComObjPtr <FloppyImage2> image;
    1276     HRESULT rc = findFloppyImage2 (&id, NULL, true /* setError */, &image);
     1275    ComObjPtr<FloppyImage> image;
     1276    HRESULT rc = findFloppyImage (&id, NULL, true /* setError */, &image);
    12771277
    12781278    /* the below will set *aFloppyImage to NULL if image is null */
     
    12841284/** @note Locks objects! */
    12851285STDMETHODIMP VirtualBox::FindFloppyImage (IN_BSTR aLocation,
    1286                                           IFloppyImage2 **aFloppyImage)
     1286                                          IFloppyImage **aFloppyImage)
    12871287{
    12881288    CheckComArgNotNull(aLocation);
     
    12921292    CheckComRCReturnRC (autoCaller.rc());
    12931293
    1294     ComObjPtr <FloppyImage2> image;
    1295     HRESULT rc = findFloppyImage2 (NULL, aLocation, true /* setError */, &image);
     1294    ComObjPtr<FloppyImage> image;
     1295    HRESULT rc = findFloppyImage(NULL, aLocation, true /* setError */, &image);
    12961296
    12971297    /* the below will set *aFloppyImage to NULL if img is null */
     
    26352635 */
    26362636HRESULT VirtualBox::
    2637 findHardDisk2 (const Guid *aId, CBSTR aLocation,
    2638                bool aSetError, ComObjPtr <HardDisk2> *aHardDisk /*= NULL*/)
     2637findHardDisk(const Guid *aId, CBSTR aLocation,
     2638             bool aSetError, ComObjPtr<HardDisk> *aHardDisk /*= NULL*/)
    26392639{
    26402640    AssertReturn (aId || aLocation, E_INVALIDARG);
     
    26452645    if (aId)
    26462646    {
    2647         HardDisk2Map::const_iterator it = mData.mHardDisk2Map.find (*aId);
    2648         if (it != mData.mHardDisk2Map.end())
     2647        HardDiskMap::const_iterator it = mData.mHardDiskMap.find (*aId);
     2648        if (it != mData.mHardDiskMap.end())
    26492649        {
    26502650            if (aHardDisk)
     
    26602660        Utf8Str location = aLocation;
    26612661
    2662         for (HardDisk2Map::const_iterator it = mData.mHardDisk2Map.begin();
    2663              it != mData.mHardDisk2Map.end();
     2662        for (HardDiskMap::const_iterator it = mData.mHardDiskMap.begin();
     2663             it != mData.mHardDiskMap.end();
    26642664             ++ it)
    26652665        {
    2666             const ComObjPtr <HardDisk2> &hd = (*it).second;
     2666            const ComObjPtr<HardDisk> &hd = (*it).second;
    26672667
    26682668            HRESULT rc = hd->compareLocationTo (location, result);
     
    27312731    bool found = false;
    27322732
    2733     for (DVDImageList::const_iterator it = mData.mDVDImages2.begin();
    2734          it != mData.mDVDImages2.end();
     2733    for (DVDImageList::const_iterator it = mData.mDVDImages.begin();
     2734         it != mData.mDVDImages.end();
    27352735         ++ it)
    27362736    {
     
    27672767
    27682768/**
    2769  * Searches for a FloppyImage2 object with the given ID or location in the
     2769 * Searches for a FloppyImage object with the given ID or location in the
    27702770 * collection of registered DVD images. If both ID and file path are specified,
    27712771 * the first object that matches either of them (not necessarily both) is
     
    27822782 * @note Locks this object and image objects for reading.
    27832783 */
    2784 HRESULT VirtualBox::findFloppyImage2 (const Guid *aId, CBSTR aLocation,
    2785                                       bool aSetError,
    2786                                       ComObjPtr <FloppyImage2> *aImage /* = NULL */)
     2784HRESULT VirtualBox::findFloppyImage(const Guid *aId, CBSTR aLocation,
     2785                                    bool aSetError,
     2786                                    ComObjPtr<FloppyImage> *aImage /* = NULL */)
    27872787{
    27882788    AssertReturn (aId || aLocation, E_INVALIDARG);
     
    28032803    bool found = false;
    28042804
    2805     for (FloppyImage2List::const_iterator it = mData.mFloppyImages2.begin();
    2806          it != mData.mFloppyImages2.end();
     2805    for (FloppyImageList::const_iterator it = mData.mFloppyImages.begin();
     2806         it != mData.mFloppyImages.end();
    28072807         ++ it)
    28082808    {
     
    29252925
    29262926    {
    2927         ComObjPtr <HardDisk2> hardDisk;
    2928         rc = findHardDisk2 (&aId, aLocation, false /* aSetError */, &hardDisk);
     2927        ComObjPtr<HardDisk> hardDisk;
     2928        rc = findHardDisk(&aId, aLocation, false /* aSetError */, &hardDisk);
    29292929        if (SUCCEEDED (rc))
    29302930        {
     
    29532953
    29542954    {
    2955         ComObjPtr <FloppyImage2> image;
    2956         rc = findFloppyImage2 (&aId, aLocation, false /* aSetError */, &image);
     2955        ComObjPtr<FloppyImage> image;
     2956        rc = findFloppyImage(&aId, aLocation, false /* aSetError */, &image);
    29572957        if (SUCCEEDED (rc))
    29582958        {
     
    30473047                 it != hardDisks.end(); ++ it)
    30483048            {
    3049                 ComObjPtr <HardDisk2> hardDisk;
     3049                ComObjPtr<HardDisk> hardDisk;
    30503050                hardDisk.createObject();
    30513051                rc = hardDisk->init (this, NULL, *it);
    30523052                CheckComRCBreakRC (rc);
    30533053
    3054                 rc = registerHardDisk2 (hardDisk, false /* aSaveRegistry */);
     3054                rc = registerHardDisk(hardDisk, false /* aSaveRegistry */);
    30553055                CheckComRCBreakRC (rc);
    30563056            }
     
    30813081                case 2: /* FloppyImages */
    30823082                {
    3083                     ComObjPtr <FloppyImage2> image;
     3083                    ComObjPtr<FloppyImage> image;
    30843084                    image.createObject();
    30853085                    rc = image->init (this, *it);
     
    31683168                Key hardDisksNode = registryNode.createKey ("HardDisks");
    31693169
    3170                 for (HardDisk2List::const_iterator it =
    3171                         mData.mHardDisks2.begin();
    3172                      it != mData.mHardDisks2.end();
     3170                for (HardDiskList::const_iterator it =
     3171                        mData.mHardDisks.begin();
     3172                     it != mData.mHardDisks.end();
    31733173                     ++ it)
    31743174                {
     
    31833183
    31843184                for (DVDImageList::const_iterator it =
    3185                         mData.mDVDImages2.begin();
    3186                      it != mData.mDVDImages2.end();
     3185                        mData.mDVDImages.begin();
     3186                     it != mData.mDVDImages.end();
    31873187                     ++ it)
    31883188                {
     
    31963196                Key imagesNode = registryNode.createKey ("FloppyImages");
    31973197
    3198                 for (FloppyImage2List::const_iterator it =
    3199                         mData.mFloppyImages2.begin();
    3200                      it != mData.mFloppyImages2.end();
     3198                for (FloppyImageList::const_iterator it =
     3199                        mData.mFloppyImages.begin();
     3200                     it != mData.mFloppyImages.end();
    32013201                     ++ it)
    32023202                {
     
    33073307 * @note Locks this object for writing and @a aHardDisk for reading.
    33083308 */
    3309 HRESULT VirtualBox::registerHardDisk2 (HardDisk2 *aHardDisk,
    3310                                        bool aSaveRegistry /*= true*/)
     3309HRESULT VirtualBox::registerHardDisk(HardDisk *aHardDisk,
     3310                                     bool aSaveRegistry /*= true*/)
    33113311{
    33123312    AssertReturn (aHardDisk != NULL, E_INVALIDARG);
     
    33403340    {
    33413341        /* base (root) hard disk */
    3342         mData.mHardDisks2.push_back (aHardDisk);
    3343     }
    3344 
    3345     mData.mHardDisk2Map
    3346         .insert (HardDisk2Map::value_type (
    3347             aHardDisk->id(), HardDisk2Map::mapped_type (aHardDisk)));
     3342        mData.mHardDisks.push_back (aHardDisk);
     3343    }
     3344
     3345    mData.mHardDiskMap
     3346        .insert (HardDiskMap::value_type (
     3347            aHardDisk->id(), HardDiskMap::mapped_type (aHardDisk)));
    33483348
    33493349    if (aSaveRegistry)
     
    33513351        rc = saveSettings();
    33523352        if (FAILED (rc))
    3353             unregisterHardDisk2 (aHardDisk, false /* aSaveRegistry */);
     3353            unregisterHardDisk(aHardDisk, false /* aSaveRegistry */);
    33543354    }
    33553355
     
    33723372 * @note Locks this object for writing and @a aHardDisk for reading.
    33733373 */
    3374 HRESULT VirtualBox::unregisterHardDisk2 (HardDisk2 *aHardDisk,
    3375                                          bool aSaveRegistry /*= true*/)
     3374HRESULT VirtualBox::unregisterHardDisk(HardDisk *aHardDisk,
     3375                                       bool aSaveRegistry /*= true*/)
    33763376{
    33773377    AssertReturn (aHardDisk != NULL, E_INVALIDARG);
     
    33873387    AutoReadLock hardDiskLock (aHardDisk);
    33883388
    3389     size_t cnt = mData.mHardDisk2Map.erase (aHardDisk->id());
     3389    size_t cnt = mData.mHardDiskMap.erase (aHardDisk->id());
    33903390    Assert (cnt == 1);
    33913391
     
    33933393    {
    33943394        /* base (root) hard disk */
    3395         mData.mHardDisks2.remove (aHardDisk);
     3395        mData.mHardDisks.remove (aHardDisk);
    33963396    }
    33973397
     
    34023402        rc = saveSettings();
    34033403        if (FAILED (rc))
    3404             registerHardDisk2 (aHardDisk, false /* aSaveRegistry */);
     3404            registerHardDisk(aHardDisk, false /* aSaveRegistry */);
    34053405    }
    34063406
     
    34533453
    34543454    /* add to the collection */
    3455     mData.mDVDImages2.push_back (aImage);
     3455    mData.mDVDImages.push_back (aImage);
    34563456
    34573457    if (aSaveRegistry)
     
    34953495    AutoReadLock imageLock (aImage);
    34963496
    3497     mData.mDVDImages2.remove (aImage);
     3497    mData.mDVDImages.remove (aImage);
    34983498
    34993499    HRESULT rc = S_OK;
     
    35243524 * @note Locks this object for writing and @a aImage for reading.
    35253525 */
    3526 HRESULT VirtualBox::registerFloppyImage (FloppyImage2 *aImage,
    3527                                          bool aSaveRegistry /*= true*/)
     3526HRESULT VirtualBox::registerFloppyImage(FloppyImage *aImage,
     3527                                        bool aSaveRegistry /*= true*/)
    35283528{
    35293529    AssertReturn (aImage != NULL, E_INVALIDARG);
     
    35543554
    35553555    /* add to the collection */
    3556     mData.mFloppyImages2.push_back (aImage);
     3556    mData.mFloppyImages.push_back (aImage);
    35573557
    35583558    if (aSaveRegistry)
     
    35813581 * @note Locks this object for writing and @a aImage for reading.
    35823582 */
    3583 HRESULT VirtualBox::unregisterFloppyImage (FloppyImage2 *aImage,
    3584                                            bool aSaveRegistry /*= true*/)
     3583HRESULT VirtualBox::unregisterFloppyImage(FloppyImage *aImage,
     3584                                          bool aSaveRegistry /*= true*/)
    35853585{
    35863586    AssertReturn (aImage != NULL, E_INVALIDARG);
     
    35963596    AutoReadLock imageLock (aImage);
    35973597
    3598     mData.mFloppyImages2.remove (aImage);
     3598    mData.mFloppyImages.remove (aImage);
    35993599
    36003600    HRESULT rc = S_OK;
     
    36203620 * @note Locks #childrenLock() for reading.
    36213621 */
    3622 HRESULT VirtualBox::cast (IHardDisk2 *aFrom, ComObjPtr <HardDisk2> &aTo)
     3622HRESULT VirtualBox::cast (IHardDisk *aFrom, ComObjPtr <HardDisk> &aTo)
    36233623{
    36243624    AssertReturn (aFrom != NULL, E_INVALIDARG);
     
    36393639     * implementations of IHardDisk can be among our children */
    36403640
    3641     aTo = static_cast <HardDisk2 *> (child);
     3641    aTo = static_cast<HardDisk*>(child);
    36423642
    36433643    return S_OK;
     
    36673667
    36683668    /* check DVD paths */
    3669     for (DVDImageList::iterator it = mData.mDVDImages2.begin();
    3670          it != mData.mDVDImages2.end();
     3669    for (DVDImageList::iterator it = mData.mDVDImages.begin();
     3670         it != mData.mDVDImages.end();
    36713671         ++ it)
    36723672    {
     
    36753675
    36763676    /* check Floppy paths */
    3677     for (FloppyImage2List::iterator it = mData.mFloppyImages2.begin();
    3678          it != mData.mFloppyImages2.end();
     3677    for (FloppyImageList::iterator it = mData.mFloppyImages.begin();
     3678         it != mData.mFloppyImages  .end();
    36793679         ++ it)
    36803680    {
     
    36833683
    36843684    /* check HardDisk paths */
    3685     for (HardDisk2List::const_iterator it = mData.mHardDisks2.begin();
    3686          it != mData.mHardDisks2.end();
     3685    for (HardDiskList::const_iterator it = mData.mHardDisks.begin();
     3686         it != mData.mHardDisks.end();
    36873687         ++ it)
    36883688    {
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r16853 r16867  
    437437
    438438      The first diagram shows what happens when a lengthy setup operation is
    439       being executed (such as <link to="IMachine::attachHardDisk2"/>).
     439      being executed (such as <link to="IMachine::attachHardDisk"/>).
    440440
    441441      <pre>
     
    11111111        <li><link to="DeviceType_HardDisk"/>: the media is a hard disk
    11121112        that, if registered, can be obtained using the
    1113         <link to="IVirtualBox::getHardDisk2"/> call.</li>
     1113        <link to="IVirtualBox::getHardDisk"/> call.</li>
    11141114        <li><link to="DeviceType_DVD"/>: the media is a CD/DVD image
    11151115        that, if registered, can be obtained using the
     
    13851385    </attribute>
    13861386
    1387     <attribute name="hardDisks2" type="IHardDisk2" readonly="yes" safearray="yes">
     1387    <attribute name="hardDisks" type="IHardDisk" readonly="yes" safearray="yes">
    13881388      <desc>
    13891389        Array of hard disk objects known to this VirtualBox installation.
     
    13911391        This array contains only base (root) hard disks. All differencing
    13921392        hard disks of the given base hard disk can be enumerated using
    1393         <link to="IHardDisk2::children"/>.
     1393        <link to="IHardDisk::children"/>.
    13941394      </desc>
    13951395    </attribute>
     
    14011401    </attribute>
    14021402
    1403     <attribute name="floppyImages" type="IFloppyImage2" readonly="yes" safearray="yes">
     1403    <attribute name="floppyImages" type="IFloppyImage" readonly="yes" safearray="yes">
    14041404      <desc>
    14051405        Array of floppy image objects registered with this VirtualBox instance.
     
    17381738    </method>
    17391739
    1740     <method name="createHardDisk2">
     1740    <method name="createHardDisk">
    17411741      <desc>
    17421742        Creates a new base hard disk object that will use the given storage
     
    17481748        allocate a format-specific storage unit at the specified location:
    17491749        <ul>
    1750           <li><link to="IHardDisk2::createDynamicStorage"/></li>
    1751           <li><link to="IHardDisk2::createFixedStorage"/></li>
    1752           <li><link to="IHardDisk2::createDiffStorage"/></li>
     1750          <li><link to="IHardDisk::createDynamicStorage"/></li>
     1751          <li><link to="IHardDisk::createFixedStorage"/></li>
     1752          <li><link to="IHardDisk::createDiffStorage"/></li>
    17531753        </ul>
    17541754
    1755         Some hard disk attributes, such as <link to="IHardDisk2::id"/>, may
     1755        Some hard disk attributes, such as <link to="IHardDisk::id"/>, may
    17561756        remain uninitialized until the hard disk storage unit is successfully
    17571757        created by one of the above methods.
     
    17591759        After the storage unit is successfully created, the hard disk gets
    17601760        remembered by this VirtualBox installation and will be accessible
    1761         through <link to="#getHardDisk2"/> and <link to="#findHardDisk2"/>
     1761        through <link to="#getHardDisk"/> and <link to="#findHardDisk"/>
    17621762        methods. Remembered root (base) hard disks are also returned as part of
    1763         the <link to="#hardDisks2"/> array. See IHardDisk2 for more details.
     1763        the <link to="#hardDisks"/> array. See IHardDisk for more details.
    17641764
    17651765        The list of all storage formats supported by this VirtualBox
     
    17711771
    17721772        Note that the format of the location string is storage format specific.
    1773         See <link to="IMedium::location"/>, IHardDisk2 and
     1773        See <link to="IMedium::location"/>, IHardDisk and
    17741774        <link to="ISystemProperties::defaultHardDiskFolder"/> for more details.
    17751775
     
    17951795        </desc>
    17961796      </param>
    1797       <param name="hardDisk" type="IHardDisk2" dir="return">
     1797      <param name="hardDisk" type="IHardDisk" dir="return">
    17981798        <desc>Created hard disk object.</desc>
    17991799      </param>
    18001800    </method>
    18011801
    1802     <method name="openHardDisk2">
     1802    <method name="openHardDisk">
    18031803      <desc>
    18041804        Opens a hard disk from an existing location.
     
    18061806        After the hard disk is successfully opened by this method, it gets
    18071807        remembered by (known to) this VirtualBox installation and will be
    1808         accessible through <link to="#getHardDisk2"/> and
    1809         <link to="#findHardDisk2"/> methods. Remembered root (base) hard disks
    1810         are also returned as part of the <link to="#hardDisks2"/> array and can
    1811         be attached to virtual machines. See IHardDisk2 for more details.
     1808        accessible through <link to="#getHardDisk"/> and
     1809        <link to="#findHardDisk"/> methods. Remembered root (base) hard disks
     1810        are also returned as part of the <link to="#hardDisks"/> array and can
     1811        be attached to virtual machines. See IHardDisk for more details.
    18121812
    18131813        If a differencing hard disk is to be opened by this method, the
     
    18201820
    18211821        Note that the format of the location string is storage format specific.
    1822         See <link to="IMedium::location"/>, IHardDisk2 and
     1822        See <link to="IMedium::location"/>, IHardDisk and
    18231823        <link to="ISystemProperties::defaultHardDiskFolder"/> for more details.
    18241824
     
    18411841        </desc>
    18421842      </param>
    1843       <param name="hardDisk" type="IHardDisk2" dir="return">
     1843      <param name="hardDisk" type="IHardDisk" dir="return">
    18441844        <desc>Opened hard disk object.</desc>
    18451845      </param>
    18461846    </method>
    18471847
    1848     <method name="getHardDisk2" const="yes">
     1848    <method name="getHardDisk" const="yes">
    18491849      <desc>
    18501850        Returns a hard disk with the given UUID.
     
    18521852        The hard disk with the given UUID must be known to this VirtualBox
    18531853        installation, i.e. it must be previously created by
    1854         <link to="#createHardDisk2"/> or opened by <link
    1855         to="#openHardDisk2"/>, or attached to some known virtual machine.
     1854        <link to="#createHardDisk"/> or opened by <link
     1855        to="#openHardDisk"/>, or attached to some known virtual machine.
    18561856
    18571857        <result name="VBOX_E_OBJECT_NOT_FOUND">
     
    18631863        <desc>UUID of the hard disk to look for.</desc>
    18641864      </param>
    1865       <param name="hardDisk" type="IHardDisk2" dir="return">
     1865      <param name="hardDisk" type="IHardDisk" dir="return">
    18661866        <desc>Found hard disk object.</desc>
    18671867      </param>
    18681868    </method>
    18691869
    1870     <method name="findHardDisk2">
     1870    <method name="findHardDisk">
    18711871      <desc>
    18721872        Returns a hard disk that uses the given location to store hard
     
    18751875        The given hard disk must be known to this VirtualBox installation, i.e.
    18761876        it must be previously created by
    1877         <link to="#createHardDisk2"/> or opened by <link
    1878         to="#openHardDisk2"/>, or attached to some known virtual machine.
     1877        <link to="#createHardDisk"/> or opened by <link
     1878        to="#openHardDisk"/>, or attached to some known virtual machine.
    18791879
    18801880        The search is done by comparing the value of the @a location argument to
    1881         the <link to="IHardDisk2::location"/> attribute of each known hard
     1881        the <link to="IHardDisk::location"/> attribute of each known hard
    18821882        disk.
    18831883
     
    18991899        <desc>Location string to search for.</desc>
    19001900      </param>
    1901       <param name="hardDisk" type="IHardDisk2" dir="return">
     1901      <param name="hardDisk" type="IHardDisk" dir="return">
    19021902        <desc>Found hard disk object.</desc>
    19031903      </param>
     
    20392039        </desc>
    20402040      </param>
    2041       <param name="image" type="IFloppyImage2" dir="return">
     2041      <param name="image" type="IFloppyImage" dir="return">
    20422042        <desc>Opened floppy image object.</desc>
    20432043      </param>
     
    20602060        <desc>UUID of the image to look for.</desc>
    20612061      </param>
    2062       <param name="image" type="IFloppyImage2" dir="return">
     2062      <param name="image" type="IFloppyImage" dir="return">
    20632063        <desc>Found floppy image object.</desc>
    20642064      </param>
     
    20952095        <desc>Floppy image file path to look for.</desc>
    20962096      </param>
    2097       <param name="image" type="IFloppyImage2" dir="return">
     2097      <param name="image" type="IFloppyImage" dir="return">
    20982098        <desc>Found floppy image object.</desc>
    20992099      </param>
     
    39353935    </attribute>
    39363936
    3937     <attribute name="hardDisk2Attachments" type="IHardDisk2Attachment" readonly="yes" safearray="yes">
     3937    <attribute name="hardDiskAttachments" type="IHardDiskAttachment" readonly="yes" safearray="yes">
    39383938      <desc>Array of hard disks attached to this machine.</desc>
    39393939    </attribute>
     
    42444244    </method>
    42454245
    4246     <method name="attachHardDisk2">
     4246    <method name="attachHardDisk">
    42474247      <desc>
    42484248        Attaches a virtual hard disk identified by the given UUID @a id
     
    42654265        this method will fail.
    42664266
    4267         See <link to="IHardDisk2"/> for more detailed information about
     4267        See <link to="IHardDisk"/> for more detailed information about
    42684268        attaching hard disks.
    42694269
     
    43124312    </method>
    43134313
    4314     <method name="getHardDisk2" const="yes">
     4314    <method name="getHardDisk" const="yes">
    43154315      <desc>
    43164316        Returns the virtual hard disk attached to a device slot of the specified
     
    43184318
    43194319        Note that if the hard disk was indirectly attached by
    4320         <link to="#attachHardDisk2"/> to the given device slot then this
     4320        <link to="#attachHardDisk"/> to the given device slot then this
    43214321        method will return not the same object as passed to the
    4322         <link to="#attachHardDisk2"/> call. See <link to="IHardDisk2"/> for
     4322        <link to="#attachHardDisk"/> call. See <link to="IHardDisk"/> for
    43234323        more detailed information about attaching hard disks.
    43244324
     
    43374337        <desc>Device slot in the given channel to query.</desc>
    43384338      </param>
    4339       <param name="hardDisk" type="IHardDisk2" dir="return">
     4339      <param name="hardDisk" type="IHardDisk" dir="return">
    43404340        <desc>Attached hard disk object.</desc>
    43414341      </param>
    43424342    </method>
    43434343
    4344     <method name="detachHardDisk2">
     4344    <method name="detachHardDisk">
    43454345      <desc>
    43464346        Detaches the virtual hard disk attached to a device slot of the
     
    43504350        that the hard disk remains associated with the machine when this method
    43514351        returns and gets actually de-associated only after a successful
    4352         <link to="#saveSettings"/> call. See <link to="IHardDisk2"/>
     4352        <link to="#saveSettings"/> call. See <link to="IHardDisk"/>
    43534353        for more detailed information about attaching hard disks.
    43544354
     
    43584358        <note>
    43594359          Detaching differencing hard disks implicitly created by <link
    4360           to="#attachHardDisk2"/> for the indirect attachment using this
     4360          to="#attachHardDisk"/> for the indirect attachment using this
    43614361          method will <b>not</b> implicitly delete them. The
    4362           <link to="IHardDisk2::deleteStorage"/> operation should be
     4362          <link to="IHardDisk::deleteStorage"/> operation should be
    43634363          explicitly performed by the caller after the hard disk is successfully
    43644364          detached and the settings are saved with
     
    69506950
    69516951        <see>
    6952           IHardDisk2,
    6953           <link to="IVirtualBox::createHardDisk2"/>,
    6954           <link to="IVirtualBox::openHardDisk2"/>,
     6952          IHardDisk,
     6953          <link to="IVirtualBox::createHardDisk"/>,
     6954          <link to="IVirtualBox::openHardDisk"/>,
    69556955          <link to="IMedium::location"/>
    69566956        </see>
     
    69656965        Keep in mind that the hard disk format identifier
    69666966        (<link to="IHardDiskFormat::id"/>) used in other API calls like
    6967         <link to="IVirtualBox::createHardDisk2"/> to refer to a particular
     6967        <link to="IVirtualBox::createHardDisk"/> to refer to a particular
    69686968        hard disk format is a case-insensitive string. This means that, for
    69696969        example, all of the following strings:
     
    69906990        The hard disk format set by this attribute is used by VirtualBox
    69916991        when the hard disk format was not specified explicitly. One example is
    6992         <link to="IVirtualBox::createHardDisk2"/> with the <tt>null</tt>
     6992        <link to="IVirtualBox::createHardDisk"/> with the <tt>null</tt>
    69936993        format argument. A more complex example is implicit creation of
    69946994        differencing hard disks when taking a snapshot of a virtual machine:
     
    70147014          <link to="#hardDiskFormats"/>,
    70157015          <link to="IHardDiskFormat::id"/>,
    7016           <link to="IVirtualBox::createHardDisk2"/>
     7016          <link to="IVirtualBox::createHardDisk"/>
    70177017        </see>
    70187018      </desc>
     
    74757475      Snapshots can be chained. Chained snapshots form a branch where
    74767476      every next snapshot is based on the previous one. This chaining is
    7477       mostly related to hard disk branching (see <link to="IHardDisk2"/>
     7477      mostly related to hard disk branching (see <link to="IHardDisk"/>
    74787478      description). This means that every time a new snapshot is created,
    74797479      a new differencing hard disk is implicitly created for all normal
     
    77227722      interface such as:
    77237723      <ul>
    7724         <li>IHardDisk2 (virtual hard disks)</li>
     7724        <li>IHardDisk (virtual hard disks)</li>
    77257725        <li>IDVDImage (standard CD/DVD ISO image files)</li>
    7726         <li>IFloppyImage2 (raw floppy image files)</li>
     7726        <li>IFloppyImage (raw floppy image files)</li>
    77277727      </ul>
    77287728
     
    77307730      media type:
    77317731      <ul>
    7732         <li><link to="IVirtualBox::openHardDisk2"/></li>
     7732        <li><link to="IVirtualBox::openHardDisk"/></li>
    77337733        <li><link to="IVirtualBox::openDVDImage"/></li>
    77347734        <li><link to="IVirtualBox::openFloppyImage"/></li>
     
    77367736
    77377737      New hard disk media are created using the
    7738       <link to="IVirtualBox::createHardDisk2"/> method. CD/DVD and floppy
     7738      <link to="IVirtualBox::createHardDisk"/> method. CD/DVD and floppy
    77397739      images are created outside VirtualBox, usually by storing a copy
    77407740      of the real medium of the corresponding type in a regular file.
     
    77497749
    77507750      Newly created virtual hard disks get remembered only when the associated
    7751       storage unit is actually created (see IHardDisk2 for more details).
     7751      storage unit is actually created (see IHardDisk for more details).
    77527752
    77537753      All known media can be enumerated using
    7754       <link to="IVirtualBox::hardDisks2"/>,
     7754      <link to="IVirtualBox::hardDisks"/>,
    77557755      <link to="IVirtualBox::DVDImages"/> and
    77567756      <link to="IVirtualBox::floppyImages"/> attributes. Individual media can be
    7757       quickly found by UUID using <link to="IVirtualBox::getHardDisk2"/>
     7757      quickly found by UUID using <link to="IVirtualBox::getHardDisk"/>
    77587758      and similar methods or by location using
    7759       <link to="IVirtualBox::findHardDisk2"/> and similar methods.
     7759      <link to="IVirtualBox::findHardDisk"/> and similar methods.
    77607760
    77617761      Only known media can be attached to virtual machines.
     
    78537853        <link to="MediaState_LockedWrite"/>, <link to="MediaState_Creating"/>,
    78547854        <link to="MediaState_Deleting"/> are meaningless for IDVDImage and
    7855         IFloppyImage2 media.
     7855        IFloppyImage media.
    78567856      </desc>
    78577857    </attribute>
     
    81248124        deleted. In particular, this means that this hard disk can be
    81258125        later opened again using the <link
    8126         to="IVirtualBox::openHardDisk2"/> call.
     8126        to="IVirtualBox::openHardDisk"/> call.
    81278127
    81288128        Note that after this method successfully returns, the given hard
     
    81528152
    81538153  <!--
    8154   // IHardDisk2
     8154  // IHardDisk
    81558155  /////////////////////////////////////////////////////////////////////////
    81568156  -->
     
    81868186
    81878187  <interface
    8188     name="IHardDisk2Attachment" extends="$unknown"
    8189     uuid="fa2f4619-2c14-4090-869e-73b45419b7b5"
     8188    name="IHardDiskAttachment" extends="$unknown"
     8189    uuid="b1dd04bb-93c0-4ad3-a9cf-82316e595836"
    81908190    wsmap="struct"
    81918191  >
    81928192    <desc>
    8193       The IHardDisk2Attachment interface represents a hard disk attachment of a
     8193      The IHardDiskAttachment interface represents a hard disk attachment of a
    81948194      virtual machine.
    81958195
     
    81988198
    81998199      The array of hard disk attachments is returned by
    8200       <link to="IMachine::hardDisk2Attachments"/>.
     8200      <link to="IMachine::hardDiskAttachments"/>.
    82018201
    82028202      <note>
     
    82068206      </note>
    82078207    </desc>
    8208     <attribute name="hardDisk" type="IHardDisk2" readonly="yes">
     8208    <attribute name="hardDisk" type="IHardDisk" readonly="yes">
    82098209      <desc>Hard disk object associated with this attachment.</desc>
    82108210    </attribute>
     
    82258225
    82268226  <interface
    8227     name="IHardDisk2" extends="IMedium"
    8228     uuid="ed6e2525-c2fd-42a4-917a-7a9045ac9e15"
     8227    name="IHardDisk" extends="IMedium"
     8228    uuid="244f89fe-1943-464d-baad-2efd73e5d532"
    82298229    wsmap="managed"
    82308230  >
    82318231    <desc>
    8232       The IHardDisk2 interface represents a virtual hard disk drive
    8233       used by a virtual machine.
     8232      The IHardDisk interface represents a virtual hard disk drive
     8233      used by a virtual machine. This is a subclass of <link to="IMedium" />; see remarks there.
    82348234
    82358235      Virtual hard disk objects virtualize the hard disk hardware and look like
     
    82778277
    82788278      New base hard disks are created using
    8279       <link to="IVirtualBox::createHardDisk2"/>. Existing hard disks are
    8280       opened using <link to="IVirtualBox::openHardDisk2"/>. Differencing hard
     8279      <link to="IVirtualBox::createHardDisk"/>. Existing hard disks are
     8280      opened using <link to="IVirtualBox::openHardDisk"/>. Differencing hard
    82818281      disks are usually implicitly created by VirtualBox when needed but may
    82828282      also be created explicitly using <link to="#createDiffStorage"/>.
     
    82858285      or opened, it becomes a known hard disk (remembered in the internal media
    82868286      registry). Known hard disks can be attached to a virtual machine, accessed
    8287       through <link to="IVirtualBox::getHardDisk2"/> and
    8288       <link to="IVirtualBox::findHardDisk2"/> methods or enumerated using the
    8289       <link to="IVirtualBox::hardDisks2"/> array (only for base hard disks).
     8287      through <link to="IVirtualBox::getHardDisk"/> and
     8288      <link to="IVirtualBox::findHardDisk"/> methods or enumerated using the
     8289      <link to="IVirtualBox::hardDisks"/> array (only for base hard disks).
    82908290
    82918291      The following methods, besides <link to="IMedium::close"/>,
     
    83278327
    83288328      Hard disks are attached to virtual machines using the
    8329       <link to="IMachine::attachHardDisk2"/> method and detached using the
    8330       <link to="IMachine::detachHardDisk2"/> method. Depending on their
     8329      <link to="IMachine::attachHardDisk"/> method and detached using the
     8330      <link to="IMachine::detachHardDisk"/> method. Depending on their
    83318331      <link to="#type"/>, hard disks are attached either
    83328332      <i>directly</i> or <i>indirectly</i>.
     
    83378337      hard disk linked to it is implicitly created and this differencing hard
    83388338      disk is associated with the machine and used for hard disk operations.
    8339       This also means that if <link to="IMachine::attachHardDisk2"/> performs
     8339      This also means that if <link to="IMachine::attachHardDisk"/> performs
    83408340      a direct attachment then the same hard disk will be returned in response
    8341       to the subsequent  <link to="IMachine::getHardDisk2"/> call; however if
     8341      to the subsequent  <link to="IMachine::getHardDisk"/> call; however if
    83428342      an indirect attachment is performed then
    8343       <link to="IMachine::getHardDisk2"/> will return the implicitly created
     8343      <link to="IMachine::getHardDisk"/> will return the implicitly created
    83448344      differencing hard disk, not the original one passed to <link
    8345       to="IMachine::attachHardDisk2"/>. The following table shows the
     8345      to="IMachine::attachHardDisk"/>. The following table shows the
    83468346      dependency of the attachment type on the hard disk type:
    83478347
     
    84048404      Detaching hard disks is performed in a <i>deferred</i> fashion. This means
    84058405      that the given hard disk remains associated with the given machine after a
    8406       successful <link to="IMachine::detachHardDisk2"/> call until
     8406      successful <link to="IMachine::detachHardDisk"/> call until
    84078407      <link to="IMachine::saveSettings"/> is called to save all changes to
    84088408      machine settings to disk. This deferring is necessary to guarantee that
     
    84158415      <link to="IMachine::saveSettings"/> is made, it will implicitly delete
    84168416      all differencing hard disks implicitly created by
    8417       <link to="IMachine::attachHardDisk2"/> for these indirect attachments.
     8417      <link to="IMachine::attachHardDisk"/> for these indirect attachments.
    84188418      Such implicitly created hard disks will also be immediately deleted when
    8419       detached explicitly using the <link to="IMachine::detachHardDisk2"/>
     8419      detached explicitly using the <link to="IMachine::detachHardDisk"/>
    84208420      call if it is made before <link to="IMachine::saveSettings"/>. This
    84218421      implicit deletion is safe because newly created differencing hard
     
    84238423
    84248424      However, keep in mind that detaching differencing hard disks that were
    8425       implicitly created by <link to="IMachine::attachHardDisk2"/>
     8425      implicitly created by <link to="IMachine::attachHardDisk"/>
    84268426      before the last <link to="IMachine::saveSettings"/> call will
    84278427      <b>not</b> implicitly delete them as they may already contain some data
     
    85418541    </attribute>
    85428542
    8543     <attribute name="parent" type="IHardDisk2" readonly="yes">
     8543    <attribute name="parent" type="IHardDisk" readonly="yes">
    85448544      <desc>
    85458545        Parent of this hard disk (a hard disk this hard disk is directly based
     
    85518551    </attribute>
    85528552
    8553     <attribute name="children" type="IHardDisk2" safearray="yes" readonly="yes">
     8553    <attribute name="children" type="IHardDisk" safearray="yes" readonly="yes">
    85548554      <desc>
    85558555        Children of this hard disk (all differencing hard disks directly based
     
    85598559    </attribute>
    85608560
    8561     <attribute name="root" type="IHardDisk2" readonly="yes">
     8561    <attribute name="root" type="IHardDisk" readonly="yes">
    85628562      <desc>
    85638563        Root hard disk of this hard disk.
     
    88758875        </result>
    88768876      </desc>
    8877       <param name="target" type="IHardDisk2" dir="in">
     8877      <param name="target" type="IHardDisk" dir="in">
    88788878        <desc>Target hard disk.</desc>
    88798879      </param>
     
    89898989        </note>
    89908990      </desc>
    8991       <param name="target" type="IHardDisk2" dir="in">
     8991      <param name="target" type="IHardDisk" dir="in">
    89928992        <desc>Target hard disk.</desc>
    89938993      </param>
     
    90229022        </note>
    90239023      </desc>
    9024       <param name="target" type="IHardDisk2" dir="in">
     9024      <param name="target" type="IHardDisk" dir="in">
    90259025        <desc>Target hard disk.</desc>
    90269026      </param>
     
    91169116      <desc>
    91179117        Supports being used as a format for differencing hard disks (see <link
    9118         to="IHardDisk2::createDiffStorage"/>).
     9118        to="IHardDisk::createDiffStorage"/>).
    91199119      </desc>
    91209120    </const>
     
    91619161        Each hard disk format is identified by a string represented by the
    91629162        <link to="#id"/> attribute. This string is used in calls like
    9163         <link to="IVirtualBox::createHardDisk2"/> to specify the desired
     9163        <link to="IVirtualBox::createHardDisk"/> to specify the desired
    91649164        format.
    91659165
     
    91679167        <link to="ISystemProperties::hardDiskFormats"/>.
    91689168
    9169         <see>IHardDisk2</see>
     9169        <see>IHardDisk</see>
    91709170    </desc>
    91719171
     
    91859185        This string is used in methods of other interfaces where it is necessary
    91869186        to specify a hard disk format, such as
    9187         <link to="IVirtualBox::createHardDisk2"/>.
     9187        <link to="IVirtualBox::createHardDisk"/>.
    91889188      </desc>
    91899189    </attribute>
     
    92599259
    92609260  <!--
    9261   // IFloppyImage2
     9261  // IFloppyImage
    92629262  /////////////////////////////////////////////////////////////////////////
    92639263  -->
    92649264
    92659265  <interface
    9266     name="IFloppyImage2" extends="IMedium"
    9267     uuid="fcdee8f0-03f9-11dd-95ff-0800200c9a66"
     9266    name="IFloppyImage" extends="IMedium"
     9267    uuid="faa6101f-078c-4b3a-ab75-75670c8170b3"
    92689268    wsmap="managed"
    92699269  >
    92709270    <desc>
    9271       The IFloppyImage2 interface represents a medium containing the image
    9272       of a floppy disk.
     9271      The IFloppyImage interface represents a medium containing the image
     9272      of a floppy disk. This is a subclass of <link to="IMedium" />; see remarks there.
    92739273    </desc>
    92749274
     
    94199419    <method name="getImage">
    94209420      <desc>Returns the currently mounted floppy image.</desc>
    9421       <param name="image" type="IFloppyImage2" dir="return"/>
     9421      <param name="image" type="IFloppyImage" dir="return"/>
    94229422    </method>
    94239423
  • trunk/src/VBox/Main/include/FloppyDriveImpl.h

    r15991 r16867  
    5656
    5757        BOOL enabled;
    58         ComObjPtr <FloppyImage2> image;
     58        ComObjPtr<FloppyImage> image;
    5959        ComPtr <IHostFloppyDrive> hostDrive;
    6060        DriveState_T state;
     
    9494    STDMETHOD(CaptureHostDrive) (IHostFloppyDrive *aHostFloppyDrive);
    9595    STDMETHOD(Unmount)();
    96     STDMETHOD(GetImage) (IFloppyImage2 **aFloppyImage);
     96    STDMETHOD(GetImage) (IFloppyImage **aFloppyImage);
    9797    STDMETHOD(GetHostDrive) (IHostFloppyDrive **aHostFloppyDrive);
    9898
  • trunk/src/VBox/Main/include/HardDiskAttachmentImpl.h

    r14949 r16867  
    2525#include "VirtualBoxBase.h"
    2626
    27 #include "HardDisk2Impl.h"
     27#include "HardDiskImpl.h"
    2828
    29 class ATL_NO_VTABLE HardDisk2Attachment :
     29class ATL_NO_VTABLE HardDiskAttachment :
    3030    public VirtualBoxBaseNEXT,
    31     public com::SupportErrorInfoImpl <HardDisk2Attachment, IHardDisk2Attachment>,
    32     public VirtualBoxSupportTranslation <HardDisk2Attachment>,
    33     public IHardDisk2Attachment
     31    public com::SupportErrorInfoImpl<HardDiskAttachment, IHardDiskAttachment>,
     32    public VirtualBoxSupportTranslation<HardDiskAttachment>,
     33    public IHardDiskAttachment
    3434{
    3535public:
     
    3737    /** Equality predicate for stdc++. */
    3838    struct EqualsTo
    39         : public std::unary_function <ComObjPtr <HardDisk2Attachment>, bool>
     39        : public std::unary_function <ComObjPtr<HardDiskAttachment>, bool>
    4040    {
    4141        explicit EqualsTo (StorageBus_T aBus, LONG aChannel, LONG aDevice)
     
    5555    /** Hard disk reference predicate for stdc++. */
    5656    struct RefersTo
    57         : public std::unary_function <ComObjPtr <HardDisk2Attachment>, bool>
     57        : public std::unary_function< ComObjPtr<HardDiskAttachment>, bool>
    5858    {
    59         explicit RefersTo (HardDisk2 *aHardDisk) : hardDisk (aHardDisk) {}
     59        explicit RefersTo (HardDisk *aHardDisk) : hardDisk (aHardDisk) {}
    6060
    6161        bool operator() (const argument_type &aThat) const
     
    6464        }
    6565
    66         const ComObjPtr <HardDisk2> hardDisk;
     66        const ComObjPtr <HardDisk> hardDisk;
    6767    };
    6868
    69     DECLARE_NOT_AGGREGATABLE(HardDisk2Attachment)
     69    DECLARE_NOT_AGGREGATABLE(HardDiskAttachment)
    7070
    7171    DECLARE_PROTECT_FINAL_CONSTRUCT()
    7272
    73     BEGIN_COM_MAP (HardDisk2Attachment)
     73    BEGIN_COM_MAP (HardDiskAttachment)
    7474        COM_INTERFACE_ENTRY(ISupportErrorInfo)
    75         COM_INTERFACE_ENTRY(IHardDisk2Attachment)
     75        COM_INTERFACE_ENTRY(IHardDiskAttachment)
    7676    END_COM_MAP()
    7777
     
    8282
    8383    // public initializer/uninitializer for internal purposes only
    84     HRESULT init (HardDisk2 *aHD, StorageBus_T aBus, LONG aChannel,
    85                   LONG aDevice, bool aImplicit = false);
     84    HRESULT init(HardDisk *aHD, StorageBus_T aBus, LONG aChannel,
     85                 LONG aDevice, bool aImplicit = false);
    8686    void uninit();
    8787
    88     // IHardDisk2Attachment properties
    89     STDMETHOD(COMGETTER(HardDisk))   (IHardDisk2 **aHardDisk);
     88    // IHardDiskAttachment properties
     89    STDMETHOD(COMGETTER(HardDisk))   (IHardDisk **aHardDisk);
    9090    STDMETHOD(COMGETTER(Bus))        (StorageBus_T *aBus);
    9191    STDMETHOD(COMGETTER(Channel))    (LONG *aChannel);
     
    9898    void setImplicit (bool aImplicit) { m.implicit = aImplicit; }
    9999
    100     const ComObjPtr <HardDisk2> &hardDisk() const { return m.hardDisk; }
     100    const ComObjPtr<HardDisk> &hardDisk() const { return m.hardDisk; }
    101101    StorageBus_T bus() const { return m.bus; }
    102102    LONG channel() const { return m.channel; }
     
    104104
    105105    /** Must be called from under this object's write lock.  */
    106     void updateHardDisk (const ComObjPtr <HardDisk2> &aHardDisk, bool aImplicit)
     106    void updateHardDisk (const ComObjPtr<HardDisk> &aHardDisk, bool aImplicit)
    107107    {
    108108        m.hardDisk = aHardDisk;
     
    111111
    112112    /** For com::SupportErrorInfoImpl. */
    113     static const char *ComponentName() { return "HardDisk2Attachment"; }
     113    static const char *ComponentName() { return "HardDiskAttachment"; }
    114114
    115115private:
     
    122122        /// @todo NEWMEDIA shouldn't it be constant too? It'd be nice to get
    123123        /// rid of locks at all in this simple readonly structure-like interface
    124         ComObjPtr <HardDisk2> hardDisk;
     124        ComObjPtr<HardDisk> hardDisk;
    125125        const StorageBus_T bus;
    126126        const LONG channel;
  • trunk/src/VBox/Main/include/HardDiskFormatImpl.h

    r14949 r16867  
    3737 * (IHardDiskFormat interface).
    3838 *
    39  * @note Instances of this class are permanently caller-referenced by HardDisk2
     39 * @note Instances of this class are permanently caller-referenced by HardDisk
    4040 * objects (through addCaller()) so that an attempt to uninitialize or delete
    41  * them before all HardDisk2 objects are uninitialized will produce an endless
     41 * them before all HardDisk objects are uninitialized will produce an endless
    4242 * wait!
    4343 */
  • trunk/src/VBox/Main/include/HardDiskImpl.h

    r16850 r16867  
    2222 */
    2323
    24 #ifndef ____H_HARDDISK2IMPL
    25 #define ____H_HARDDISK2IMPL
     24#ifndef ____H_HARDDISKIMPL
     25#define ____H_HARDDISKIMPL
    2626
    2727#include "VirtualBoxBase.h"
     
    4242
    4343/**
    44  * The HardDisk2 component class implements the IHardDisk2 interface.
     44 * The HardDisk component class implements the IHardDisk interface.
    4545 */
    46 class ATL_NO_VTABLE HardDisk2
    47     : public com::SupportErrorInfoDerived <MediumBase, HardDisk2, IHardDisk2>
    48     , public VirtualBoxBaseWithTypedChildrenNEXT <HardDisk2>
    49     , public VirtualBoxSupportTranslation <HardDisk2>
    50     , public IHardDisk2
     46class ATL_NO_VTABLE HardDisk
     47    : public com::SupportErrorInfoDerived<MediumBase, HardDisk, IHardDisk>
     48    , public VirtualBoxBaseWithTypedChildrenNEXT<HardDisk>
     49    , public VirtualBoxSupportTranslation<HardDisk>
     50    , public IHardDisk
    5151{
    5252public:
    5353
    54     typedef VirtualBoxBaseWithTypedChildrenNEXT <HardDisk2>::DependentChildren
     54    typedef VirtualBoxBaseWithTypedChildrenNEXT <HardDisk>::DependentChildren
    5555        List;
    5656
    5757    class MergeChain;
    5858
    59     VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (HardDisk2)
    60 
    61     DECLARE_NOT_AGGREGATABLE (HardDisk2)
     59    VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (HardDisk)
     60
     61    DECLARE_NOT_AGGREGATABLE (HardDisk)
    6262
    6363    DECLARE_PROTECT_FINAL_CONSTRUCT()
    6464
    65     BEGIN_COM_MAP (HardDisk2)
     65    BEGIN_COM_MAP (HardDisk)
    6666        COM_INTERFACE_ENTRY (ISupportErrorInfo)
    6767        COM_INTERFACE_ENTRY2 (IMedium, MediumBase)
    68         COM_INTERFACE_ENTRY (IHardDisk2)
     68        COM_INTERFACE_ENTRY (IHardDisk)
    6969    END_COM_MAP()
    7070
    7171    NS_DECL_ISUPPORTS
    7272
    73     DECLARE_EMPTY_CTOR_DTOR (HardDisk2)
     73    DECLARE_EMPTY_CTOR_DTOR (HardDisk)
    7474
    7575    HRESULT FinalConstruct();
     
    8181    HRESULT init (VirtualBox *aVirtualBox,
    8282                  CBSTR aLocation);
    83     HRESULT init (VirtualBox *aVirtualBox, HardDisk2 *aParent,
     83    HRESULT init (VirtualBox *aVirtualBox, HardDisk *aParent,
    8484                  const settings::Key &aNode);
    8585    void uninit();
     
    8888    COM_FORWARD_IMedium_TO_BASE (MediumBase)
    8989
    90     // IHardDisk2 properties
     90    // IHardDisk properties
    9191    STDMETHOD(COMGETTER(Format)) (BSTR *aFormat);
    9292    STDMETHOD(COMGETTER(Type)) (HardDiskType_T *aType);
    9393    STDMETHOD(COMSETTER(Type)) (HardDiskType_T aType);
    94     STDMETHOD(COMGETTER(Parent)) (IHardDisk2 **aParent);
    95     STDMETHOD(COMGETTER(Children)) (ComSafeArrayOut (IHardDisk2 *, aChildren));
    96     STDMETHOD(COMGETTER(Root)) (IHardDisk2 **aRoot);
     94    STDMETHOD(COMGETTER(Parent)) (IHardDisk **aParent);
     95    STDMETHOD(COMGETTER(Children)) (ComSafeArrayOut (IHardDisk *, aChildren));
     96    STDMETHOD(COMGETTER(Root)) (IHardDisk **aRoot);
    9797    STDMETHOD(COMGETTER(ReadOnly)) (BOOL *aReadOnly);
    9898    STDMETHOD(COMGETTER(LogicalSize)) (ULONG64 *aLogicalSize);
    9999
    100     // IHardDisk2 methods
     100    // IHardDisk methods
    101101    STDMETHOD(GetProperty) (IN_BSTR aName, BSTR *aValue);
    102102    STDMETHOD(SetProperty) (IN_BSTR aName, IN_BSTR aValue);
     
    109109    STDMETHOD(CreateFixedStorage) (ULONG64 aLogicalSize, IProgress **aProgress);
    110110    STDMETHOD(DeleteStorage) (IProgress **aProgress);
    111     STDMETHOD(CreateDiffStorage) (IHardDisk2 *aTarget, IProgress **aProgress);
     111    STDMETHOD(CreateDiffStorage) (IHardDisk *aTarget, IProgress **aProgress);
    112112    STDMETHOD(MergeTo) (IN_GUID aTargetId, IProgress **aProgress);
    113     STDMETHOD(CloneTo) (IHardDisk2 *aTarget, IProgress **aProgress);
    114     STDMETHOD(FlattenTo) (IHardDisk2 *aTarget, IProgress **aProgress);
     113    STDMETHOD(CloneTo) (IHardDisk *aTarget, IProgress **aProgress);
     114    STDMETHOD(FlattenTo) (IHardDisk *aTarget, IProgress **aProgress);
    115115    STDMETHOD(Compact) (IProgress **aProgress);
    116116
     
    124124    void updatePaths (const char *aOldPath, const char *aNewPath);
    125125
    126     ComObjPtr <HardDisk2> root (uint32_t *aLevel = NULL);
     126    ComObjPtr<HardDisk> root (uint32_t *aLevel = NULL);
    127127
    128128    bool isReadOnly();
     
    150150     * completion and implies the progress object will be used for waiting.
    151151     */
    152     HRESULT createDiffStorageNoWait (ComObjPtr <HardDisk2> &aTarget,
     152    HRESULT createDiffStorageNoWait (ComObjPtr<HardDisk> &aTarget,
    153153                                     ComObjPtr <Progress> &aProgress)
    154154    { return createDiffStorage (aTarget, &aProgress, false /* aWait */); }
     
    158158     * blocking the current thread.
    159159     */
    160     HRESULT createDiffStorageAndWait (ComObjPtr <HardDisk2> &aTarget,
     160    HRESULT createDiffStorageAndWait (ComObjPtr<HardDisk> &aTarget,
    161161                                      ComObjPtr <Progress> *aProgress = NULL)
    162162    { return createDiffStorage (aTarget, aProgress, true /* aWait */); }
    163163
    164     HRESULT prepareMergeTo (HardDisk2 *aTarget, MergeChain * &aChain,
     164    HRESULT prepareMergeTo (HardDisk *aTarget, MergeChain * &aChain,
    165165                            bool aIgnoreAttachments = false);
    166166
     
    195195    // a caller and a read lock before calling them!)
    196196
    197     ComObjPtr <HardDisk2> parent() const { return static_cast <HardDisk2 *> (mParent); }
     197    ComObjPtr <HardDisk> parent() const { return static_cast <HardDisk *> (mParent); }
    198198    HardDiskType_T type() const { return mm.type; }
    199199
    200200    /** For com::SupportErrorInfoImpl. */
    201     static const char *ComponentName() { return "HardDisk2"; }
     201    static const char *ComponentName() { return "HardDisk"; }
    202202
    203203protected:
     
    205205    HRESULT deleteStorage (ComObjPtr <Progress> *aProgress, bool aWait);
    206206
    207     HRESULT createDiffStorage (ComObjPtr <HardDisk2> &aTarget,
     207    HRESULT createDiffStorage (ComObjPtr <HardDisk> &aTarget,
    208208                               ComObjPtr <Progress> *aProgress,
    209209                               bool aWait);
     
    262262
    263263    /** weak parent */
    264     ComObjPtr <HardDisk2, ComWeakRef> mParent;
     264    ComObjPtr <HardDisk, ComWeakRef> mParent;
    265265
    266266    struct Task;
     
    307307};
    308308
    309 #endif /* ____H_HARDDISK2IMPL */
     309#endif /* ____H_HARDDISKIMPL */
    310310
    311311/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/include/MachineImpl.h

    r15582 r16867  
    290290        bool operator== (const HDData &that) const;
    291291
    292         typedef std::list <ComObjPtr <HardDisk2Attachment> > AttachmentList;
     292        typedef std::list< ComObjPtr<HardDiskAttachment> > AttachmentList;
    293293        AttachmentList mAttachments;
    294294    };
     
    503503    STDMETHOD(COMGETTER(SnapshotFolder))(BSTR *aSavedStateFolder);
    504504    STDMETHOD(COMSETTER(SnapshotFolder))(IN_BSTR aSavedStateFolder);
    505     STDMETHOD(COMGETTER(HardDisk2Attachments))(ComSafeArrayOut (IHardDisk2Attachment *, aAttachments));
     505    STDMETHOD(COMGETTER(HardDiskAttachments))(ComSafeArrayOut (IHardDiskAttachment *, aAttachments));
    506506    STDMETHOD(COMGETTER(VRDPServer))(IVRDPServer **vrdpServer);
    507507    STDMETHOD(COMGETTER(DVDDrive))(IDVDDrive **dvdDrive);
     
    532532    STDMETHOD(SetBootOrder)(ULONG aPosition, DeviceType_T aDevice);
    533533    STDMETHOD(GetBootOrder)(ULONG aPosition, DeviceType_T *aDevice);
    534     STDMETHOD(AttachHardDisk2) (IN_GUID aId, StorageBus_T aBus,
    535                                 LONG aChannel, LONG aDevice);
    536     STDMETHOD(GetHardDisk2) (StorageBus_T aBus, LONG aChannel, LONG aDevice,
    537                              IHardDisk2 **aHardDisk);
    538     STDMETHOD(DetachHardDisk2) (StorageBus_T aBus, LONG aChannel, LONG aDevice);
     534    STDMETHOD(AttachHardDisk)(IN_GUID aId, StorageBus_T aBus,
     535                              LONG aChannel, LONG aDevice);
     536    STDMETHOD(GetHardDisk)(StorageBus_T aBus, LONG aChannel, LONG aDevice,
     537                           IHardDisk **aHardDisk);
     538    STDMETHOD(DetachHardDisk)(StorageBus_T aBus, LONG aChannel, LONG aDevice);
    539539    STDMETHOD(GetSerialPort) (ULONG slot, ISerialPort **port);
    540540    STDMETHOD(GetParallelPort) (ULONG slot, IParallelPort **port);
     
    772772    HRESULT deleteImplicitDiffs();
    773773
    774     void fixupHardDisks2 (bool aCommit, bool aOnline = false);
     774    void fixupHardDisks(bool aCommit, bool aOnline = false);
    775775
    776776    HRESULT lockConfig();
  • trunk/src/VBox/Main/include/MediumImpl.h

    r16853 r16867  
    289289
    290290/**
    291  * The FloppyImage2 component class implements the IFloppyImage2 interface.
    292  */
    293 class ATL_NO_VTABLE FloppyImage2
    294     : public com::SupportErrorInfoDerived <ImageMediumBase, FloppyImage2, IFloppyImage2>
    295     , public VirtualBoxSupportTranslation <FloppyImage2>
    296     , public IFloppyImage2
     291 * The FloppyImage component class implements the IFloppyImage interface.
     292 */
     293class ATL_NO_VTABLE FloppyImage
     294    : public com::SupportErrorInfoDerived <ImageMediumBase, FloppyImage, IFloppyImage>
     295    , public VirtualBoxSupportTranslation <FloppyImage>
     296    , public IFloppyImage
    297297{
    298298public:
     
    300300    COM_FORWARD_IMedium_TO_BASE (ImageMediumBase)
    301301
    302     VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (FloppyImage2)
    303 
    304     DECLARE_NOT_AGGREGATABLE (FloppyImage2)
     302    VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (FloppyImage)
     303
     304    DECLARE_NOT_AGGREGATABLE (FloppyImage)
    305305
    306306    DECLARE_PROTECT_FINAL_CONSTRUCT()
    307307
    308     BEGIN_COM_MAP (FloppyImage2)
     308    BEGIN_COM_MAP (FloppyImage)
    309309        COM_INTERFACE_ENTRY (ISupportErrorInfo)
    310310        COM_INTERFACE_ENTRY2 (IMedium, ImageMediumBase)
    311         COM_INTERFACE_ENTRY (IFloppyImage2)
     311        COM_INTERFACE_ENTRY (IFloppyImage)
    312312    END_COM_MAP()
    313313
    314314    NS_DECL_ISUPPORTS
    315315
    316     DECLARE_EMPTY_CTOR_DTOR (FloppyImage2)
     316    DECLARE_EMPTY_CTOR_DTOR (FloppyImage)
    317317
    318318    // public initializer/uninitializer for internal purposes only
     
    332332
    333333    /** For com::SupportErrorInfoImpl. */
    334     static const char *ComponentName() { return "FloppyImage2"; }
     334    static const char *ComponentName() { return "FloppyImage"; }
    335335
    336336private:
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r16853 r16867  
    4343class Machine;
    4444class SessionMachine;
    45 class HardDisk2;
     45class HardDisk;
    4646class DVDImage;
    47 class FloppyImage2;
     47class FloppyImage;
    4848class MachineCollection;
    4949class GuestOSType;
     
    126126    STDMETHOD(COMGETTER(SystemProperties)) (ISystemProperties **aSystemProperties);
    127127    STDMETHOD(COMGETTER(Machines2)) (ComSafeArrayOut (IMachine *, aMachines));
    128     STDMETHOD(COMGETTER(HardDisks2)) (ComSafeArrayOut (IHardDisk2 *, aHardDisks));
     128    STDMETHOD(COMGETTER(HardDisks)) (ComSafeArrayOut (IHardDisk *, aHardDisks));
    129129    STDMETHOD(COMGETTER(DVDImages)) (ComSafeArrayOut (IDVDImage *, aDVDImages));
    130     STDMETHOD(COMGETTER(FloppyImages)) (ComSafeArrayOut (IFloppyImage2 *, aFloppyImages));
     130    STDMETHOD(COMGETTER(FloppyImages)) (ComSafeArrayOut (IFloppyImage *, aFloppyImages));
    131131    STDMETHOD(COMGETTER(ProgressOperations)) (ComSafeArrayOut (IProgress *, aOperations));
    132132    STDMETHOD(COMGETTER(GuestOSTypes)) (IGuestOSTypeCollection **aGuestOSTypes);
     
    147147    STDMETHOD(CreateAppliance) (IAppliance **anAppliance);
    148148
    149     STDMETHOD(CreateHardDisk2) (IN_BSTR aFormat, IN_BSTR aLocation,
    150                                 IHardDisk2 **aHardDisk);
    151     STDMETHOD(OpenHardDisk2) (IN_BSTR aLocation, IHardDisk2 **aHardDisk);
    152     STDMETHOD(GetHardDisk2) (IN_GUID aId, IHardDisk2 **aHardDisk);
    153     STDMETHOD(FindHardDisk2) (IN_BSTR aLocation, IHardDisk2 **aHardDisk);
     149    STDMETHOD(CreateHardDisk)(IN_BSTR aFormat, IN_BSTR aLocation,
     150                               IHardDisk **aHardDisk);
     151    STDMETHOD(OpenHardDisk) (IN_BSTR aLocation, IHardDisk **aHardDisk);
     152    STDMETHOD(GetHardDisk) (IN_GUID aId, IHardDisk **aHardDisk);
     153    STDMETHOD(FindHardDisk) (IN_BSTR aLocation, IHardDisk **aHardDisk);
    154154
    155155    STDMETHOD(OpenDVDImage) (IN_BSTR aLocation, IN_GUID aId,
     
    159159
    160160    STDMETHOD(OpenFloppyImage) (IN_BSTR aLocation, IN_GUID aId,
    161                                 IFloppyImage2 **aFloppyImage);
    162     STDMETHOD(GetFloppyImage) (IN_GUID aId, IFloppyImage2 **aFloppyImage);
    163     STDMETHOD(FindFloppyImage) (IN_BSTR aLocation, IFloppyImage2 **aFloppyImage);
     161                                IFloppyImage **aFloppyImage);
     162    STDMETHOD(GetFloppyImage) (IN_GUID aId, IFloppyImage **aFloppyImage);
     163    STDMETHOD(FindFloppyImage) (IN_BSTR aLocation, IFloppyImage **aFloppyImage);
    164164
    165165    STDMETHOD(GetGuestOSType) (IN_BSTR aId, IGuestOSType **aType);
     
    234234                         ComObjPtr <Machine> *machine = NULL);
    235235
    236     HRESULT findHardDisk2 (const Guid *aId, CBSTR aLocation,
    237                            bool aSetError, ComObjPtr <HardDisk2> *aHardDisk = NULL);
     236    HRESULT findHardDisk(const Guid *aId, CBSTR aLocation,
     237                          bool aSetError, ComObjPtr<HardDisk> *aHardDisk = NULL);
    238238    HRESULT findDVDImage(const Guid *aId, CBSTR aLocation,
    239239                         bool aSetError, ComObjPtr<DVDImage> *aImage = NULL);
    240     HRESULT findFloppyImage2 (const Guid *aId, CBSTR aLocation,
    241                               bool aSetError, ComObjPtr <FloppyImage2> *aImage = NULL);
     240    HRESULT findFloppyImage(const Guid *aId, CBSTR aLocation,
     241                            bool aSetError, ComObjPtr<FloppyImage> *aImage = NULL);
    242242
    243243    const ComObjPtr <Host> &host() { return mData.mHost; }
     
    256256    void calculateRelativePath (const char *aPath, Utf8Str &aResult);
    257257
    258     HRESULT registerHardDisk2 (HardDisk2 *aHardDisk, bool aSaveRegistry = true);
    259     HRESULT unregisterHardDisk2 (HardDisk2 *aHardDisk, bool aSaveRegistry = true);
     258    HRESULT registerHardDisk(HardDisk *aHardDisk, bool aSaveRegistry = true);
     259    HRESULT unregisterHardDisk(HardDisk *aHardDisk, bool aSaveRegistry = true);
    260260
    261261    HRESULT registerDVDImage(DVDImage *aImage, bool aSaveRegistry = true);
    262262    HRESULT unregisterDVDImage(DVDImage *aImage, bool aSaveRegistry = true);
    263263
    264     HRESULT registerFloppyImage (FloppyImage2 *aImage, bool aSaveRegistry = true);
    265     HRESULT unregisterFloppyImage (FloppyImage2 *aImage, bool aSaveRegistry = true);
    266 
    267     HRESULT cast (IHardDisk2 *aFrom, ComObjPtr <HardDisk2> &aTo);
     264    HRESULT registerFloppyImage (FloppyImage *aImage, bool aSaveRegistry = true);
     265    HRESULT unregisterFloppyImage (FloppyImage *aImage, bool aSaveRegistry = true);
     266
     267    HRESULT cast (IHardDisk *aFrom, ComObjPtr<HardDisk> &aTo);
    268268
    269269    HRESULT saveSettings();
     
    337337    /**
    338338     * Returns a lock handle used to protect changes to the hard disk hierarchy
    339      * (e.g. serialize access to the HardDisk2::mParent fields and methods
     339     * (e.g. serialize access to the HardDisk::mParent fields and methods
    340340     * adding/removing children). When using this lock, the following rules must
    341341     * be obeyed:
     
    361361    typedef std::map <Guid, ComPtr <IProgress> > ProgressMap;
    362362
    363     typedef std::list <ComObjPtr <HardDisk2> > HardDisk2List;
     363    typedef std::list <ComObjPtr <HardDisk> > HardDiskList;
    364364    typedef std::list <ComObjPtr <DVDImage> > DVDImageList;
    365     typedef std::list <ComObjPtr <FloppyImage2> > FloppyImage2List;
     365    typedef std::list <ComObjPtr <FloppyImage> > FloppyImageList;
    366366    typedef std::list <ComObjPtr <SharedFolder> > SharedFolderList;
    367367
    368     typedef std::map <Guid, ComObjPtr <HardDisk2> > HardDisk2Map;
     368    typedef std::map <Guid, ComObjPtr<HardDisk> > HardDiskMap;
    369369
    370370    /**
     
    428428        ProgressMap mProgressOperations;
    429429
    430         HardDisk2List mHardDisks2;
    431         DVDImageList mDVDImages2;
    432         FloppyImage2List mFloppyImages2;
     430        HardDiskList mHardDisks;
     431        DVDImageList mDVDImages;
     432        FloppyImageList mFloppyImages;
    433433        SharedFolderList mSharedFolders;
    434434
    435435        /// @todo NEWMEDIA do we really need this map? Used only in
    436436        /// find() it seems
    437         HardDisk2Map mHardDisk2Map;
     437        HardDiskMap mHardDiskMap;
    438438
    439439        CallbackList mCallbacks;
  • trunk/src/VBox/Main/testcase/tstAPI.cpp

    r16853 r16867  
    631631    do
    632632    {
    633         ComPtr <IHardDisk2> hd;
     633        ComPtr <IHardDisk> hd;
    634634        static const wchar_t *Names[] =
    635635        {
     
    651651            Bstr src = Names [i];
    652652            printf ("Searching for hard disk '%ls'...\n", src.raw());
    653             rc = virtualBox->FindHardDisk2 (src, hd.asOutParam());
     653            rc = virtualBox->FindHardDisk (src, hd.asOutParam());
    654654            if (SUCCEEDED (rc))
    655655            {
     
    901901    {
    902902        {
    903             com::SafeIfaceArray <IHardDisk2> disks;
     903            com::SafeIfaceArray <IHardDisk> disks;
    904904            CHECK_ERROR_BREAK (virtualBox,
    905                                COMGETTER(HardDisks2) (ComSafeArrayAsOutParam (disks)));
     905                               COMGETTER(HardDisks)(ComSafeArrayAsOutParam (disks)));
    906906
    907907            printf ("%u base hard disks registered (disks.isNull()=%d).\n",
  • trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp

    r16853 r16867  
    298298     * Create a virtual harddisk
    299299     */
    300     nsCOMPtr<IHardDisk2> hardDisk = 0;
    301     rc = virtualBox->CreateHardDisk2(NS_LITERAL_STRING("VDI").get(),
    302                                      NS_LITERAL_STRING("TestHardDisk.vdi").get(),
    303                                      getter_AddRefs(hardDisk));
     300    nsCOMPtr<IHardDisk> hardDisk = 0;
     301    rc = virtualBox->CreateHardDisk(NS_LITERAL_STRING("VDI").get(),
     302                                    NS_LITERAL_STRING("TestHardDisk.vdi").get(),
     303                                    getter_AddRefs(hardDisk));
    304304    if (NS_FAILED(rc))
    305305    {
     
    344344                nsID *vdiUUID = nsnull;
    345345                hardDisk->GetId(&vdiUUID);
    346                 rc = machine->AttachHardDisk2(*vdiUUID,
    347                                               StorageBus::IDE, // controler identifier
    348                                               0,               // channel number on the controller
    349                                               0);              // device number on the controller
     346                rc = machine->AttachHardDisk(*vdiUUID,
     347                                             StorageBus::IDE, // controler identifier
     348                                             0,               // channel number on the controller
     349                                             0);              // device number on the controller
    350350                nsMemory::Free(vdiUUID);
    351351                if (NS_FAILED(rc))
  • trunk/src/VBox/Main/xpcom/server.cpp

    r16853 r16867  
    9595#include <SnapshotImpl.h>
    9696#include <MediumImpl.h>
    97 #include <HardDisk2Impl.h>
     97#include <HardDiskImpl.h>
    9898#include <HardDiskFormatImpl.h>
    9999#include <ProgressImpl.h>
     
    147147                                           IMedium, ImageMediumBase,
    148148                                           IDVDImage, DVDImage)
    149 NS_DECL_CLASSINFO(FloppyImage2)
    150 NS_IMPL_THREADSAFE_ISUPPORTS2_AMBIGUOUS_CI(FloppyImage2,
     149NS_DECL_CLASSINFO(FloppyImage)
     150NS_IMPL_THREADSAFE_ISUPPORTS2_AMBIGUOUS_CI(FloppyImage,
    151151                                           IMedium, ImageMediumBase,
    152                                            IFloppyImage2, FloppyImage2)
    153 
    154 NS_DECL_CLASSINFO(HardDisk2)
    155 NS_IMPL_THREADSAFE_ISUPPORTS2_AMBIGUOUS_CI(HardDisk2,
     152                                           IFloppyImage, FloppyImage)
     153
     154NS_DECL_CLASSINFO(HardDisk)
     155NS_IMPL_THREADSAFE_ISUPPORTS2_AMBIGUOUS_CI(HardDisk,
    156156                                           IMedium, MediumBase,
    157                                            IHardDisk2, HardDisk2)
     157                                           IHardDisk, HardDisk)
    158158
    159159NS_DECL_CLASSINFO(HardDiskFormat)
    160160NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HardDiskFormat, IHardDiskFormat)
    161161
    162 NS_DECL_CLASSINFO(HardDisk2Attachment)
    163 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HardDisk2Attachment, IHardDisk2Attachment)
     162NS_DECL_CLASSINFO(HardDiskAttachment)
     163NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HardDiskAttachment, IHardDiskAttachment)
    164164
    165165NS_DECL_CLASSINFO(Progress)
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