- Timestamp:
- Feb 17, 2009 5:00:56 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 41 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r16530 r16867 1248 1248 if (fRegister) 1249 1249 { 1250 ComPtr<IHardDisk 2> hardDisk;1251 CHECK_ERROR(aVirtualBox, OpenHardDisk 2(filename, hardDisk.asOutParam()));1250 ComPtr<IHardDisk> hardDisk; 1251 CHECK_ERROR(aVirtualBox, OpenHardDisk(filename, hardDisk.asOutParam())); 1252 1252 } 1253 1253 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r16853 r16867 1414 1414 /* first assume it's a UUID */ 1415 1415 Guid uuid(a->argv[2]); 1416 ComPtr<IFloppyImage 2> floppyImage;1416 ComPtr<IFloppyImage> floppyImage; 1417 1417 rc = a->virtualBox->GetFloppyImage(uuid, floppyImage.asOutParam()); 1418 1418 if (FAILED(rc) || !floppyImage) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r16853 r16867 122 122 return errorArgument("Invalid hard disk type '%s' specified", Utf8Str(type).raw()); 123 123 124 ComPtr<IHardDisk 2> hardDisk;125 CHECK_ERROR(a->virtualBox, CreateHardDisk 2(format, filename, hardDisk.asOutParam()));124 ComPtr<IHardDisk> hardDisk; 125 CHECK_ERROR(a->virtualBox, CreateHardDisk(format, filename, hardDisk.asOutParam())); 126 126 if (SUCCEEDED(rc) && hardDisk) 127 127 { … … 215 215 return errorSyntax(USAGE_MODIFYHD, "Incorrect number of parameters"); 216 216 217 ComPtr<IHardDisk 2> hardDisk;217 ComPtr<IHardDisk> hardDisk; 218 218 Bstr filepath; 219 219 220 220 /* first guess is that it's a UUID */ 221 221 Guid uuid(a->argv[0]); 222 rc = a->virtualBox->GetHardDisk 2(uuid, hardDisk.asOutParam());222 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 223 223 /* no? then it must be a filename */ 224 224 if (!hardDisk) 225 225 { 226 226 filepath = a->argv[0]; 227 CHECK_ERROR(a->virtualBox, FindHardDisk 2(filepath, hardDisk.asOutParam()));227 CHECK_ERROR(a->virtualBox, FindHardDisk(filepath, hardDisk.asOutParam())); 228 228 } 229 229 … … 277 277 if (!hardDisk) 278 278 { 279 a->virtualBox->OpenHardDisk 2(Bstr(a->argv[0]), hardDisk.asOutParam());279 a->virtualBox->OpenHardDisk(Bstr(a->argv[0]), hardDisk.asOutParam()); 280 280 if (!hardDisk) 281 281 return errorArgument("Hard disk image not found"); … … 354 354 return errorSyntax(USAGE_CLONEHD, "Mandatory output file parameter missing"); 355 355 356 ComPtr<IHardDisk 2> srcDisk;357 ComPtr<IHardDisk 2> dstDisk;356 ComPtr<IHardDisk> srcDisk; 357 ComPtr<IHardDisk> dstDisk; 358 358 bool unknown = false; 359 359 360 360 /* first guess is that it's a UUID */ 361 361 Guid uuid(Utf8Str(src).raw()); 362 rc = a->virtualBox->GetHardDisk 2(uuid, srcDisk.asOutParam());362 rc = a->virtualBox->GetHardDisk(uuid, srcDisk.asOutParam()); 363 363 /* no? then it must be a filename */ 364 364 if (FAILED (rc)) 365 365 { 366 rc = a->virtualBox->FindHardDisk 2(src, srcDisk.asOutParam());366 rc = a->virtualBox->FindHardDisk(src, srcDisk.asOutParam()); 367 367 /* no? well, then it's an unkwnown image */ 368 368 if (FAILED (rc)) 369 369 { 370 CHECK_ERROR(a->virtualBox, OpenHardDisk 2(src, srcDisk.asOutParam()));370 CHECK_ERROR(a->virtualBox, OpenHardDisk(src, srcDisk.asOutParam())); 371 371 if (SUCCEEDED (rc)) 372 372 { … … 387 387 } 388 388 389 CHECK_ERROR_BREAK(a->virtualBox, CreateHardDisk 2(format, dst, dstDisk.asOutParam()));389 CHECK_ERROR_BREAK(a->virtualBox, CreateHardDisk(format, dst, dstDisk.asOutParam())); 390 390 391 391 ComPtr<IProgress> progress; … … 679 679 do 680 680 { 681 ComPtr<IHardDisk 2> hardDisk;681 ComPtr<IHardDisk> hardDisk; 682 682 CHECK_ERROR_BREAK (a->virtualBox, 683 CreateHardDisk 2(Bstr ("iSCSI"),684 685 683 CreateHardDisk(Bstr ("iSCSI"), 684 BstrFmt ("%ls/%ls", server.raw(), target.raw()), 685 hardDisk.asOutParam())); 686 686 CheckComRCBreakRC (rc); 687 687 … … 749 749 return errorSyntax(USAGE_SHOWHDINFO, "Incorrect number of parameters"); 750 750 751 ComPtr<IHardDisk 2> hardDisk;751 ComPtr<IHardDisk> hardDisk; 752 752 Bstr filepath; 753 753 … … 756 756 /* first guess is that it's a UUID */ 757 757 Guid uuid(a->argv[0]); 758 rc = a->virtualBox->GetHardDisk 2(uuid, hardDisk.asOutParam());758 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 759 759 /* no? then it must be a filename */ 760 760 if (FAILED (rc)) 761 761 { 762 762 filepath = a->argv[0]; 763 rc = a->virtualBox->FindHardDisk 2(filepath, hardDisk.asOutParam());763 rc = a->virtualBox->FindHardDisk(filepath, hardDisk.asOutParam()); 764 764 /* no? well, then it's an unkwnown image */ 765 765 if (FAILED (rc)) 766 766 { 767 CHECK_ERROR(a->virtualBox, OpenHardDisk 2(filepath, hardDisk.asOutParam()));767 CHECK_ERROR(a->virtualBox, OpenHardDisk(filepath, hardDisk.asOutParam())); 768 768 if (SUCCEEDED (rc)) 769 769 { … … 891 891 } 892 892 893 ComPtr<IHardDisk 2> hardDisk;894 CHECK_ERROR(a->virtualBox, OpenHardDisk 2(filepath, hardDisk.asOutParam()));893 ComPtr<IHardDisk> hardDisk; 894 CHECK_ERROR(a->virtualBox, OpenHardDisk(filepath, hardDisk.asOutParam())); 895 895 if (SUCCEEDED(rc) && hardDisk) 896 896 { … … 914 914 else if (strcmp(a->argv[0], "floppy") == 0) 915 915 { 916 ComPtr<IFloppyImage 2> floppyImage;916 ComPtr<IFloppyImage> floppyImage; 917 917 CHECK_ERROR(a->virtualBox, OpenFloppyImage(filepath, Guid(), floppyImage.asOutParam())); 918 918 } … … 935 935 if (strcmp(a->argv[0], "disk") == 0) 936 936 { 937 ComPtr<IHardDisk 2> hardDisk;938 rc = a->virtualBox->GetHardDisk 2(uuid, hardDisk.asOutParam());937 ComPtr<IHardDisk> hardDisk; 938 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 939 939 /* not a UUID or not registered? Then it must be a filename */ 940 940 if (!hardDisk) 941 941 { 942 CHECK_ERROR(a->virtualBox, FindHardDisk 2(Bstr(a->argv[1]), hardDisk.asOutParam()));942 CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(a->argv[1]), hardDisk.asOutParam())); 943 943 } 944 944 if (SUCCEEDED(rc) && hardDisk) … … 965 965 if (strcmp(a->argv[0], "floppy") == 0) 966 966 { 967 ComPtr<IFloppyImage 2> floppyImage;967 ComPtr<IFloppyImage> floppyImage; 968 968 rc = a->virtualBox->GetFloppyImage(uuid, floppyImage.asOutParam()); 969 969 /* not a UUID or not registered? Then it must be a filename */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r16853 r16867 384 384 case DriveState_ImageMounted: 385 385 { 386 ComPtr<IFloppyImage 2> floppyImage;386 ComPtr<IFloppyImage> floppyImage; 387 387 rc = floppyDrive->GetImage(floppyImage.asOutParam()); 388 388 if (SUCCEEDED(rc) && floppyImage) … … 461 461 if (fSataEnabled) 462 462 { 463 ComPtr<IHardDisk 2> hardDisk;463 ComPtr<IHardDisk> hardDisk; 464 464 Bstr filePath; 465 465 ULONG cSataPorts; … … 468 468 for (ULONG i = 0; i < cSataPorts; ++ i) 469 469 { 470 rc = machine->GetHardDisk 2(StorageBus_SATA, i, 0, hardDisk.asOutParam());470 rc = machine->GetHardDisk(StorageBus_SATA, i, 0, hardDisk.asOutParam()); 471 471 if (SUCCEEDED(rc) && hardDisk) 472 472 { … … 512 512 RTPrintf("IDE Controller: %s\n", pszIdeController); 513 513 514 ComPtr<IHardDisk 2> hardDisk;514 ComPtr<IHardDisk> hardDisk; 515 515 Bstr filePath; 516 rc = machine->GetHardDisk 2(StorageBus_IDE, 0, 0, hardDisk.asOutParam());516 rc = machine->GetHardDisk(StorageBus_IDE, 0, 0, hardDisk.asOutParam()); 517 517 if (SUCCEEDED(rc) && hardDisk) 518 518 { … … 532 532 RTPrintf("hda=\"none\"\n"); 533 533 } 534 rc = machine->GetHardDisk 2(StorageBus_IDE, 0, 1, hardDisk.asOutParam());534 rc = machine->GetHardDisk(StorageBus_IDE, 0, 1, hardDisk.asOutParam()); 535 535 if (SUCCEEDED(rc) && hardDisk) 536 536 { … … 550 550 RTPrintf("hdb=\"none\"\n"); 551 551 } 552 rc = machine->GetHardDisk 2(StorageBus_IDE, 1, 1, hardDisk.asOutParam());552 rc = machine->GetHardDisk(StorageBus_IDE, 1, 1, hardDisk.asOutParam()); 553 553 if (SUCCEEDED(rc) && hardDisk) 554 554 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r16853 r16867 389 389 if (strcmp(a->argv[0], "hdds") == 0) 390 390 { 391 com::SafeIfaceArray <IHardDisk2> hdds;392 CHECK_ERROR(a->virtualBox, COMGETTER(HardDisks 2)(ComSafeArrayAsOutParam (hdds)));391 com::SafeIfaceArray<IHardDisk> hdds; 392 CHECK_ERROR(a->virtualBox, COMGETTER(HardDisks)(ComSafeArrayAsOutParam (hdds))); 393 393 for (size_t i = 0; i < hdds.size(); ++ i) 394 394 { 395 ComPtr<IHardDisk 2> hdd = hdds[i];395 ComPtr<IHardDisk> hdd = hdds[i]; 396 396 Guid uuid; 397 397 hdd->COMGETTER(Id)(uuid.asOutParam()); … … 452 452 if (strcmp(a->argv[0], "floppies") == 0) 453 453 { 454 com::SafeIfaceArray<IFloppyImage 2> floppies;454 com::SafeIfaceArray<IFloppyImage> floppies; 455 455 CHECK_ERROR(a->virtualBox, COMGETTER(FloppyImages)(ComSafeArrayAsOutParam(floppies))); 456 456 for (size_t i = 0; i < floppies.size(); ++ i) 457 457 { 458 ComPtr<IFloppyImage 2> floppyImage = floppies[i];458 ComPtr<IFloppyImage> floppyImage = floppies[i]; 459 459 Guid uuid; 460 460 floppyImage->COMGETTER(Id)(uuid.asOutParam()); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r16853 r16867 980 980 if (strcmp(hdds[0], "none") == 0) 981 981 { 982 machine->DetachHardDisk 2(StorageBus_IDE, 0, 0);982 machine->DetachHardDisk(StorageBus_IDE, 0, 0); 983 983 } 984 984 else … … 986 986 /* first guess is that it's a UUID */ 987 987 Guid uuid(hdds[0]); 988 ComPtr<IHardDisk 2> hardDisk;989 rc = a->virtualBox->GetHardDisk 2(uuid, hardDisk.asOutParam());988 ComPtr<IHardDisk> hardDisk; 989 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 990 990 /* not successful? Then it must be a filename */ 991 991 if (!hardDisk) 992 992 { 993 CHECK_ERROR(a->virtualBox, FindHardDisk 2(Bstr(hdds[0]), hardDisk.asOutParam()));993 CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[0]), hardDisk.asOutParam())); 994 994 if (FAILED(rc)) 995 995 { 996 996 /* open the new hard disk object */ 997 CHECK_ERROR(a->virtualBox, OpenHardDisk 2(Bstr(hdds[0]), hardDisk.asOutParam()));997 CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[0]), hardDisk.asOutParam())); 998 998 } 999 999 } … … 1001 1001 { 1002 1002 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1003 CHECK_ERROR(machine, AttachHardDisk 2(uuid, StorageBus_IDE, 0, 0));1003 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 0, 0)); 1004 1004 } 1005 1005 else … … 1013 1013 if (strcmp(hdds[1], "none") == 0) 1014 1014 { 1015 machine->DetachHardDisk 2(StorageBus_IDE, 0, 1);1015 machine->DetachHardDisk(StorageBus_IDE, 0, 1); 1016 1016 } 1017 1017 else … … 1019 1019 /* first guess is that it's a UUID */ 1020 1020 Guid uuid(hdds[1]); 1021 ComPtr<IHardDisk 2> hardDisk;1022 rc = a->virtualBox->GetHardDisk 2(uuid, hardDisk.asOutParam());1021 ComPtr<IHardDisk> hardDisk; 1022 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 1023 1023 /* not successful? Then it must be a filename */ 1024 1024 if (!hardDisk) 1025 1025 { 1026 CHECK_ERROR(a->virtualBox, FindHardDisk 2(Bstr(hdds[1]), hardDisk.asOutParam()));1026 CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[1]), hardDisk.asOutParam())); 1027 1027 if (FAILED(rc)) 1028 1028 { 1029 1029 /* open the new hard disk object */ 1030 CHECK_ERROR(a->virtualBox, OpenHardDisk 2(Bstr(hdds[1]), hardDisk.asOutParam()));1030 CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[1]), hardDisk.asOutParam())); 1031 1031 } 1032 1032 } … … 1034 1034 { 1035 1035 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1036 CHECK_ERROR(machine, AttachHardDisk 2(uuid, StorageBus_IDE, 0, 1));1036 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 0, 1)); 1037 1037 } 1038 1038 else … … 1046 1046 if (strcmp(hdds[2], "none") == 0) 1047 1047 { 1048 machine->DetachHardDisk 2(StorageBus_IDE, 1, 1);1048 machine->DetachHardDisk(StorageBus_IDE, 1, 1); 1049 1049 } 1050 1050 else … … 1052 1052 /* first guess is that it's a UUID */ 1053 1053 Guid uuid(hdds[2]); 1054 ComPtr<IHardDisk 2> hardDisk;1055 rc = a->virtualBox->GetHardDisk 2(uuid, hardDisk.asOutParam());1054 ComPtr<IHardDisk> hardDisk; 1055 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 1056 1056 /* not successful? Then it must be a filename */ 1057 1057 if (!hardDisk) 1058 1058 { 1059 CHECK_ERROR(a->virtualBox, FindHardDisk 2(Bstr(hdds[2]), hardDisk.asOutParam()));1059 CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[2]), hardDisk.asOutParam())); 1060 1060 if (FAILED(rc)) 1061 1061 { 1062 1062 /* open the new hard disk object */ 1063 CHECK_ERROR(a->virtualBox, OpenHardDisk 2(Bstr(hdds[2]), hardDisk.asOutParam()));1063 CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[2]), hardDisk.asOutParam())); 1064 1064 } 1065 1065 } … … 1067 1067 { 1068 1068 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1069 CHECK_ERROR(machine, AttachHardDisk 2(uuid, StorageBus_IDE, 1, 1));1069 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 1, 1)); 1070 1070 } 1071 1071 else … … 1210 1210 /* first assume it's a UUID */ 1211 1211 Guid uuid(floppy); 1212 ComPtr<IFloppyImage 2> floppyImage;1212 ComPtr<IFloppyImage> floppyImage; 1213 1213 rc = a->virtualBox->GetFloppyImage(uuid, floppyImage.asOutParam()); 1214 1214 if (FAILED(rc) || !floppyImage) … … 1747 1747 if (strcmp(hdds[i], "none") == 0) 1748 1748 { 1749 machine->DetachHardDisk 2(StorageBus_SATA, i-4, 0);1749 machine->DetachHardDisk(StorageBus_SATA, i-4, 0); 1750 1750 } 1751 1751 else … … 1753 1753 /* first guess is that it's a UUID */ 1754 1754 Guid uuid(hdds[i]); 1755 ComPtr<IHardDisk 2> hardDisk;1756 rc = a->virtualBox->GetHardDisk 2(uuid, hardDisk.asOutParam());1755 ComPtr<IHardDisk> hardDisk; 1756 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 1757 1757 /* not successful? Then it must be a filename */ 1758 1758 if (!hardDisk) 1759 1759 { 1760 CHECK_ERROR(a->virtualBox, FindHardDisk 2(Bstr(hdds[i]), hardDisk.asOutParam()));1760 CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[i]), hardDisk.asOutParam())); 1761 1761 if (FAILED(rc)) 1762 1762 { 1763 1763 /* open the new hard disk object */ 1764 CHECK_ERROR(a->virtualBox, OpenHardDisk 2(Bstr(hdds[i]), hardDisk.asOutParam()));1764 CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[i]), hardDisk.asOutParam())); 1765 1765 } 1766 1766 } … … 1768 1768 { 1769 1769 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1770 CHECK_ERROR(machine, AttachHardDisk 2(uuid, StorageBus_SATA, i-4, 0));1770 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_SATA, i-4, 0)); 1771 1771 } 1772 1772 else -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r16853 r16867 1659 1659 */ 1660 1660 Bstr hdaFileBstr = hdaFile; 1661 ComPtr<IHardDisk 2> hardDisk;1662 virtualBox->FindHardDisk 2(hdaFileBstr, hardDisk.asOutParam());1661 ComPtr<IHardDisk> hardDisk; 1662 virtualBox->FindHardDisk(hdaFileBstr, hardDisk.asOutParam()); 1663 1663 if (!hardDisk) 1664 1664 { 1665 1665 /* we've not found the image */ 1666 1666 RTPrintf("Adding hard disk '%S'...\n", hdaFile); 1667 virtualBox->OpenHardDisk 2(hdaFileBstr, hardDisk.asOutParam());1667 virtualBox->OpenHardDisk(hdaFileBstr, hardDisk.asOutParam()); 1668 1668 } 1669 1669 /* do we have the right image now? */ … … 1675 1675 Guid uuid; 1676 1676 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1677 gMachine->DetachHardDisk 2(StorageBus_IDE, 0, 0);1678 gMachine->AttachHardDisk 2(uuid, StorageBus_IDE, 0, 0);1677 gMachine->DetachHardDisk(StorageBus_IDE, 0, 0); 1678 gMachine->AttachHardDisk(uuid, StorageBus_IDE, 0, 0); 1679 1679 /// @todo why is this attachment saved? 1680 1680 } … … 1726 1726 { 1727 1727 /* try to find an existing one */ 1728 ComPtr <IFloppyImage2> image;1728 ComPtr<IFloppyImage> image; 1729 1729 rc = virtualBox->FindFloppyImage (medium, image.asOutParam()); 1730 1730 if (FAILED (rc)) -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r16853 r16867 146 146 } 147 147 148 const CHardDisk 2&hardDisk() const { return mHardDisk; }148 const CHardDisk &hardDisk() const { return mHardDisk; } 149 149 const CDVDImage &dvdImage() const { return mDVDImage; } 150 const CFloppyImage 2&floppyImage() const { return mFloppyImage; }150 const CFloppyImage &floppyImage() const { return mFloppyImage; } 151 151 152 152 QUuid id() const { return mId; } … … 246 246 COMResult mResult; 247 247 248 CHardDisk 2mHardDisk;248 CHardDisk mHardDisk; 249 249 CDVDImage mDVDImage; 250 CFloppyImage 2mFloppyImage;250 CFloppyImage mFloppyImage; 251 251 252 252 QUuid mId; … … 613 613 * normal hard disks that have a parent. 614 614 */ 615 QString hardDiskTypeString (const CHardDisk 2&aHD) const615 QString hardDiskTypeString (const CHardDisk &aHD) const 616 616 { 617 617 if (!aHD.GetParent().isNull()) … … 799 799 /* details generators */ 800 800 801 QString details (const CHardDisk 2&aHD, bool aPredictDiff);801 QString details (const CHardDisk &aHD, bool aPredictDiff); 802 802 803 803 QString details (const CUSBDevice &aDevice) const; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxNewHDWzd.h
r13580 r16867 39 39 VBoxNewHDWzd (QWidget *aParent = 0); 40 40 41 CHardDisk 2hardDisk() { return mHD; }41 CHardDisk hardDisk() { return mHD; } 42 42 void setRecommendedFileName (const QString &aName); 43 43 void setRecommendedSize (quint64 aSize); … … 66 66 67 67 QIWidgetValidator *mWValNameAndSize; 68 CHardDisk 2mHD;68 CHardDisk mHD; 69 69 int mSliderScale; 70 70 quint64 mMaxVDISize; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxNewVMWzd.h
r14437 r16867 67 67 QIWidgetValidator *mWvalMemory; 68 68 QIWidgetValidator *mWvalHDD; 69 CHardDisk 2mHardDisk;69 CHardDisk mHardDisk; 70 70 CMachine mMachine; 71 71 }; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r16617 r16867 264 264 int confirmDeleteHardDiskStorage (QWidget *aParent, 265 265 const QString &aLocation); 266 void cannotDeleteHardDiskStorage (QWidget *aParent, const CHardDisk 2&aHD,266 void cannotDeleteHardDiskStorage (QWidget *aParent, const CHardDisk &aHD, 267 267 const CProgress &aProgress); 268 268 … … 272 272 void cannotCreateHardDiskStorage (QWidget *aParent, const CVirtualBox &aVBox, 273 273 const QString &aLocaiton, 274 const CHardDisk 2&aHD,274 const CHardDisk &aHD, 275 275 const CProgress &aProgress); 276 276 void cannotAttachHardDisk (QWidget *aParent, const CMachine &aMachine, -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r16853 r16867 1917 1917 QString data; 1918 1918 bool hasDisks = false; 1919 CHardDisk 2AttachmentVector vec = cmachine.GetHardDisk2Attachments();1920 for (CHardDisk 2AttachmentVector::ConstIterator hda = vec.begin();1919 CHardDiskAttachmentVector vec = cmachine.GetHardDiskAttachments(); 1920 for (CHardDiskAttachmentVector::ConstIterator hda = vec.begin(); 1921 1921 hda != vec.end(); ++ hda) 1922 1922 { 1923 CHardDisk 2hd = hda->GetHardDisk();1923 CHardDisk hd = hda->GetHardDisk(); 1924 1924 data += QString ("<br><nobr><b>%1 %2</b>: %3</nobr>") 1925 1925 .arg (vboxGlobal().toString (hda->GetBus(), hda->GetChannel())) -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r16853 r16867 219 219 * to an item from VBoxGlobal::currentMediaList()) */ 220 220 221 CHardDisk 2parent = mHardDisk.GetParent();221 CHardDisk parent = mHardDisk.GetParent(); 222 222 Assert (!parent.isNull() || mParent == NULL); 223 223 … … 1938 1938 * @todo in VBoxMedium::details()). 1939 1939 */ 1940 QString VBoxGlobal::details (const CHardDisk 2&aHD,1940 QString VBoxGlobal::details (const CHardDisk &aHD, 1941 1941 bool aPredictDiff) 1942 1942 { … … 2161 2161 int rows = 2; /* including section header and footer */ 2162 2162 2163 CHardDisk 2AttachmentVector vec = aMachine.GetHardDisk2Attachments();2163 CHardDiskAttachmentVector vec = aMachine.GetHardDiskAttachments(); 2164 2164 for (size_t i = 0; i < (size_t) vec.size(); ++ i) 2165 2165 { 2166 CHardDisk 2Attachment hda = vec [i];2167 CHardDisk 2hd = hda.GetHardDisk();2166 CHardDiskAttachment hda = vec [i]; 2167 CHardDisk hd = hda.GetHardDisk(); 2168 2168 2169 2169 /// @todo for the explaination of the below isOk() checks, see *** … … 2332 2332 case KDriveState_ImageMounted: 2333 2333 { 2334 CFloppyImage 2img = floppy.GetImage();2334 CFloppyImage img = floppy.GetImage(); 2335 2335 item = QString (sSectionItemTpl2) 2336 2336 .arg (tr ("Image", "details report (floppy)"), … … 2915 2915 */ 2916 2916 static 2917 void AddHardDisksToList (const CHardDisk 2Vector &aVector,2917 void AddHardDisksToList (const CHardDiskVector &aVector, 2918 2918 VBoxMediaList &aList, 2919 2919 VBoxMediaList::iterator aWhere, … … 2923 2923 2924 2924 /* First pass: Add siblings sorted */ 2925 for (CHardDisk 2Vector::ConstIterator it = aVector.begin();2925 for (CHardDiskVector::ConstIterator it = aVector.begin(); 2926 2926 it != aVector.end(); ++ it) 2927 2927 { … … 2945 2945 for (VBoxMediaList::iterator it = first; it != aWhere;) 2946 2946 { 2947 CHardDisk 2Vector children = (*it).hardDisk().GetChildren();2947 CHardDiskVector children = (*it).hardDisk().GetChildren(); 2948 2948 VBoxMedium *parent = &(*it); 2949 2949 … … 2997 2997 mMediaList.clear(); 2998 2998 { 2999 AddHardDisksToList (mVBox.GetHardDisks 2(), mMediaList, mMediaList.end());2999 AddHardDisksToList (mVBox.GetHardDisks(), mMediaList, mMediaList.end()); 3000 3000 } 3001 3001 { … … 3025 3025 VBoxMediaList::iterator first = mMediaList.end(); 3026 3026 3027 CFloppyImage 2Vector vec = mVBox.GetFloppyImages();3028 for (CFloppyImage 2Vector::ConstIterator it = vec.begin();3027 CFloppyImageVector vec = mVBox.GetFloppyImages(); 3028 for (CFloppyImageVector::ConstIterator it = vec.begin(); 3029 3029 it != vec.end(); ++ it) 3030 3030 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp
r16853 r16867 972 972 if (dlg.exec() == QDialog::Accepted) 973 973 { 974 CHardDisk 2hd = dlg.hardDisk();974 CHardDisk hd = dlg.hardDisk(); 975 975 /* Select the newly created hard disk */ 976 976 MediaItem *item = searchItem (mHardDiskView, hd.GetId()); … … 1094 1094 } 1095 1095 1096 CHardDisk 2hardDisk = item->medium().hardDisk();1096 CHardDisk hardDisk = item->medium().hardDisk(); 1097 1097 1098 1098 if (deleteStorage) … … 1134 1134 case VBoxDefs::MediaType_Floppy: 1135 1135 { 1136 CFloppyImage 2image = item->medium().floppyImage();1136 CFloppyImage image = item->medium().floppyImage(); 1137 1137 image.Close(); 1138 1138 result = image; … … 1232 1232 case VBoxDefs::MediaType_HardDisk: 1233 1233 { 1234 CHardDisk 2AttachmentVector vec =machine.GetHardDisk2Attachments();1234 CHardDiskAttachmentVector vec =machine.GetHardDiskAttachments(); 1235 1235 for (int i = 0; i < vec.size(); ++ i) 1236 1236 { 1237 CHardDisk 2Attachment hda = vec [i];1237 CHardDiskAttachment hda = vec [i]; 1238 1238 if (hda.GetHardDisk().GetId() == aMedium.id()) 1239 1239 { 1240 machine.DetachHardDisk 2(hda.GetBus(),1241 1242 1240 machine.DetachHardDisk(hda.GetBus(), 1241 hda.GetChannel(), 1242 hda.GetDevice()); 1243 1243 if (!machine.isOk()) 1244 1244 { … … 1543 1543 case VBoxDefs::MediaType_HardDisk: 1544 1544 { 1545 CHardDisk 2 hd = mVBox.OpenHardDisk2(aLocation);1545 CHardDisk hd = mVBox.OpenHardDisk(aLocation); 1546 1546 if (mVBox.isOk()) 1547 1547 { … … 1565 1565 case VBoxDefs::MediaType_Floppy: 1566 1566 { 1567 CFloppyImage 2image = mVBox.OpenFloppyImage (aLocation, uuid);1567 CFloppyImage image = mVBox.OpenFloppyImage (aLocation, uuid); 1568 1568 if (mVBox.isOk()) 1569 1569 { … … 1591 1591 MediaItem *item = 0; 1592 1592 1593 CHardDisk 2parent = aMedium.hardDisk().GetParent();1593 CHardDisk parent = aMedium.hardDisk().GetParent(); 1594 1594 if (parent.isNull()) 1595 1595 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxNewHDWzd.cpp
r14540 r16867 384 384 CProgress progress; 385 385 386 CHardDisk 2 hd = vbox.CreateHardDisk2(QString ("VDI"), loc);386 CHardDisk hd = vbox.CreateHardDisk(QString ("VDI"), loc); 387 387 388 388 if (!vbox.isOk()) -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxNewVMWzd.cpp
r16633 r16867 352 352 { 353 353 CMachine m = session.GetMachine(); 354 m.AttachHardDisk 2(mHDCombo->id(), KStorageBus_IDE, 0, 0);354 m.AttachHardDisk(mHDCombo->id(), KStorageBus_IDE, 0, 0); 355 355 if (m.isOk()) 356 356 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r16656 r16867 1203 1203 1204 1204 void VBoxProblemReporter::cannotDeleteHardDiskStorage (QWidget *aParent, 1205 const CHardDisk 2&aHD,1205 const CHardDisk &aHD, 1206 1206 const CProgress &aProgress) 1207 1207 { 1208 /* below, we use CHardDisk 2(aHD) to preserve current error info1208 /* below, we use CHardDisk (aHD) to preserve current error info 1209 1209 * for formatErrorInfo() */ 1210 1210 1211 1211 message (aParent, Error, 1212 1212 tr ("Failed to delete the storage unit of the hard disk <b>%1</b>.") 1213 .arg (CHardDisk 2(aHD).GetLocation()),1213 .arg (CHardDisk (aHD).GetLocation()), 1214 1214 !aHD.isOk() ? formatErrorInfo (aHD) : 1215 1215 !aProgress.isOk() ? formatErrorInfo (aProgress) : … … 1248 1248 void VBoxProblemReporter::cannotCreateHardDiskStorage ( 1249 1249 QWidget *aParent, const CVirtualBox &aVBox, const QString &aLocation, 1250 const CHardDisk 2&aHD, const CProgress &aProgress)1250 const CHardDisk &aHD, const CProgress &aProgress) 1251 1251 { 1252 1252 message (aParent, Error, -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp
r16743 r16867 872 872 CMachine machine = session.GetMachine(); 873 873 /* Detach all attached Hard Disks */ 874 CHardDisk 2AttachmentVector vec = machine.GetHardDisk2Attachments();874 CHardDiskAttachmentVector vec = machine.GetHardDiskAttachments(); 875 875 for (int i = 0; i < vec.size(); ++ i) 876 876 { 877 CHardDisk 2Attachment hda = vec [i];878 machine.DetachHardDisk 2(hda.GetBus(), hda.GetChannel(), hda.GetDevice());877 CHardDiskAttachment hda = vec [i]; 878 machine.DetachHardDisk(hda.GetBus(), hda.GetChannel(), hda.GetDevice()); 879 879 if (!machine.isOk()) 880 880 vboxProblem().cannotDetachHardDisk (this, machine, -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMFirstRunWzd.cpp
r13580 r16867 36 36 37 37 /* Hide unnecessary text labels */ 38 CHardDisk 2AttachmentVector vec = mMachine.GetHardDisk2Attachments();38 CHardDiskAttachmentVector vec = mMachine.GetHardDiskAttachments(); 39 39 if (vec.size() != 0) 40 40 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp
r16087 r16867 467 467 468 468 /* IDE Hard Disk (Primary Master) */ 469 if (!m.GetHardDisk 2(KStorageBus_IDE, 0, 0).isNull())469 if (!m.GetHardDisk(KStorageBus_IDE, 0, 0).isNull()) 470 470 { 471 471 hdStat += formatHardDisk (KStorageBus_IDE, 0, 0, "IDE00"); … … 474 474 475 475 /* IDE Hard Disk (Primary Slave) */ 476 if (!m.GetHardDisk 2(KStorageBus_IDE, 0, 1).isNull())476 if (!m.GetHardDisk(KStorageBus_IDE, 0, 1).isNull()) 477 477 { 478 478 hdStat += formatHardDisk (KStorageBus_IDE, 0, 1, "IDE01"); … … 481 481 482 482 /* IDE Hard Disk (Secondary Slave) */ 483 if (!m.GetHardDisk 2(KStorageBus_IDE, 1, 1).isNull())483 if (!m.GetHardDisk(KStorageBus_IDE, 1, 1).isNull()) 484 484 { 485 485 hdStat += formatHardDisk (KStorageBus_IDE, 1, 1, "IDE11"); … … 490 490 for (int i = 0; i < 30; ++ i) 491 491 { 492 if (!m.GetHardDisk 2(KStorageBus_SATA, i, 0).isNull())492 if (!m.GetHardDisk(KStorageBus_SATA, i, 0).isNull()) 493 493 { 494 494 hdStat += formatHardDisk (KStorageBus_SATA, i, 0, … … 574 574 return QString::null; 575 575 576 CHardDisk 2 hd = mSession.GetMachine().GetHardDisk2(aBus, aChannel, aDevice);576 CHardDisk hd = mSession.GetMachine().GetHardDisk(aBus, aChannel, aDevice); 577 577 QString header = "<tr><td></td><td colspan=2><nobr><u>%1</u></nobr></td></tr>"; 578 578 QString name = vboxGlobal().toFullString (aBus, aChannel, aDevice); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsFD.cpp
r14039 r16867 110 110 case KDriveState_ImageMounted: 111 111 { 112 CFloppyImage 2img = floppy.GetImage();112 CFloppyImage img = floppy.GetImage(); 113 113 QString src = img.GetLocation(); 114 114 AssertMsg (!src.isNull(), ("Image file must not be null")); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp
r13580 r16867 77 77 78 78 VBoxMedium medium = vboxGlobal().getMedium ( 79 CMedium (vboxGlobal().virtualBox().GetHardDisk 2(aId)));79 CMedium (vboxGlobal().virtualBox().GetHardDisk(aId))); 80 80 medium.refresh(); 81 81 bool noDiffs = !HDSettings::instance()->showDiffs(); … … 662 662 663 663 /* Load attachments list */ 664 CHardDisk 2AttachmentVector vec = mMachine.GetHardDisk2Attachments();664 CHardDiskAttachmentVector vec = mMachine.GetHardDiskAttachments(); 665 665 for (int i = 0; i < vec.size(); ++ i) 666 666 { 667 CHardDisk 2Attachment hda = vec [i];667 CHardDiskAttachment hda = vec [i]; 668 668 SlotValue slot (hda.GetBus(), hda.GetChannel(), hda.GetDevice()); 669 669 DiskValue disk (hda.GetHardDisk().GetId()); … … 687 687 688 688 /* Detach all attached Hard Disks */ 689 CHardDisk 2AttachmentVector vec = mMachine.GetHardDisk2Attachments();689 CHardDiskAttachmentVector vec = mMachine.GetHardDiskAttachments(); 690 690 for (int i = 0; i < vec.size(); ++ i) 691 691 { 692 CHardDisk 2Attachment hda = vec [i];693 mMachine.DetachHardDisk 2(hda.GetBus(), hda.GetChannel(), hda.GetDevice());692 CHardDiskAttachment hda = vec [i]; 693 mMachine.DetachHardDisk(hda.GetBus(), hda.GetChannel(), hda.GetDevice()); 694 694 695 695 /* [dsen] check this */ … … 708 708 maxSATAPort = maxSATAPort < (list [i].slot.channel + 1) ? 709 709 (list [i].slot.channel + 1) : maxSATAPort; 710 mMachine.AttachHardDisk 2(list [i].disk.id,710 mMachine.AttachHardDisk(list [i].disk.id, 711 711 list [i].slot.bus, list [i].slot.channel, list [i].slot.device); 712 712 … … 715 715 vboxProblem().cannotAttachHardDisk (this, mMachine, 716 716 vboxGlobal().getMedium (CMedium (vboxGlobal().virtualBox() 717 .GetHardDisk 2(list [i].disk.id))).location(),717 .GetHardDisk(list [i].disk.id))).location(), 718 718 list [i].slot.bus, list [i].slot.channel, list [i].slot.device); 719 719 } -
trunk/src/VBox/Main/ApplianceImpl.cpp
r16853 r16867 1199 1199 { 1200 1200 // @todo: 1201 // - don't use COM methods but the methods directly (faster, but needs appropriate locking of that objects itself (s. HardDisk 2))1201 // - don't use COM methods but the methods directly (faster, but needs appropriate locking of that objects itself (s. HardDisk)) 1202 1202 // - Appropriate handle errors like not supported file formats 1203 1203 AutoCaller autoCaller(this); … … 1625 1625 HRESULT Appliance::searchUniqueDiskImageFilePath(Utf8Str& aName) const 1626 1626 { 1627 IHardDisk 2*harddisk = NULL;1627 IHardDisk *harddisk = NULL; 1628 1628 char *tmpName = RTStrDup(aName.c_str()); 1629 1629 int i = 1; … … 1632 1632 /* @todo: Maybe too cost-intensive; try to find a lighter way */ 1633 1633 while (RTPathExists(tmpName) || 1634 mVirtualBox->FindHardDisk 2(Bstr(tmpName), &harddisk) != VBOX_E_OBJECT_NOT_FOUND)1634 mVirtualBox->FindHardDisk(Bstr(tmpName), &harddisk) != VBOX_E_OBJECT_NOT_FOUND) 1635 1635 { 1636 1636 RTStrFree(tmpName); … … 1659 1659 Appliance *app = task->that; 1660 1660 1661 /// @todo ugly hack, fix ComAssert... (same as in HardDisk 2::taskThread)1661 /// @todo ugly hack, fix ComAssert... (same as in HardDisk::taskThread) 1662 1662 #define setError app->setError 1663 1663 … … 1921 1921 the machine, so make an extra try/catch block. */ 1922 1922 ComPtr<ISession> session; 1923 ComPtr<IHardDisk 2> srcHdVBox;1923 ComPtr<IHardDisk> srcHdVBox; 1924 1924 try 1925 1925 { … … 1973 1973 rc = VirtualBox::ensureFilePathExists(pcszDstFilePath); 1974 1974 CheckComRCThrowRC(rc); 1975 ComPtr<IHardDisk 2> dstHdVBox;1975 ComPtr<IHardDisk> dstHdVBox; 1976 1976 /* If strHref is empty we have to create a new file */ 1977 1977 if (di.strHref.c_str()[0] == 0) … … 1983 1983 srcFormat = L"VMDK"; 1984 1984 /* Create an empty hard disk */ 1985 rc = app->mVirtualBox->CreateHardDisk 2(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam());1985 rc = app->mVirtualBox->CreateHardDisk(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam()); 1986 1986 CheckComRCThrowRC(rc); 1987 1987 /* Create a dynamic growing disk image with the given capacity */ … … 2033 2033 * attached already from a previous import) */ 2034 2034 /* First open the existing disk image */ 2035 rc = app->mVirtualBox->OpenHardDisk 2(Bstr(strSrcFilePath), srcHdVBox.asOutParam());2035 rc = app->mVirtualBox->OpenHardDisk(Bstr(strSrcFilePath), srcHdVBox.asOutParam()); 2036 2036 CheckComRCThrowRC(rc); 2037 2037 /* We need the format description of the source disk image */ … … 2040 2040 CheckComRCThrowRC(rc); 2041 2041 /* Create a new hard disk interface for the destination disk image */ 2042 rc = app->mVirtualBox->CreateHardDisk 2(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam());2042 rc = app->mVirtualBox->CreateHardDisk(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam()); 2043 2043 CheckComRCThrowRC(rc); 2044 2044 /* Clone the source disk image */ … … 2096 2096 default: break; 2097 2097 } 2098 rc = sMachine->AttachHardDisk 2(hdId, sbt, hdc.ulBusNumber, 0);2098 rc = sMachine->AttachHardDisk(hdId, sbt, hdc.ulBusNumber, 0); 2099 2099 CheckComRCThrowRC(rc); 2100 2100 rc = sMachine->SaveSettings(); … … 2150 2150 LogFlowFuncLeave(); 2151 2151 2152 /// @todo ugly hack, fix ComAssert... (same as in HardDisk 2::taskThread)2152 /// @todo ugly hack, fix ComAssert... (same as in HardDisk::taskThread) 2153 2153 #undef setError 2154 2154 -
trunk/src/VBox/Main/ConsoleImpl.cpp
r16853 r16867 2657 2657 case DriveState_ImageMounted: 2658 2658 { 2659 ComPtr <IFloppyImage2> ImagePtr;2659 ComPtr<IFloppyImage> ImagePtr; 2660 2660 rc = mFloppyDrive->GetImage (ImagePtr.asOutParam()); 2661 2661 if (SUCCEEDED (rc)) … … 4355 4355 /* lock all hard disks for writing and their parents for reading */ 4356 4356 { 4357 com::SafeIfaceArray <IHardDisk 2Attachment> atts;4357 com::SafeIfaceArray <IHardDiskAttachment> atts; 4358 4358 rc = mMachine-> 4359 COMGETTER(HardDisk 2Attachments) (ComSafeArrayAsOutParam (atts));4359 COMGETTER(HardDiskAttachments) (ComSafeArrayAsOutParam (atts)); 4360 4360 CheckComRCReturnRC (rc); 4361 4361 4362 4362 for (size_t i = 0; i < atts.size(); ++ i) 4363 4363 { 4364 ComPtr <IHardDisk 2> hardDisk;4364 ComPtr <IHardDisk> hardDisk; 4365 4365 rc = atts [i]->COMGETTER(HardDisk) (hardDisk.asOutParam()); 4366 4366 CheckComRCReturnRC (rc); … … 4391 4391 task->mediaToCheck.push_back (hardDisk); 4392 4392 4393 ComPtr <IHardDisk 2> parent;4393 ComPtr <IHardDisk> parent; 4394 4394 rc = hardDisk->COMGETTER(Parent) (parent.asOutParam()); 4395 4395 CheckComRCReturnRC (rc); … … 4436 4436 if (driveState == DriveState_ImageMounted) 4437 4437 { 4438 ComPtr <IFloppyImage2> image;4438 ComPtr<IFloppyImage> image; 4439 4439 rc = drive->GetImage (image.asOutParam()); 4440 4440 CheckComRCReturnRC (rc); … … 6782 6782 * @return VBox status code. 6783 6783 */ 6784 static DECLCALLBACK(int) reconfigureHardDisks(PVM pVM, IHardDisk 2Attachment *hda,6784 static DECLCALLBACK(int) reconfigureHardDisks(PVM pVM, IHardDiskAttachment *hda, 6785 6785 HRESULT *phrc) 6786 6786 { … … 6797 6797 * Figure out which IDE device this is. 6798 6798 */ 6799 ComPtr<IHardDisk 2> hardDisk;6799 ComPtr<IHardDisk> hardDisk; 6800 6800 hrc = hda->COMGETTER(HardDisk)(hardDisk.asOutParam()); H(); 6801 6801 StorageBus_T enmBus; … … 6947 6947 6948 6948 /* Create an inversed tree of parents. */ 6949 ComPtr<IHardDisk 2> parentHardDisk = hardDisk;6949 ComPtr<IHardDisk> parentHardDisk = hardDisk; 6950 6950 for (PCFGMNODE pParent = pCfg;;) 6951 6951 { … … 7084 7084 LogFlowFunc (("Reattaching new differencing hard disks...\n")); 7085 7085 7086 com::SafeIfaceArray <IHardDisk 2Attachment> atts;7086 com::SafeIfaceArray <IHardDiskAttachment> atts; 7087 7087 rc = that->mMachine-> 7088 COMGETTER(HardDisk 2Attachments) (ComSafeArrayAsOutParam (atts));7088 COMGETTER(HardDiskAttachments) (ComSafeArrayAsOutParam (atts)); 7089 7089 if (FAILED (rc)) 7090 7090 break; -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r16856 r16867 577 577 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 578 578 579 ComPtr<IFloppyImage 2> floppyImage;579 ComPtr<IFloppyImage> floppyImage; 580 580 hrc = floppyDrive->GetImage(floppyImage.asOutParam()); H(); 581 581 if (floppyImage) … … 867 867 /* Attach the hard disks */ 868 868 { 869 com::SafeIfaceArray <IHardDisk2Attachment> atts;869 com::SafeIfaceArray<IHardDiskAttachment> atts; 870 870 hrc = pMachine-> 871 COMGETTER(HardDisk 2Attachments) (ComSafeArrayAsOutParam (atts)); H();871 COMGETTER(HardDiskAttachments) (ComSafeArrayAsOutParam (atts)); H(); 872 872 873 873 for (size_t i = 0; i < atts.size(); ++ i) 874 874 { 875 ComPtr <IHardDisk2> hardDisk;875 ComPtr<IHardDisk> hardDisk; 876 876 hrc = atts [i]->COMGETTER(HardDisk) (hardDisk.asOutParam()); H(); 877 877 StorageBus_T enmBus; … … 986 986 987 987 /* Create an inversed tree of parents. */ 988 ComPtr <IHardDisk2> parentHardDisk = hardDisk;988 ComPtr<IHardDisk> parentHardDisk = hardDisk; 989 989 for (PCFGMNODE pParent = pCfg;;) 990 990 { -
trunk/src/VBox/Main/FloppyDriveImpl.cpp
r16560 r16867 273 273 * We also don't lock mParent since its mParent field is const. */ 274 274 275 ComObjPtr <FloppyImage2> image;276 rc = mParent->virtualBox()->findFloppyImage 2(&imageId, NULL,277 275 ComObjPtr<FloppyImage> image; 276 rc = mParent->virtualBox()->findFloppyImage(&imageId, NULL, 277 true /* aSetError */, &image); 278 278 279 279 if (SUCCEEDED (rc)) … … 377 377 } 378 378 379 STDMETHODIMP FloppyDrive::GetImage (IFloppyImage2**aFloppyImage)379 STDMETHODIMP FloppyDrive::GetImage(IFloppyImage **aFloppyImage) 380 380 { 381 381 CheckComArgOutPointerValid(aFloppyImage); -
trunk/src/VBox/Main/HardDisk2Impl.cpp
r16577 r16867 22 22 */ 23 23 24 #include "HardDisk 2Impl.h"24 #include "HardDiskImpl.h" 25 25 26 26 #include "ProgressImpl.h" … … 53 53 * task thread function will delete them when the task is complete! 54 54 * 55 * @note The constructor of this class adds a caller on the managed HardDisk 255 * @note The constructor of this class adds a caller on the managed HardDisk 56 56 * object which is automatically released upon destruction. 57 57 */ 58 struct HardDisk 2::Task : public com::SupportErrorInfoBase58 struct HardDisk::Task : public com::SupportErrorInfoBase 59 59 { 60 60 enum Operation { CreateDynamic, CreateFixed, CreateDiff, 61 61 Merge, Clone, Delete }; 62 62 63 HardDisk 2*that;63 HardDisk *that; 64 64 VirtualBoxBaseProto::AutoCaller autoCaller; 65 65 … … 70 70 HRESULT rc; 71 71 72 Task (HardDisk 2*aThat, Progress *aProgress, Operation aOperation)72 Task (HardDisk *aThat, Progress *aProgress, Operation aOperation) 73 73 : that (aThat), autoCaller (aThat) 74 74 , progress (aProgress) … … 78 78 ~Task(); 79 79 80 void setData (HardDisk 2*aTarget)80 void setData (HardDisk *aTarget) 81 81 { 82 82 d.target = aTarget; … … 104 104 /* CreateDiff */ 105 105 106 ComObjPtr <HardDisk2> target;106 ComObjPtr<HardDisk> target; 107 107 108 108 /* Merge */ … … 116 116 117 117 // SupportErrorInfoBase interface 118 const GUID &mainInterfaceID() const { return COM_IIDOF (IHardDisk 2); }119 const char *componentName() const { return HardDisk 2::ComponentName(); }118 const GUID &mainInterfaceID() const { return COM_IIDOF (IHardDisk); } 119 const char *componentName() const { return HardDisk::ComponentName(); } 120 120 }; 121 121 122 HardDisk 2::Task::~Task()122 HardDisk::Task::~Task() 123 123 { 124 124 /* remove callers added by setData() */ … … 128 128 129 129 /** 130 * Starts a new thread driven by the HardDisk 2::taskThread() function and passes130 * Starts a new thread driven by the HardDisk::taskThread() function and passes 131 131 * this Task instance as an argument. 132 132 * … … 140 140 * other threads asynchronously waiting for it. 141 141 */ 142 HRESULT HardDisk 2::Task::startThread()143 { 144 int vrc = RTThreadCreate (NULL, HardDisk 2::taskThread, this,142 HRESULT HardDisk::Task::startThread() 143 { 144 int vrc = RTThreadCreate (NULL, HardDisk::taskThread, this, 145 145 0, RTTHREADTYPE_MAIN_HEAVY_WORKER, 0, 146 146 "HardDisk::Task"); … … 152 152 153 153 /** 154 * Runs HardDisk 2::taskThread() by passing it this Task instance as an argument154 * Runs HardDisk::taskThread() by passing it this Task instance as an argument 155 155 * on the current thread instead of creating a new one. 156 156 * … … 169 169 * complete the progress object in this case. 170 170 */ 171 HRESULT HardDisk 2::Task::runNow()172 { 173 HardDisk 2::taskThread (NIL_RTTHREAD, this);171 HRESULT HardDisk::Task::runNow() 172 { 173 HardDisk::taskThread (NIL_RTTHREAD, this); 174 174 175 175 return rc; … … 182 182 * 183 183 * @note It is assumed that when modifying methods of this class are called, 184 * HardDisk 2::treeLock() is held in read mode.184 * HardDisk::treeLock() is held in read mode. 185 185 */ 186 class HardDisk 2::MergeChain : public HardDisk2::List,187 186 class HardDisk::MergeChain : public HardDisk::List, 187 public com::SupportErrorInfoBase 188 188 { 189 189 public: … … 220 220 } 221 221 222 HRESULT addSource (HardDisk 2*aHardDisk)222 HRESULT addSource (HardDisk *aHardDisk) 223 223 { 224 224 HRESULT rc = aHardDisk->addCaller(); … … 284 284 } 285 285 286 HRESULT addTarget (HardDisk 2*aHardDisk)286 HRESULT addTarget (HardDisk *aHardDisk) 287 287 { 288 288 HRESULT rc = aHardDisk->addCaller(); … … 314 314 } 315 315 316 HRESULT addIntermediate (HardDisk 2*aHardDisk)316 HRESULT addIntermediate (HardDisk *aHardDisk) 317 317 { 318 318 HRESULT rc = aHardDisk->addCaller(); … … 345 345 346 346 bool isForward() const { return mForward; } 347 HardDisk 2*parent() const { return mParent; }347 HardDisk *parent() const { return mParent; } 348 348 const List &children() const { return mChildren; } 349 349 350 HardDisk 2*source() const350 HardDisk *source() const 351 351 { AssertReturn (size() > 0, NULL); return mForward ? front() : back(); } 352 352 353 HardDisk 2*target() const353 HardDisk *target() const 354 354 { AssertReturn (size() > 0, NULL); return mForward ? back() : front(); } 355 355 … … 357 357 358 358 // SupportErrorInfoBase interface 359 const GUID &mainInterfaceID() const { return COM_IIDOF (IHardDisk 2); }360 const char *componentName() const { return HardDisk 2::ComponentName(); }359 const GUID &mainInterfaceID() const { return COM_IIDOF (IHardDisk); } 360 const char *componentName() const { return HardDisk::ComponentName(); } 361 361 362 362 private: 363 363 364 HRESULT check (HardDisk 2*aHardDisk, bool aChildren, bool aAttachments,364 HRESULT check (HardDisk *aHardDisk, bool aChildren, bool aAttachments, 365 365 bool aImmutable) 366 366 { … … 398 398 } 399 399 400 HRESULT checkChildren (HardDisk 2*aHardDisk)400 HRESULT checkChildren (HardDisk *aHardDisk) 401 401 { return check (aHardDisk, true, false, false); } 402 402 403 HRESULT checkChildrenAndImmutable (HardDisk 2*aHardDisk)403 HRESULT checkChildrenAndImmutable (HardDisk *aHardDisk) 404 404 { return check (aHardDisk, true, false, true); } 405 405 406 HRESULT checkChildrenAndAttachments (HardDisk 2*aHardDisk)406 HRESULT checkChildrenAndAttachments (HardDisk *aHardDisk) 407 407 { return check (aHardDisk, true, true, false); } 408 408 409 HRESULT checkChildrenAndAttachmentsAndImmutable (HardDisk 2*aHardDisk)409 HRESULT checkChildrenAndAttachmentsAndImmutable (HardDisk *aHardDisk) 410 410 { return check (aHardDisk, true, true, true); } 411 411 … … 416 416 417 417 /** Parent of the source when forward merge (if any) */ 418 ComObjPtr <HardDisk 2> mParent;418 ComObjPtr <HardDisk> mParent; 419 419 /** Children of the source when backward merge (if any) */ 420 420 List mChildren; … … 422 422 423 423 //////////////////////////////////////////////////////////////////////////////// 424 // HardDisk 2class424 // HardDisk class 425 425 //////////////////////////////////////////////////////////////////////////////// 426 426 … … 428 428 //////////////////////////////////////////////////////////////////////////////// 429 429 430 DEFINE_EMPTY_CTOR_DTOR (HardDisk 2)431 432 HRESULT HardDisk 2::FinalConstruct()430 DEFINE_EMPTY_CTOR_DTOR (HardDisk) 431 432 HRESULT HardDisk::FinalConstruct() 433 433 { 434 434 /* Initialize the callbacks of the VD error interface */ … … 463 463 int vrc; 464 464 vrc = VDInterfaceAdd (&mm.vdIfError, 465 "HardDisk 2::vdInterfaceError",465 "HardDisk::vdInterfaceError", 466 466 VDINTERFACETYPE_ERROR, 467 467 &mm.vdIfCallsError, this, &mm.vdDiskIfaces); … … 469 469 470 470 vrc = VDInterfaceAdd (&mm.vdIfProgress, 471 "HardDisk 2::vdInterfaceProgress",471 "HardDisk::vdInterfaceProgress", 472 472 VDINTERFACETYPE_PROGRESS, 473 473 &mm.vdIfCallsProgress, this, &mm.vdDiskIfaces); … … 475 475 476 476 vrc = VDInterfaceAdd (&mm.vdIfConfig, 477 "HardDisk 2::vdInterfaceConfig",477 "HardDisk::vdInterfaceConfig", 478 478 VDINTERFACETYPE_CONFIG, 479 479 &mm.vdIfCallsConfig, this, &mm.vdDiskIfaces); … … 481 481 482 482 vrc = VDInterfaceAdd (&mm.vdIfTcpNet, 483 "HardDisk 2::vdInterfaceTcpNet",483 "HardDisk::vdInterfaceTcpNet", 484 484 VDINTERFACETYPE_TCPNET, 485 485 &mm.vdIfCallsTcpNet, this, &mm.vdDiskIfaces); … … 489 489 } 490 490 491 void HardDisk 2::FinalRelease()491 void HardDisk::FinalRelease() 492 492 { 493 493 uninit(); … … 509 509 * @param aLocaiton Storage unit location. 510 510 */ 511 HRESULT HardDisk 2::init(VirtualBox *aVirtualBox, CBSTR aFormat,512 511 HRESULT HardDisk::init(VirtualBox *aVirtualBox, CBSTR aFormat, 512 CBSTR aLocation) 513 513 { 514 514 AssertReturn (aVirtualBox != NULL, E_FAIL); … … 561 561 m.state = MediaState_Created; 562 562 unconst (m.id).create(); 563 rc = mVirtualBox->registerHardDisk 2(this);563 rc = mVirtualBox->registerHardDisk (this); 564 564 565 565 /// @todo later we may want to use a pfnIsConfigSufficient backend info … … 589 589 * @param aLocaiton Storage unit location. 590 590 */ 591 HRESULT HardDisk 2::init (VirtualBox *aVirtualBox, CBSTR aLocation)591 HRESULT HardDisk::init (VirtualBox *aVirtualBox, CBSTR aLocation) 592 592 { 593 593 AssertReturn (aVirtualBox, E_INVALIDARG); … … 649 649 * @note Locks VirtualBox lock for writing, treeLock() for writing. 650 650 */ 651 HRESULT HardDisk 2::init (VirtualBox *aVirtualBox, HardDisk2*aParent,652 651 HRESULT HardDisk::init(VirtualBox *aVirtualBox, HardDisk *aParent, 652 const settings::Key &aNode) 653 653 { 654 654 using namespace settings; … … 746 746 it != hardDisks.end(); ++ it) 747 747 { 748 ComObjPtr <HardDisk2> hardDisk;748 ComObjPtr<HardDisk> hardDisk; 749 749 hardDisk.createObject(); 750 750 rc = hardDisk->init (aVirtualBox, this, *it); 751 751 CheckComRCBreakRC (rc); 752 752 753 rc = mVirtualBox->registerHardDisk 2(hardDisk, false /* aSaveRegistry */);753 rc = mVirtualBox->registerHardDisk(hardDisk, false /* aSaveRegistry */); 754 754 CheckComRCBreakRC (rc); 755 755 } … … 772 772 * @note Locks treeLock() for writing, VirtualBox for writing. 773 773 */ 774 void HardDisk 2::uninit()774 void HardDisk::uninit() 775 775 { 776 776 /* Enclose the state transition Ready->InUninit->NotReady */ … … 814 814 } 815 815 816 // IHardDisk 2properties816 // IHardDisk properties 817 817 //////////////////////////////////////////////////////////////////////////////// 818 818 819 STDMETHODIMP HardDisk 2::COMGETTER(Format) (BSTR *aFormat)819 STDMETHODIMP HardDisk::COMGETTER(Format) (BSTR *aFormat) 820 820 { 821 821 if (aFormat == NULL) … … 831 831 } 832 832 833 STDMETHODIMP HardDisk 2::COMGETTER(Type) (HardDiskType_T *aType)833 STDMETHODIMP HardDisk::COMGETTER(Type) (HardDiskType_T *aType) 834 834 { 835 835 if (aType == NULL) … … 846 846 } 847 847 848 STDMETHODIMP HardDisk 2::COMSETTER(Type) (HardDiskType_T aType)848 STDMETHODIMP HardDisk::COMSETTER(Type) (HardDiskType_T aType) 849 849 { 850 850 AutoCaller autoCaller (this); … … 914 914 } 915 915 916 STDMETHODIMP HardDisk 2::COMGETTER(Parent) (IHardDisk2**aParent)916 STDMETHODIMP HardDisk::COMGETTER(Parent) (IHardDisk **aParent) 917 917 { 918 918 if (aParent == NULL) … … 930 930 } 931 931 932 STDMETHODIMP HardDisk 2::COMGETTER(Children) (ComSafeArrayOut (IHardDisk2*, aChildren))932 STDMETHODIMP HardDisk::COMGETTER(Children) (ComSafeArrayOut (IHardDisk *, aChildren)) 933 933 { 934 934 if (ComSafeArrayOutIsNull (aChildren)) … … 941 941 AutoReadLock treeLock (this->treeLock()); 942 942 943 SafeIfaceArray <IHardDisk2> children (this->children());943 SafeIfaceArray<IHardDisk> children (this->children()); 944 944 children.detachTo (ComSafeArrayOutArg (aChildren)); 945 945 … … 947 947 } 948 948 949 STDMETHODIMP HardDisk 2::COMGETTER(Root) (IHardDisk2**aRoot)949 STDMETHODIMP HardDisk::COMGETTER(Root)(IHardDisk **aRoot) 950 950 { 951 951 if (aRoot == NULL) … … 959 959 } 960 960 961 STDMETHODIMP HardDisk 2::COMGETTER(ReadOnly) (BOOL *aReadOnly)961 STDMETHODIMP HardDisk::COMGETTER(ReadOnly) (BOOL *aReadOnly) 962 962 { 963 963 if (aReadOnly == NULL) … … 974 974 } 975 975 976 STDMETHODIMP HardDisk 2::COMGETTER(LogicalSize) (ULONG64 *aLogicalSize)976 STDMETHODIMP HardDisk::COMGETTER(LogicalSize) (ULONG64 *aLogicalSize) 977 977 { 978 978 if (aLogicalSize == NULL) … … 1005 1005 } 1006 1006 1007 // IHardDisk 2methods1007 // IHardDisk methods 1008 1008 //////////////////////////////////////////////////////////////////////////////// 1009 1009 1010 STDMETHODIMP HardDisk 2::GetProperty (IN_BSTR aName, BSTR *aValue)1010 STDMETHODIMP HardDisk::GetProperty (IN_BSTR aName, BSTR *aValue) 1011 1011 { 1012 1012 CheckComArgStrNotEmptyOrNull (aName); … … 1028 1028 } 1029 1029 1030 STDMETHODIMP HardDisk 2::SetProperty (IN_BSTR aName, IN_BSTR aValue)1030 STDMETHODIMP HardDisk::SetProperty (IN_BSTR aName, IN_BSTR aValue) 1031 1031 { 1032 1032 CheckComArgStrNotEmptyOrNull (aName); … … 1059 1059 } 1060 1060 1061 STDMETHODIMP HardDisk 2::GetProperties(IN_BSTR aNames,1062 1063 1061 STDMETHODIMP HardDisk::GetProperties(IN_BSTR aNames, 1062 ComSafeArrayOut (BSTR, aReturnNames), 1063 ComSafeArrayOut (BSTR, aReturnValues)) 1064 1064 { 1065 1065 CheckComArgOutSafeArrayPointerValid (aReturnNames); … … 1092 1092 } 1093 1093 1094 STDMETHODIMP HardDisk 2::SetProperties(ComSafeArrayIn (IN_BSTR, aNames),1095 1094 STDMETHODIMP HardDisk::SetProperties(ComSafeArrayIn (IN_BSTR, aNames), 1095 ComSafeArrayIn (IN_BSTR, aValues)) 1096 1096 { 1097 1097 CheckComArgSafeArrayNotNull (aNames); … … 1129 1129 } 1130 1130 1131 STDMETHODIMP HardDisk 2::CreateDynamicStorage(ULONG64 aLogicalSize,1132 1131 STDMETHODIMP HardDisk::CreateDynamicStorage(ULONG64 aLogicalSize, 1132 IProgress **aProgress) 1133 1133 { 1134 1134 CheckComArgOutPointerValid (aProgress); … … 1155 1155 ComObjPtr <Progress> progress; 1156 1156 progress.createObject(); 1157 HRESULT rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *>(this),1157 HRESULT rc = progress->init (mVirtualBox, static_cast<IHardDisk*>(this), 1158 1158 BstrFmt (tr ("Creating dynamic hard disk storage unit '%ls'"), 1159 1159 m.locationFull.raw()), … … 1184 1184 } 1185 1185 1186 STDMETHODIMP HardDisk 2::CreateFixedStorage(ULONG64 aLogicalSize,1187 1186 STDMETHODIMP HardDisk::CreateFixedStorage(ULONG64 aLogicalSize, 1187 IProgress **aProgress) 1188 1188 { 1189 1189 CheckComArgOutPointerValid (aProgress); … … 1210 1210 ComObjPtr <Progress> progress; 1211 1211 progress.createObject(); 1212 HRESULT rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *>(this),1212 HRESULT rc = progress->init (mVirtualBox, static_cast<IHardDisk*>(this), 1213 1213 BstrFmt (tr ("Creating fixed hard disk storage unit '%ls'"), 1214 1214 m.locationFull.raw()), … … 1239 1239 } 1240 1240 1241 STDMETHODIMP HardDisk 2::DeleteStorage (IProgress **aProgress)1241 STDMETHODIMP HardDisk::DeleteStorage (IProgress **aProgress) 1242 1242 { 1243 1243 CheckComArgOutPointerValid (aProgress); … … 1258 1258 } 1259 1259 1260 STDMETHODIMP HardDisk 2::CreateDiffStorage (IHardDisk2*aTarget, IProgress **aProgress)1260 STDMETHODIMP HardDisk::CreateDiffStorage (IHardDisk *aTarget, IProgress **aProgress) 1261 1261 { 1262 1262 CheckComArgNotNull (aTarget); … … 1266 1266 CheckComRCReturnRC (autoCaller.rc()); 1267 1267 1268 ComObjPtr <HardDisk2> diff;1268 ComObjPtr<HardDisk> diff; 1269 1269 HRESULT rc = mVirtualBox->cast (aTarget, diff); 1270 1270 CheckComRCReturnRC (rc); … … 1300 1300 } 1301 1301 1302 STDMETHODIMP HardDisk 2::MergeTo (IN_GUID aTargetId, IProgress **aProgress)1302 STDMETHODIMP HardDisk::MergeTo (IN_GUID aTargetId, IProgress **aProgress) 1303 1303 { 1304 1304 AutoCaller autoCaller (this); … … 1308 1308 } 1309 1309 1310 STDMETHODIMP HardDisk 2::CloneTo (IHardDisk2*aTarget, IProgress **aProgress)1310 STDMETHODIMP HardDisk::CloneTo (IHardDisk *aTarget, IProgress **aProgress) 1311 1311 { 1312 1312 CheckComArgNotNull (aTarget); … … 1316 1316 CheckComRCReturnRC (autoCaller.rc()); 1317 1317 1318 ComObjPtr <HardDisk 2> target;1318 ComObjPtr <HardDisk> target; 1319 1319 HRESULT rc = mVirtualBox->cast (aTarget, target); 1320 1320 CheckComRCReturnRC (rc); … … 1335 1335 1336 1336 progress.createObject(); 1337 rc = progress->init (mVirtualBox, static_cast <IHardDisk 2*> (this),1337 rc = progress->init (mVirtualBox, static_cast <IHardDisk *> (this), 1338 1338 BstrFmt (tr ("Creating clone hard disk '%ls'"), 1339 1339 target->m.locationFull.raw()), … … 1378 1378 } 1379 1379 1380 STDMETHODIMP HardDisk 2::FlattenTo (IHardDisk2*aTarget, IProgress **aProgress)1380 STDMETHODIMP HardDisk::FlattenTo (IHardDisk *aTarget, IProgress **aProgress) 1381 1381 { 1382 1382 AutoCaller autoCaller (this); … … 1386 1386 } 1387 1387 1388 STDMETHODIMP HardDisk 2::Compact (IProgress **aProgress)1388 STDMETHODIMP HardDisk::Compact (IProgress **aProgress) 1389 1389 { 1390 1390 AutoCaller autoCaller (this); … … 1407 1407 * @note Locks treeLock() for reading, this object and all children for writing. 1408 1408 */ 1409 void HardDisk 2::updatePaths (const char *aOldPath, const char *aNewPath)1409 void HardDisk::updatePaths (const char *aOldPath, const char *aNewPath) 1410 1410 { 1411 1411 AssertReturnVoid (aOldPath); … … 1443 1443 * @note Locks treeLock() for reading. 1444 1444 */ 1445 ComObjPtr <HardDisk 2> HardDisk2::root (uint32_t *aLevel /*= NULL*/)1446 { 1447 ComObjPtr <HardDisk 2> root;1445 ComObjPtr <HardDisk> HardDisk::root (uint32_t *aLevel /*= NULL*/) 1446 { 1447 ComObjPtr <HardDisk> root; 1448 1448 uint32_t level; 1449 1449 … … 1485 1485 * @note Locks this object and treeLock() for reading. 1486 1486 */ 1487 bool HardDisk 2::isReadOnly()1487 bool HardDisk::isReadOnly() 1488 1488 { 1489 1489 AutoCaller autoCaller (this); … … 1532 1532 * @note Locks this object, treeLock() and children for reading. 1533 1533 */ 1534 HRESULT HardDisk 2::saveSettings (settings::Key &aParentNode)1534 HRESULT HardDisk::saveSettings (settings::Key &aParentNode) 1535 1535 { 1536 1536 using namespace settings; … … 1608 1608 * the specified location, and -1 otherwise. 1609 1609 */ 1610 HRESULT HardDisk 2::compareLocationTo (const char *aLocation, int &aResult)1610 HRESULT HardDisk::compareLocationTo (const char *aLocation, int &aResult) 1611 1611 { 1612 1612 AutoCaller autoCaller (this); … … 1654 1654 * @note Must be called from under this object's read or write lock. 1655 1655 */ 1656 Utf8Str HardDisk 2::name()1656 Utf8Str HardDisk::name() 1657 1657 { 1658 1658 /// @todo NEWMEDIA treat non-FS-paths specially! (may require to requiest … … 1682 1682 * intermediate hard disks for writing. 1683 1683 */ 1684 HRESULT HardDisk 2::prepareDiscard (MergeChain * &aChain)1684 HRESULT HardDisk::prepareDiscard (MergeChain * &aChain) 1685 1685 { 1686 1686 AutoCaller autoCaller (this); … … 1738 1738 m.backRefs.front().snapshotIds.size() == 1, E_FAIL); 1739 1739 1740 ComObjPtr <HardDisk2> child = children().front();1740 ComObjPtr<HardDisk> child = children().front(); 1741 1741 1742 1742 /* we keep this locked, so lock the affected child to make sure the lock … … 1812 1812 * reading or writing. 1813 1813 */ 1814 HRESULT HardDisk 2::discard (ComObjPtr <Progress> &aProgress, MergeChain *aChain)1814 HRESULT HardDisk::discard (ComObjPtr <Progress> &aProgress, MergeChain *aChain) 1815 1815 { 1816 1816 AssertReturn (!aProgress.isNull(), E_FAIL); 1817 1817 1818 ComObjPtr <HardDisk 2> hdFrom;1818 ComObjPtr <HardDisk> hdFrom; 1819 1819 1820 1820 HRESULT rc = S_OK; … … 1885 1885 * reading. 1886 1886 */ 1887 void HardDisk 2::cancelDiscard (MergeChain *aChain)1887 void HardDisk::cancelDiscard (MergeChain *aChain) 1888 1888 { 1889 1889 AutoCaller autoCaller (this); … … 1924 1924 * Returns a preferred format for differencing hard disks. 1925 1925 */ 1926 Bstr HardDisk 2::preferredDiffFormat()1926 Bstr HardDisk::preferredDiffFormat() 1927 1927 { 1928 1928 Bstr format; … … 1970 1970 * writing. 1971 1971 */ 1972 HRESULT HardDisk 2::deleteStorage (ComObjPtr <Progress> *aProgress, bool aWait)1972 HRESULT HardDisk::deleteStorage (ComObjPtr <Progress> *aProgress, bool aWait) 1973 1973 { 1974 1974 AssertReturn (aProgress != NULL || aWait == true, E_FAIL); … … 1977 1977 * ourselves atomically after detecting that deletion is possible to make 1978 1978 * sure that we don't do that after another thread has done 1979 * VirtualBox::findHardDisk 2() but before it starts using us (provided that1979 * VirtualBox::findHardDisk() but before it starts using us (provided that 1980 1980 * it holds a mVirtualBox lock too of course). */ 1981 1981 … … 2047 2047 { 2048 2048 progress.createObject(); 2049 rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *>(this),2049 rc = progress->init (mVirtualBox, static_cast<IHardDisk*>(this), 2050 2050 BstrFmt (tr ("Deleting hard disk storage unit '%ls'"), 2051 2051 m.locationFull.raw()), … … 2120 2120 * @note Locks this object and @a aTarget for writing. 2121 2121 */ 2122 HRESULT HardDisk 2::createDiffStorage (ComObjPtr <HardDisk2> &aTarget,2123 ComObjPtr<Progress> *aProgress,2124 2122 HRESULT HardDisk::createDiffStorage(ComObjPtr<HardDisk> &aTarget, 2123 ComObjPtr<Progress> *aProgress, 2124 bool aWait) 2125 2125 { 2126 2126 AssertReturn (!aTarget.isNull(), E_FAIL); … … 2157 2157 * SnapshotMachine::init()) before deassociating them from the 2158 2158 * current state (which takes place only on success in 2159 * Machine::fixupHardDisks 2()), so that the size of snapshotIds2159 * Machine::fixupHardDisks()), so that the size of snapshotIds 2160 2160 * will be 1 in this case. The given condition is used to filter out 2161 2161 * this legal situatinon and do not report an error. */ … … 2185 2185 { 2186 2186 progress.createObject(); 2187 rc = progress->init (mVirtualBox, static_cast <IHardDisk2*> (this),2187 rc = progress->init (mVirtualBox, static_cast<IHardDisk*> (this), 2188 2188 BstrFmt (tr ("Creating differencing hard disk storage unit '%ls'"), 2189 2189 aTarget->m.locationFull.raw()), … … 2256 2256 * intermediate hard disks for writing. 2257 2257 */ 2258 HRESULT HardDisk 2::prepareMergeTo (HardDisk2*aTarget,2259 2260 2258 HRESULT HardDisk::prepareMergeTo(HardDisk *aTarget, 2259 MergeChain * &aChain, 2260 bool aIgnoreAttachments /*= false*/) 2261 2261 { 2262 2262 AssertReturn (aTarget != NULL, E_FAIL); … … 2278 2278 bool forward; 2279 2279 { 2280 HardDisk 2*parent = mParent;2280 HardDisk *parent = mParent; 2281 2281 while (parent != NULL && parent != aTarget) 2282 2282 parent = parent->mParent; … … 2310 2310 aIgnoreAttachments)); 2311 2311 { 2312 HardDisk 2*last = forward ? aTarget : this;2313 HardDisk 2*first = forward ? this : aTarget;2312 HardDisk *last = forward ? aTarget : this; 2313 HardDisk *first = forward ? this : aTarget; 2314 2314 2315 2315 for (;;) … … 2375 2375 * Note that this (source) hard disk is not uninitialized because of possible 2376 2376 * AutoCaller instances held by the caller of this method on the current thread. 2377 * It's therefore the responsibility of the caller to call HardDisk 2::uninit()2377 * It's therefore the responsibility of the caller to call HardDisk::uninit() 2378 2378 * after releasing all callers in this case! 2379 2379 * … … 2405 2405 * for writing. 2406 2406 */ 2407 HRESULT HardDisk 2::mergeTo(MergeChain *aChain,2408 2409 2407 HRESULT HardDisk::mergeTo(MergeChain *aChain, 2408 ComObjPtr <Progress> *aProgress, 2409 bool aWait) 2410 2410 { 2411 2411 AssertReturn (aChain != NULL, E_FAIL); … … 2430 2430 2431 2431 progress.createObject(); 2432 rc = progress->init (mVirtualBox, static_cast <IHardDisk2 *>(this),2432 rc = progress->init (mVirtualBox, static_cast<IHardDisk*>(this), 2433 2433 BstrFmt (tr ("Merging hard disk '%s' to '%s'"), 2434 2434 name().raw(), aChain->target()->name().raw()), … … 2481 2481 * @note Locks the hard disks from the chain for writing. 2482 2482 */ 2483 void HardDisk 2::cancelMergeTo (MergeChain *aChain)2483 void HardDisk::cancelMergeTo (MergeChain *aChain) 2484 2484 { 2485 2485 AutoCaller autoCaller (this); … … 2514 2514 * @note Must be called from under this object's write lock. 2515 2515 */ 2516 HRESULT HardDisk 2::setLocation (CBSTR aLocation)2516 HRESULT HardDisk::setLocation (CBSTR aLocation) 2517 2517 { 2518 2518 /// @todo so far, we assert but later it makes sense to support null … … 2666 2666 * @note Must be called from under this object's write lock. 2667 2667 */ 2668 HRESULT HardDisk 2::setFormat (CBSTR aFormat)2668 HRESULT HardDisk::setFormat (CBSTR aFormat) 2669 2669 { 2670 2670 /* get the format object first */ … … 2719 2719 * writing. 2720 2720 */ 2721 HRESULT HardDisk 2::queryInfo()2721 HRESULT HardDisk::queryInfo() 2722 2722 { 2723 2723 AutoWriteLock alock (this); … … 2873 2873 2874 2874 Guid id = parentId; 2875 ComObjPtr <HardDisk2> parent;2876 rc = mVirtualBox->findHardDisk 2(&id, NULL,2877 2878 2875 ComObjPtr<HardDisk> parent; 2876 rc = mVirtualBox->findHardDisk(&id, NULL, 2877 false /* aSetError */, 2878 &parent); 2879 2879 if (FAILED (rc)) 2880 2880 { … … 3005 3005 * @note Locks treeLock() for reading. 3006 3006 */ 3007 HRESULT HardDisk 2::canClose()3007 HRESULT HardDisk::canClose() 3008 3008 { 3009 3009 /* we access children */ … … 3021 3021 * @note Called from within this object's AutoWriteLock. 3022 3022 */ 3023 HRESULT HardDisk 2::canAttach(const Guid &aMachineId,3024 3023 HRESULT HardDisk::canAttach(const Guid &aMachineId, 3024 const Guid &aSnapshotId) 3025 3025 { 3026 3026 if (mm.numCreateDiffTasks > 0) … … 3039 3039 * @note Locks treeLock() for writing. 3040 3040 */ 3041 HRESULT HardDisk 2::unregisterWithVirtualBox()3041 HRESULT HardDisk::unregisterWithVirtualBox() 3042 3042 { 3043 3043 /* Note that we need to de-associate ourselves from the parent to let 3044 * unregisterHardDisk 2() properly save the registry */3044 * unregisterHardDisk() properly save the registry */ 3045 3045 3046 3046 /* we modify mParent and access children */ 3047 3047 AutoWriteLock treeLock (this->treeLock()); 3048 3048 3049 const ComObjPtr <HardDisk2, ComWeakRef> parent = mParent;3049 const ComObjPtr<HardDisk, ComWeakRef> parent = mParent; 3050 3050 3051 3051 AssertReturn (children().size() == 0, E_FAIL); … … 3059 3059 } 3060 3060 3061 HRESULT rc = mVirtualBox->unregisterHardDisk 2(this);3061 HRESULT rc = mVirtualBox->unregisterHardDisk(this); 3062 3062 3063 3063 if (FAILED (rc)) … … 3098 3098 * @param aVRC VBox error code to use when no error message is provided. 3099 3099 */ 3100 Utf8Str HardDisk 2::vdError (int aVRC)3100 Utf8Str HardDisk::vdError (int aVRC) 3101 3101 { 3102 3102 Utf8Str error; … … 3127 3127 */ 3128 3128 /*static*/ 3129 DECLCALLBACK(void) HardDisk 2::vdErrorCall(void *pvUser, int rc, RT_SRC_POS_DECL,3130 3131 { 3132 HardDisk 2 *that = static_cast <HardDisk2 *>(pvUser);3129 DECLCALLBACK(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); 3133 3133 AssertReturnVoid (that != NULL); 3134 3134 … … 3149 3149 */ 3150 3150 /*static*/ 3151 DECLCALLBACK(int) HardDisk 2::vdProgressCall(PVM /* pVM */, unsigned uPercent,3152 3153 { 3154 HardDisk 2 *that = static_cast <HardDisk2 *>(pvUser);3151 DECLCALLBACK(int) HardDisk::vdProgressCall(PVM /* pVM */, unsigned uPercent, 3152 void *pvUser) 3153 { 3154 HardDisk *that = static_cast<HardDisk*>(pvUser); 3155 3155 AssertReturn (that != NULL, VERR_GENERAL_FAILURE); 3156 3156 … … 3166 3166 3167 3167 /* static */ 3168 DECLCALLBACK(bool) HardDisk 2::vdConfigAreKeysValid (void *pvUser,3168 DECLCALLBACK(bool) HardDisk::vdConfigAreKeysValid (void *pvUser, 3169 3169 const char *pszzValid) 3170 3170 { 3171 HardDisk 2 *that = static_cast <HardDisk2 *>(pvUser);3171 HardDisk *that = static_cast<HardDisk*>(pvUser); 3172 3172 AssertReturn (that != NULL, false); 3173 3173 … … 3178 3178 3179 3179 /* static */ 3180 DECLCALLBACK(int) HardDisk 2::vdConfigQuerySize(void *pvUser, const char *pszName,3181 3180 DECLCALLBACK(int) HardDisk::vdConfigQuerySize(void *pvUser, const char *pszName, 3181 size_t *pcbValue) 3182 3182 { 3183 3183 AssertReturn (VALID_PTR (pcbValue), VERR_INVALID_POINTER); 3184 3184 3185 HardDisk 2 *that = static_cast <HardDisk2 *>(pvUser);3185 HardDisk *that = static_cast<HardDisk*>(pvUser); 3186 3186 AssertReturn (that != NULL, VERR_GENERAL_FAILURE); 3187 3187 … … 3191 3191 return VERR_CFGM_VALUE_NOT_FOUND; 3192 3192 3193 /* we interpret null values as "no value" in HardDisk 2*/3193 /* we interpret null values as "no value" in HardDisk */ 3194 3194 if (it->second.isNull()) 3195 3195 return VERR_CFGM_VALUE_NOT_FOUND; … … 3201 3201 3202 3202 /* static */ 3203 DECLCALLBACK(int) HardDisk 2::vdConfigQuery (void *pvUser, const char *pszName,3203 DECLCALLBACK(int) HardDisk::vdConfigQuery (void *pvUser, const char *pszName, 3204 3204 char *pszValue, size_t cchValue) 3205 3205 { 3206 3206 AssertReturn (VALID_PTR (pszValue), VERR_INVALID_POINTER); 3207 3207 3208 HardDisk 2 *that = static_cast <HardDisk2 *>(pvUser);3208 HardDisk *that = static_cast<HardDisk*>(pvUser); 3209 3209 AssertReturn (that != NULL, VERR_GENERAL_FAILURE); 3210 3210 … … 3218 3218 return VERR_CFGM_NOT_ENOUGH_SPACE; 3219 3219 3220 /* we interpret null values as "no value" in HardDisk 2*/3220 /* we interpret null values as "no value" in HardDisk */ 3221 3221 if (it->second.isNull()) 3222 3222 return VERR_CFGM_VALUE_NOT_FOUND; … … 3236 3236 */ 3237 3237 /* static */ 3238 DECLCALLBACK(int) HardDisk 2::taskThread (RTTHREAD thread, void *pvUser)3238 DECLCALLBACK(int) HardDisk::taskThread (RTTHREAD thread, void *pvUser) 3239 3239 { 3240 3240 std::auto_ptr <Task> task (static_cast <Task *> (pvUser)); … … 3243 3243 bool isAsync = thread != NIL_RTTHREAD; 3244 3244 3245 HardDisk 2*that = task->that;3245 HardDisk *that = task->that; 3246 3246 3247 3247 /// @todo ugly hack, fix ComAssert... later … … 3276 3276 { 3277 3277 id.create(); 3278 /* VirtualBox::registerHardDisk 2() will need UUID */3278 /* VirtualBox::registerHardDisk() will need UUID */ 3279 3279 unconst (that->m.id) = id; 3280 3280 } … … 3337 3337 * Created state only on success (leaving an orphan file is 3338 3338 * better than breaking media registry consistency) */ 3339 rc = that->mVirtualBox->registerHardDisk 2(that);3339 rc = that->mVirtualBox->registerHardDisk(that); 3340 3340 } 3341 3341 … … 3366 3366 case Task::CreateDiff: 3367 3367 { 3368 ComObjPtr <HardDisk2> &target = task->d.target;3368 ComObjPtr<HardDisk> &target = task->d.target; 3369 3369 3370 3370 /* Lock both in {parent,child} order. The lock is also used as a … … 3382 3382 { 3383 3383 targetId.create(); 3384 /* VirtualBox::registerHardDisk 2() will need UUID */3384 /* VirtualBox::registerHardDisk() will need UUID */ 3385 3385 unconst (target->m.id) = targetId; 3386 3386 } … … 3474 3474 * Created state only on success (leaving an orphan file is 3475 3475 * better than breaking media registry consistency) */ 3476 rc = that->mVirtualBox->registerHardDisk 2(target);3476 rc = that->mVirtualBox->registerHardDisk(target); 3477 3477 3478 3478 if (FAILED (rc)) … … 3677 3677 that->treeLock()); 3678 3678 3679 HardDisk 2*source = chain->source();3680 HardDisk 2*target = chain->target();3679 HardDisk *source = chain->source(); 3680 HardDisk *target = chain->target(); 3681 3681 3682 3682 if (chain->isForward()) … … 3685 3685 * hard disk which needs re-registration */ 3686 3686 rc2 = target->mVirtualBox-> 3687 unregisterHardDisk 2(target, false /* aSaveSettings */);3687 unregisterHardDisk (target, false /* aSaveSettings */); 3688 3688 AssertComRC (rc2); 3689 3689 … … 3706 3706 /* then, register again */ 3707 3707 rc2 = target->mVirtualBox-> 3708 registerHardDisk 2(target, false /* aSaveSettings */);3708 registerHardDisk (target, false /* aSaveSettings */); 3709 3709 AssertComRC (rc2); 3710 3710 } … … 3712 3712 { 3713 3713 Assert (target->children().size() == 1); 3714 HardDisk 2*targetChild = target->children().front();3714 HardDisk *targetChild = target->children().front(); 3715 3715 3716 3716 /* disconnect the deleted branch at the elder end */ … … 3757 3757 3758 3758 rc2 = (*it)->mVirtualBox-> 3759 unregisterHardDisk 2(*it, false /* aSaveSettings */);3759 unregisterHardDisk(*it, false /* aSaveSettings */); 3760 3760 AssertComRC (rc2); 3761 3761 … … 3830 3830 case Task::Clone: 3831 3831 { 3832 ComObjPtr <HardDisk2> &target = task->d.target;3832 ComObjPtr<HardDisk> &target = task->d.target; 3833 3833 3834 3834 /* Lock both in {parent,child} order. The lock is also used as a … … 3846 3846 { 3847 3847 targetId.create(); 3848 /* VirtualBox::registerHardDisk 2() will need UUID */3848 /* VirtualBox::registerHardDisk() will need UUID */ 3849 3849 unconst (target->m.id) = targetId; 3850 3850 } … … 3941 3941 * Created state only on success (leaving an orphan file is 3942 3942 * better than breaking media registry consistency) */ 3943 rc = that->mVirtualBox->registerHardDisk 2(target);3943 rc = that->mVirtualBox->registerHardDisk(target); 3944 3944 3945 3945 if (FAILED (rc)) … … 3954 3954 { 3955 3955 /* just register */ 3956 rc = that->mVirtualBox->registerHardDisk 2(target);3956 rc = that->mVirtualBox->registerHardDisk(target); 3957 3957 } 3958 3958 } -
trunk/src/VBox/Main/HardDiskAttachmentImpl.cpp
r14972 r16867 27 27 ///////////////////////////////////////////////////////////////////////////// 28 28 29 HRESULT HardDisk 2Attachment::FinalConstruct()29 HRESULT HardDiskAttachment::FinalConstruct() 30 30 { 31 31 return S_OK; 32 32 } 33 33 34 void HardDisk 2Attachment::FinalRelease()34 void HardDiskAttachment::FinalRelease() 35 35 { 36 36 uninit(); … … 49 49 * @param aImplicit Wether the attachment contains an implicitly created diff. 50 50 */ 51 HRESULT HardDisk 2Attachment::init (HardDisk2*aHD, StorageBus_T aBus, LONG aChannel,52 51 HRESULT HardDiskAttachment::init(HardDisk *aHD, StorageBus_T aBus, LONG aChannel, 52 LONG aDevice, bool aImplicit /*= false*/) 53 53 { 54 54 AssertReturn (aHD, E_INVALIDARG); … … 75 75 * Called from FinalRelease(). 76 76 */ 77 void HardDisk 2Attachment::uninit()77 void HardDiskAttachment::uninit() 78 78 { 79 79 /* Enclose the state transition Ready->InUninit->NotReady */ … … 83 83 } 84 84 85 // IHardDisk 2Attachment properties85 // IHardDiskAttachment properties 86 86 ///////////////////////////////////////////////////////////////////////////// 87 87 88 STDMETHODIMP HardDisk 2Attachment::COMGETTER(HardDisk) (IHardDisk2**aHardDisk)88 STDMETHODIMP HardDiskAttachment::COMGETTER(HardDisk) (IHardDisk **aHardDisk) 89 89 { 90 90 CheckComArgOutPointerValid(aHardDisk); … … 100 100 } 101 101 102 STDMETHODIMP HardDisk 2Attachment::COMGETTER(Bus) (StorageBus_T *aBus)102 STDMETHODIMP HardDiskAttachment::COMGETTER(Bus) (StorageBus_T *aBus) 103 103 { 104 104 CheckComArgOutPointerValid(aBus); … … 113 113 } 114 114 115 STDMETHODIMP HardDisk 2Attachment::COMGETTER(Channel) (LONG *aChannel)115 STDMETHODIMP HardDiskAttachment::COMGETTER(Channel) (LONG *aChannel) 116 116 { 117 117 CheckComArgOutPointerValid(aChannel); … … 126 126 } 127 127 128 STDMETHODIMP HardDisk 2Attachment::COMGETTER(Device) (LONG *aDevice)128 STDMETHODIMP HardDiskAttachment::COMGETTER(Device) (LONG *aDevice) 129 129 { 130 130 CheckComArgOutPointerValid(aDevice); -
trunk/src/VBox/Main/MachineImpl.cpp
r16560 r16867 1427 1427 1428 1428 STDMETHODIMP Machine:: 1429 COMGETTER(HardDisk 2Attachments) (ComSafeArrayOut (IHardDisk2Attachment *, aAttachments))1429 COMGETTER(HardDiskAttachments) (ComSafeArrayOut(IHardDiskAttachment *, aAttachments)) 1430 1430 { 1431 1431 if (ComSafeArrayOutIsNull (aAttachments)) … … 1437 1437 AutoReadLock alock (this); 1438 1438 1439 SafeIfaceArray <IHardDisk2Attachment> attachments (mHDData->mAttachments);1439 SafeIfaceArray<IHardDiskAttachment> attachments (mHDData->mAttachments); 1440 1440 attachments.detachTo (ComSafeArrayOutArg (aAttachments)); 1441 1441 … … 1882 1882 } 1883 1883 1884 STDMETHODIMP Machine::AttachHardDisk 2(IN_GUID aId,1885 1886 1884 STDMETHODIMP Machine::AttachHardDisk(IN_GUID aId, 1885 StorageBus_T aBus, LONG aChannel, 1886 LONG aDevice) 1887 1887 { 1888 1888 if (aBus == StorageBus_SATA) … … 1934 1934 CheckComRCReturnRC (autoCaller.rc()); 1935 1935 1936 /* VirtualBox::findHardDisk 2() need read lock; also we want to make sure the1936 /* VirtualBox::findHardDisk() need read lock; also we want to make sure the 1937 1937 * hard disk object we pick up doesn't get unregistered before we finish. */ 1938 1938 AutoReadLock vboxLock (mParent); … … 1957 1957 std::find_if (mHDData->mAttachments.begin(), 1958 1958 mHDData->mAttachments.end(), 1959 HardDisk 2Attachment::EqualsTo (aBus, aChannel, aDevice));1959 HardDiskAttachment::EqualsTo (aBus, aChannel, aDevice)); 1960 1960 1961 1961 if (it != mHDData->mAttachments.end()) 1962 1962 { 1963 ComObjPtr <HardDisk2> hd = (*it)->hardDisk();1963 ComObjPtr<HardDisk> hd = (*it)->hardDisk(); 1964 1964 AutoReadLock hdLock (hd); 1965 1965 return setError (VBOX_E_OBJECT_IN_USE, … … 1972 1972 1973 1973 /* find a hard disk by UUID */ 1974 ComObjPtr <HardDisk2> hd;1975 rc = mParent->findHardDisk 2(&id, NULL, true /* aSetError */, &hd);1974 ComObjPtr<HardDisk> hd; 1975 rc = mParent->findHardDisk(&id, NULL, true /* aSetError */, &hd); 1976 1976 CheckComRCReturnRC (rc); 1977 1977 … … 1983 1983 if (std::find_if (mHDData->mAttachments.begin(), 1984 1984 mHDData->mAttachments.end(), 1985 HardDisk 2Attachment::RefersTo (hd)) !=1985 HardDiskAttachment::RefersTo (hd)) != 1986 1986 mHDData->mAttachments.end()) 1987 1987 { … … 2006 2006 HDData::AttachmentList::const_iterator it = 2007 2007 std::find_if (oldAtts.begin(), oldAtts.end(), 2008 HardDisk 2Attachment::RefersTo (hd));2008 HardDiskAttachment::RefersTo (hd)); 2009 2009 if (it != oldAtts.end()) 2010 2010 { … … 2060 2060 if (std::find_if (mHDData->mAttachments.begin(), 2061 2061 mHDData->mAttachments.end(), 2062 HardDisk 2Attachment::RefersTo (2062 HardDiskAttachment::RefersTo ( 2063 2063 (*it)->hardDisk())) != 2064 2064 mHDData->mAttachments.end()) … … 2099 2099 indirect = false; 2100 2100 associate = false; 2101 /* go right to the HardDisk 2Attachment creation */2101 /* go right to the HardDiskAttachment creation */ 2102 2102 break; 2103 2103 } … … 2107 2107 * hard disk's chain to base the new diff on */ 2108 2108 2109 ComObjPtr <HardDisk2> base;2110 ComObjPtr 2109 ComObjPtr<HardDisk> base; 2110 ComObjPtr<Snapshot> snap = mData->mCurrentSnapshot; 2111 2111 while (snap) 2112 2112 { … … 2166 2166 } 2167 2167 2168 ComObjPtr <HardDisk2> diff;2168 ComObjPtr<HardDisk> diff; 2169 2169 diff.createObject(); 2170 2170 rc = diff->init (mParent, hd->preferredDiffFormat(), … … 2205 2205 while (0); 2206 2206 2207 ComObjPtr <HardDisk2Attachment> attachment;2207 ComObjPtr<HardDiskAttachment> attachment; 2208 2208 attachment.createObject(); 2209 2209 rc = attachment->init (hd, aBus, aChannel, aDevice, indirect); … … 2226 2226 } 2227 2227 2228 STDMETHODIMP Machine::GetHardDisk 2(StorageBus_T aBus, LONG aChannel,2229 LONG aDevice, IHardDisk2**aHardDisk)2228 STDMETHODIMP Machine::GetHardDisk(StorageBus_T aBus, LONG aChannel, 2229 LONG aDevice, IHardDisk **aHardDisk) 2230 2230 { 2231 2231 CheckComArgExpr (aBus, aBus != StorageBus_Null); … … 2242 2242 std::find_if (mHDData->mAttachments.begin(), 2243 2243 mHDData->mAttachments.end(), 2244 HardDisk 2Attachment::EqualsTo (aBus, aChannel, aDevice));2244 HardDiskAttachment::EqualsTo (aBus, aChannel, aDevice)); 2245 2245 2246 2246 if (it == mHDData->mAttachments.end()) … … 2254 2254 } 2255 2255 2256 STDMETHODIMP Machine::DetachHardDisk 2(StorageBus_T aBus, LONG aChannel,2257 2256 STDMETHODIMP Machine::DetachHardDisk(StorageBus_T aBus, LONG aChannel, 2257 LONG aDevice) 2258 2258 { 2259 2259 CheckComArgExpr (aBus, aBus != StorageBus_Null); … … 2276 2276 std::find_if (mHDData->mAttachments.begin(), 2277 2277 mHDData->mAttachments.end(), 2278 HardDisk 2Attachment::EqualsTo (aBus, aChannel, aDevice));2278 HardDiskAttachment::EqualsTo (aBus, aChannel, aDevice)); 2279 2279 2280 2280 if (it == mHDData->mAttachments.end()) … … 2283 2283 aDevice, aChannel, aBus); 2284 2284 2285 ComObjPtr <HardDisk2Attachment> hda = *it;2286 ComObjPtr <HardDisk2> hd = hda->hardDisk();2285 ComObjPtr<HardDiskAttachment> hda = *it; 2286 ComObjPtr<HardDisk> hd = hda->hardDisk(); 2287 2287 2288 2288 if (hda->isImplicit()) … … 2290 2290 /* attempt to implicitly delete the implicitly created diff */ 2291 2291 2292 /// @todo move the implicit flag from HardDisk 2Attachment to HardDisk22292 /// @todo move the implicit flag from HardDiskAttachment to HardDisk 2293 2293 /// and forbid any hard disk operation when it is implicit. Or maybe 2294 2294 /// a special media state for it to make it even more simple. … … 5332 5332 5333 5333 /* find a hard disk by UUID */ 5334 ComObjPtr <HardDisk2> hd;5335 rc = mParent->findHardDisk 2(&uuid, NULL, true /* aDoSetError */, &hd);5334 ComObjPtr<HardDisk> hd; 5335 rc = mParent->findHardDisk(&uuid, NULL, true /* aDoSetError */, &hd); 5336 5336 CheckComRCReturnRC (rc); 5337 5337 … … 5367 5367 if (std::find_if (mHDData->mAttachments.begin(), 5368 5368 mHDData->mAttachments.end(), 5369 HardDisk 2Attachment::RefersTo (hd)) !=5369 HardDiskAttachment::RefersTo (hd)) != 5370 5370 mHDData->mAttachments.end()) 5371 5371 { … … 5386 5386 AssertFailedReturn (E_FAIL); 5387 5387 5388 ComObjPtr <HardDisk2Attachment> attachment;5388 ComObjPtr<HardDiskAttachment> attachment; 5389 5389 attachment.createObject(); 5390 5390 rc = attachment->init (hd, bus, channel, device); … … 6668 6668 ++ it) 6669 6669 { 6670 ComObjPtr <HardDisk 2Attachment> att = *it;6670 ComObjPtr <HardDiskAttachment> att = *it; 6671 6671 6672 6672 Key hdNode = aNode.appendKey ("HardDiskAttachment"); … … 6829 6829 HRESULT rc = S_OK; 6830 6830 6831 typedef std::list <ComObjPtr <HardDisk2> > LockedMedia;6831 typedef std::list< ComObjPtr<HardDisk> > LockedMedia; 6832 6832 LockedMedia lockedMedia; 6833 6833 … … 6843 6843 ++ it) 6844 6844 { 6845 ComObjPtr <HardDisk2Attachment> hda = *it;6846 ComObjPtr <HardDisk2> hd = hda->hardDisk();6845 ComObjPtr<HardDiskAttachment> hda = *it; 6846 ComObjPtr<HardDisk> hd = hda->hardDisk(); 6847 6847 6848 6848 rc = hd->LockRead (NULL); … … 6866 6866 it = atts.begin(); it != atts.end(); ++ it) 6867 6867 { 6868 ComObjPtr <HardDisk2Attachment> hda = *it;6869 ComObjPtr <HardDisk2> hd = hda->hardDisk();6868 ComObjPtr<HardDiskAttachment> hda = *it; 6869 ComObjPtr<HardDisk> hd = hda->hardDisk(); 6870 6870 6871 6871 /* type cannot be changed while attached => no need to lock */ … … 6892 6892 CheckComRCThrowRC (rc); 6893 6893 6894 ComObjPtr <HardDisk2> diff;6894 ComObjPtr<HardDisk> diff; 6895 6895 diff.createObject(); 6896 6896 rc = diff->init (mParent, hd->preferredDiffFormat(), … … 6912 6912 6913 6913 /* add a new attachment */ 6914 ComObjPtr <HardDisk2Attachment> attachment;6914 ComObjPtr<HardDiskAttachment> attachment; 6915 6915 attachment.createObject(); 6916 6916 rc = attachment->init (diff, hda->bus(), hda->channel(), … … 6948 6948 /** 6949 6949 * Deletes implicit differencing hard disks created either by 6950 * #createImplicitDiffs() or by #AttachHardDisk 2() and rolls back mHDData.6951 * 6952 * Note that to delete hard disks created by #AttachHardDisk 2() this method is6953 * called from #fixupHardDisks 2() 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. 6954 6954 * 6955 6955 * @note Locks this object for writing. … … 6976 6976 it != mHDData->mAttachments.end(); ++ it) 6977 6977 { 6978 ComObjPtr <HardDisk2> hd = (*it)->hardDisk();6978 ComObjPtr<HardDisk> hd = (*it)->hardDisk(); 6979 6979 6980 6980 if ((*it)->isImplicit()) … … 6989 6989 /* was this hard disk attached before? */ 6990 6990 HDData::AttachmentList::const_iterator oldIt = 6991 std::find_if 6992 HardDisk2Attachment::RefersTo (hd));6991 std::find_if(oldAtts.begin(), oldAtts.end(), 6992 HardDiskAttachment::RefersTo (hd)); 6993 6993 if (oldIt == oldAtts.end()) 6994 6994 { … … 7024 7024 it != implicitAtts.end(); ++ it) 7025 7025 { 7026 ComObjPtr <HardDisk2> hd = (*it)->hardDisk();7026 ComObjPtr<HardDisk> hd = (*it)->hardDisk(); 7027 7027 7028 7028 mrc = hd->deleteStorageAndWait(); … … 7060 7060 * @note Locks this object for writing! 7061 7061 */ 7062 void Machine::fixupHardDisks 2(bool aCommit, bool aOnline /*= false*/)7062 void Machine::fixupHardDisks(bool aCommit, bool aOnline /*= false*/) 7063 7063 { 7064 7064 AutoCaller autoCaller (this); … … 7083 7083 it != mHDData->mAttachments.end(); ++ it) 7084 7084 { 7085 ComObjPtr <HardDisk2> hd = (*it)->hardDisk();7085 ComObjPtr<HardDisk> hd = (*it)->hardDisk(); 7086 7086 7087 7087 if ((*it)->isImplicit()) … … 7098 7098 * new diff for reading if the VM is online */ 7099 7099 7100 ComObjPtr <HardDisk2> parent = hd->parent();7100 ComObjPtr<HardDisk> parent = hd->parent(); 7101 7101 /* make the relock atomic */ 7102 7102 AutoWriteLock parentLock (parent); … … 7113 7113 HDData::AttachmentList::iterator oldIt = 7114 7114 std::find_if (oldAtts.begin(), oldAtts.end(), 7115 HardDisk 2Attachment::RefersTo (hd));7115 HardDiskAttachment::RefersTo (hd)); 7116 7116 if (oldIt != oldAtts.end()) 7117 7117 { … … 7126 7126 it != oldAtts.end(); ++ it) 7127 7127 { 7128 ComObjPtr <HardDisk2> hd = (*it)->hardDisk();7128 ComObjPtr<HardDisk> hd = (*it)->hardDisk(); 7129 7129 7130 7130 /* now de-associate from the current machine state */ … … 7376 7376 7377 7377 if (mHDData.isBackedUp()) 7378 fixupHardDisks 2(false /* aCommit */);7378 fixupHardDisks(false /* aCommit */); 7379 7379 7380 7380 /* check for changes in child objects */ … … 7481 7481 7482 7482 if (mHDData.isBackedUp()) 7483 fixupHardDisks 2(true /* aCommit */);7483 fixupHardDisks(true /* aCommit */); 7484 7484 7485 7485 mBIOSSettings->commit(); … … 7505 7505 mPeer->mUserData.attach (mUserData); 7506 7506 mPeer->mHWData.attach (mHWData); 7507 /* mHDData is reshared by fixupHardDisks 2*/7507 /* mHDData is reshared by fixupHardDisks */ 7508 7508 // mPeer->mHDData.attach (mHDData); 7509 7509 Assert (mPeer->mHDData.data() == mHDData.data()); … … 8482 8482 ++ it) 8483 8483 { 8484 ComObjPtr <HardDisk 2> hd = (*it)->hardDisk();8484 ComObjPtr <HardDisk> hd = (*it)->hardDisk(); 8485 8485 AutoReadLock hdLock (hd); 8486 8486 if (hd->type() == HardDiskType_Writethrough) … … 9499 9499 9500 9500 /* associate old hard disks with the snapshot and do locking/unlocking*/ 9501 fixupHardDisks 2(true /* aCommit */, online);9501 fixupHardDisks(true /* aCommit */, online); 9502 9502 9503 9503 /* inform callbacks */ … … 9514 9514 /* delete all differencing hard disks created (this will also attach 9515 9515 * their parents back by rolling back mHDData) */ 9516 fixupHardDisks 2(false /* aCommit */);9516 fixupHardDisks(false /* aCommit */); 9517 9517 9518 9518 /* delete the saved state file (it might have been already created) */ … … 9642 9642 HardDiskDiscardRec() : chain (NULL) {} 9643 9643 9644 HardDiskDiscardRec (const ComObjPtr <HardDisk2> &aHd,9645 HardDisk 2::MergeChain *aChain = NULL)9644 HardDiskDiscardRec (const ComObjPtr<HardDisk> &aHd, 9645 HardDisk::MergeChain *aChain = NULL) 9646 9646 : hd (aHd), chain (aChain) {} 9647 9647 9648 HardDiskDiscardRec (const ComObjPtr <HardDisk2> &aHd,9649 HardDisk 2::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, 9652 9652 const Guid &aSnapshotId) 9653 9653 : hd (aHd), chain (aChain) … … 9655 9655 , snapshotId (aSnapshotId) {} 9656 9656 9657 ComObjPtr <HardDisk2> hd;9658 HardDisk 2::MergeChain *chain;9657 ComObjPtr<HardDisk> hd; 9658 HardDisk::MergeChain *chain; 9659 9659 /* these are for the replace hard disk case: */ 9660 ComObjPtr <HardDisk2> replaceHd;9661 ComObjPtr <HardDisk2Attachment> replaceHda;9660 ComObjPtr<HardDisk> replaceHd; 9661 ComObjPtr<HardDiskAttachment> replaceHda; 9662 9662 Guid snapshotId; 9663 9663 }; … … 9729 9729 ++ it) 9730 9730 { 9731 ComObjPtr <HardDisk2Attachment> hda = *it;9732 ComObjPtr <HardDisk2> hd = hda->hardDisk();9733 9734 /* HardDisk 2::prepareDiscard() reqiuires a write lock */9731 ComObjPtr<HardDiskAttachment> hda = *it; 9732 ComObjPtr<HardDisk> hd = hda->hardDisk(); 9733 9734 /* HardDisk::prepareDiscard() reqiuires a write lock */ 9735 9735 AutoWriteLock hdLock (hd); 9736 9736 … … 9749 9749 } 9750 9750 9751 HardDisk 2::MergeChain *chain = NULL;9751 HardDisk::MergeChain *chain = NULL; 9752 9752 9753 9753 /* needs to be discarded (merged with the child if any), check … … 9766 9766 9767 9767 /* The below assert would be nice but I don't want to move 9768 * HardDisk 2::MergeChain to the header just for that9768 * HardDisk::MergeChain to the header just for that 9769 9769 * Assert (!chain->isForward()); */ 9770 9770 9771 9771 Assert (hd->children().size() == 1); 9772 9772 9773 ComObjPtr <HardDisk2> replaceHd = hd->children().front();9773 ComObjPtr<HardDisk> replaceHd = hd->children().front(); 9774 9774 9775 9775 Assert (replaceHd->backRefs().front().machineId == mData->mUuid); … … 9796 9796 it = std::find_if (mHDData->mAttachments.begin(), 9797 9797 mHDData->mAttachments.end(), 9798 HardDisk 2Attachment::RefersTo (replaceHd));9798 HardDiskAttachment::RefersTo (replaceHd)); 9799 9799 AssertBreak (it != mHDData->mAttachments.end()); 9800 9800 } … … 9811 9811 it = std::find_if (snapAtts.begin(), 9812 9812 snapAtts.end(), 9813 HardDisk 2Attachment::RefersTo (replaceHd));9813 HardDiskAttachment::RefersTo (replaceHd)); 9814 9814 AssertBreak (it != snapAtts.end()); 9815 9815 } … … 10171 10171 * become unused and need to be auto-deleted */ 10172 10172 10173 std::list <ComObjPtr <HardDisk2> > diffs;10173 std::list< ComObjPtr<HardDisk> > diffs; 10174 10174 10175 10175 for (HDData::AttachmentList::const_iterator … … 10177 10177 it != mHDData.backedUpData()->mAttachments.end(); ++ it) 10178 10178 { 10179 ComObjPtr <HardDisk2> hd = (*it)->hardDisk();10179 ComObjPtr<HardDisk> hd = (*it)->hardDisk(); 10180 10180 10181 10181 /* while the hard disk is attached, the number of children or the … … 10196 10196 * may fail otherwise (too many children of the hard disk to be 10197 10197 * discarded) */ 10198 for (std::list <ComObjPtr <HardDisk2> >::const_iterator10198 for (std::list< ComObjPtr<HardDisk> >::const_iterator 10199 10199 it = diffs.begin(); it != diffs.end(); ++ it) 10200 10200 { … … 10273 10273 { 10274 10274 /* now, delete the unused diffs (only on success!) and uninit them*/ 10275 for (std::list <ComObjPtr <HardDisk2> >::const_iterator10275 for (std::list< ComObjPtr<HardDisk> >::const_iterator 10276 10276 it = diffs.begin(); it != diffs.end(); ++ it) 10277 10277 { … … 10378 10378 it != mHDData->mAttachments.end(); ++ it) 10379 10379 { 10380 ComObjPtr <HardDisk2> hd = (*it)->hardDisk();10380 ComObjPtr<HardDisk> hd = (*it)->hardDisk(); 10381 10381 10382 10382 bool first = true; -
trunk/src/VBox/Main/MediumImpl.cpp
r16853 r16867 1111 1111 1112 1112 //////////////////////////////////////////////////////////////////////////////// 1113 // FloppyImage 2class1114 //////////////////////////////////////////////////////////////////////////////// 1115 1116 DEFINE_EMPTY_CTOR_DTOR (FloppyImage 2)1113 // FloppyImage class 1114 //////////////////////////////////////////////////////////////////////////////// 1115 1116 DEFINE_EMPTY_CTOR_DTOR (FloppyImage) 1117 1117 1118 1118 /** … … 1120 1120 * mVirtualBox write lock. 1121 1121 */ 1122 HRESULT FloppyImage 2::unregisterWithVirtualBox()1122 HRESULT FloppyImage::unregisterWithVirtualBox() 1123 1123 { 1124 1124 return mVirtualBox->unregisterFloppyImage (this); -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r16853 r16867 53 53 #include "Global.h" 54 54 #include "MachineImpl.h" 55 #include "HardDisk 2Impl.h"55 #include "HardDiskImpl.h" 56 56 #include "MediumImpl.h" 57 57 #include "SharedFolderImpl.h" … … 387 387 uninitDependentChildren(); 388 388 389 mData.mHardDisk 2Map.clear();390 391 mData.mFloppyImages 2.clear();392 mData.mDVDImages 2.clear();393 mData.mHardDisks 2.clear();389 mData.mHardDiskMap.clear(); 390 391 mData.mFloppyImages.clear(); 392 mData.mDVDImages.clear(); 393 mData.mHardDisks.clear(); 394 394 395 395 mData.mProgressOperations.clear(); … … 401 401 * some resources of the singletons which would prevent them from 402 402 * uninitializing (as for example, mSystemProperties which owns 403 * HardDiskFormat objects which HardDisk 2objects refer to) */403 * HardDiskFormat objects which HardDisk objects refer to) */ 404 404 if (mData.mSystemProperties) 405 405 { … … 626 626 } 627 627 628 STDMETHODIMP VirtualBox::COMGETTER(HardDisks 2) (ComSafeArrayOut (IHardDisk2*, aHardDisks))628 STDMETHODIMP VirtualBox::COMGETTER(HardDisks) (ComSafeArrayOut (IHardDisk *, aHardDisks)) 629 629 { 630 630 if (ComSafeArrayOutIsNull (aHardDisks)) … … 636 636 AutoReadLock alock (this); 637 637 638 SafeIfaceArray <IHardDisk2> hardDisks (mData.mHardDisks2);638 SafeIfaceArray<IHardDisk> hardDisks (mData.mHardDisks); 639 639 hardDisks.detachTo (ComSafeArrayOutArg (aHardDisks)); 640 640 … … 653 653 AutoReadLock alock (this); 654 654 655 SafeIfaceArray <IDVDImage> images (mData.mDVDImages 2);655 SafeIfaceArray <IDVDImage> images (mData.mDVDImages); 656 656 images.detachTo (ComSafeArrayOutArg (aDVDImages)); 657 657 … … 660 660 661 661 STDMETHODIMP 662 VirtualBox::COMGETTER(FloppyImages) (ComSafeArrayOut (IFloppyImage2*, aFloppyImages))662 VirtualBox::COMGETTER(FloppyImages) (ComSafeArrayOut(IFloppyImage *, aFloppyImages)) 663 663 { 664 664 if (ComSafeArrayOutIsNull (aFloppyImages)) … … 670 670 AutoReadLock alock (this); 671 671 672 SafeIfaceArray <IFloppyImage2> images (mData.mFloppyImages2);672 SafeIfaceArray<IFloppyImage> images (mData.mFloppyImages); 673 673 images.detachTo (ComSafeArrayOutArg (aFloppyImages)); 674 674 … … 1063 1063 } 1064 1064 1065 STDMETHODIMP VirtualBox::CreateHardDisk 2(IN_BSTR aFormat,1066 1067 IHardDisk2**aHardDisk)1065 STDMETHODIMP VirtualBox::CreateHardDisk(IN_BSTR aFormat, 1066 IN_BSTR aLocation, 1067 IHardDisk **aHardDisk) 1068 1068 { 1069 1069 CheckComArgStrNotEmptyOrNull (aFormat); … … 1084 1084 HRESULT rc = E_FAIL; 1085 1085 1086 ComObjPtr <HardDisk2> hardDisk;1086 ComObjPtr<HardDisk> hardDisk; 1087 1087 hardDisk.createObject(); 1088 1088 rc = hardDisk->init (this, format, aLocation); … … 1094 1094 } 1095 1095 1096 STDMETHODIMP VirtualBox::OpenHardDisk 2(IN_BSTR aLocation,1097 IHardDisk2**aHardDisk)1096 STDMETHODIMP VirtualBox::OpenHardDisk(IN_BSTR aLocation, 1097 IHardDisk **aHardDisk) 1098 1098 { 1099 1099 CheckComArgNotNull(aLocation); … … 1107 1107 HRESULT rc = E_FAIL; 1108 1108 1109 ComObjPtr <HardDisk2> hardDisk;1109 ComObjPtr<HardDisk> hardDisk; 1110 1110 hardDisk.createObject(); 1111 1111 rc = hardDisk->init (this, aLocation); … … 1113 1113 if (SUCCEEDED (rc)) 1114 1114 { 1115 rc = registerHardDisk 2(hardDisk);1115 rc = registerHardDisk (hardDisk); 1116 1116 1117 1117 /* Note that it's important to call uninit() on failure to register … … 1128 1128 } 1129 1129 1130 STDMETHODIMP VirtualBox::GetHardDisk 2(IN_GUID aId,1131 IHardDisk2**aHardDisk)1130 STDMETHODIMP VirtualBox::GetHardDisk(IN_GUID aId, 1131 IHardDisk **aHardDisk) 1132 1132 { 1133 1133 CheckComArgOutSafeArrayPointerValid(aHardDisk); … … 1137 1137 1138 1138 Guid id = aId; 1139 ComObjPtr <HardDisk2> hardDisk;1140 HRESULT rc = findHardDisk 2(&id, NULL, true /* setError */, &hardDisk);1139 ComObjPtr<HardDisk> hardDisk; 1140 HRESULT rc = findHardDisk(&id, NULL, true /* setError */, &hardDisk); 1141 1141 1142 1142 /* the below will set *aHardDisk to NULL if hardDisk is null */ … … 1146 1146 } 1147 1147 1148 STDMETHODIMP VirtualBox::FindHardDisk 2(IN_BSTR aLocation,1149 IHardDisk2**aHardDisk)1148 STDMETHODIMP VirtualBox::FindHardDisk(IN_BSTR aLocation, 1149 IHardDisk **aHardDisk) 1150 1150 { 1151 1151 CheckComArgNotNull(aLocation); … … 1155 1155 CheckComRCReturnRC (autoCaller.rc()); 1156 1156 1157 ComObjPtr <HardDisk2> hardDisk;1158 HRESULT rc = findHardDisk 2(NULL, aLocation, true /* setError */, &hardDisk);1157 ComObjPtr<HardDisk> hardDisk; 1158 HRESULT rc = findHardDisk(NULL, aLocation, true /* setError */, &hardDisk); 1159 1159 1160 1160 /* the below will set *aHardDisk to NULL if hardDisk is null */ … … 1233 1233 /** @note Doesn't lock anything. */ 1234 1234 STDMETHODIMP VirtualBox::OpenFloppyImage (IN_BSTR aLocation, IN_GUID aId, 1235 IFloppyImage 2**aFloppyImage)1235 IFloppyImage **aFloppyImage) 1236 1236 { 1237 1237 CheckComArgStrNotEmptyOrNull(aLocation); … … 1248 1248 id.create(); 1249 1249 1250 ComObjPtr <FloppyImage2> image;1250 ComObjPtr<FloppyImage> image; 1251 1251 image.createObject(); 1252 1252 rc = image->init (this, aLocation, id); … … 1264 1264 /** @note Locks objects! */ 1265 1265 STDMETHODIMP VirtualBox::GetFloppyImage (IN_GUID aId, 1266 IFloppyImage 2**aFloppyImage)1266 IFloppyImage **aFloppyImage) 1267 1267 1268 1268 { … … 1273 1273 1274 1274 Guid id = aId; 1275 ComObjPtr <FloppyImage2> image;1276 HRESULT rc = findFloppyImage 2(&id, NULL, true /* setError */, &image);1275 ComObjPtr<FloppyImage> image; 1276 HRESULT rc = findFloppyImage (&id, NULL, true /* setError */, &image); 1277 1277 1278 1278 /* the below will set *aFloppyImage to NULL if image is null */ … … 1284 1284 /** @note Locks objects! */ 1285 1285 STDMETHODIMP VirtualBox::FindFloppyImage (IN_BSTR aLocation, 1286 IFloppyImage 2**aFloppyImage)1286 IFloppyImage **aFloppyImage) 1287 1287 { 1288 1288 CheckComArgNotNull(aLocation); … … 1292 1292 CheckComRCReturnRC (autoCaller.rc()); 1293 1293 1294 ComObjPtr <FloppyImage2> image;1295 HRESULT rc = findFloppyImage 2(NULL, aLocation, true /* setError */, &image);1294 ComObjPtr<FloppyImage> image; 1295 HRESULT rc = findFloppyImage(NULL, aLocation, true /* setError */, &image); 1296 1296 1297 1297 /* the below will set *aFloppyImage to NULL if img is null */ … … 2635 2635 */ 2636 2636 HRESULT VirtualBox:: 2637 findHardDisk 2(const Guid *aId, CBSTR aLocation,2638 bool aSetError, ComObjPtr <HardDisk2> *aHardDisk /*= NULL*/)2637 findHardDisk(const Guid *aId, CBSTR aLocation, 2638 bool aSetError, ComObjPtr<HardDisk> *aHardDisk /*= NULL*/) 2639 2639 { 2640 2640 AssertReturn (aId || aLocation, E_INVALIDARG); … … 2645 2645 if (aId) 2646 2646 { 2647 HardDisk 2Map::const_iterator it = mData.mHardDisk2Map.find (*aId);2648 if (it != mData.mHardDisk 2Map.end())2647 HardDiskMap::const_iterator it = mData.mHardDiskMap.find (*aId); 2648 if (it != mData.mHardDiskMap.end()) 2649 2649 { 2650 2650 if (aHardDisk) … … 2660 2660 Utf8Str location = aLocation; 2661 2661 2662 for (HardDisk 2Map::const_iterator it = mData.mHardDisk2Map.begin();2663 it != mData.mHardDisk 2Map.end();2662 for (HardDiskMap::const_iterator it = mData.mHardDiskMap.begin(); 2663 it != mData.mHardDiskMap.end(); 2664 2664 ++ it) 2665 2665 { 2666 const ComObjPtr <HardDisk2> &hd = (*it).second;2666 const ComObjPtr<HardDisk> &hd = (*it).second; 2667 2667 2668 2668 HRESULT rc = hd->compareLocationTo (location, result); … … 2731 2731 bool found = false; 2732 2732 2733 for (DVDImageList::const_iterator it = mData.mDVDImages 2.begin();2734 it != mData.mDVDImages 2.end();2733 for (DVDImageList::const_iterator it = mData.mDVDImages.begin(); 2734 it != mData.mDVDImages.end(); 2735 2735 ++ it) 2736 2736 { … … 2767 2767 2768 2768 /** 2769 * Searches for a FloppyImage 2object with the given ID or location in the2769 * Searches for a FloppyImage object with the given ID or location in the 2770 2770 * collection of registered DVD images. If both ID and file path are specified, 2771 2771 * the first object that matches either of them (not necessarily both) is … … 2782 2782 * @note Locks this object and image objects for reading. 2783 2783 */ 2784 HRESULT VirtualBox::findFloppyImage 2(const Guid *aId, CBSTR aLocation,2785 2786 ComObjPtr <FloppyImage2> *aImage /* = NULL */)2784 HRESULT VirtualBox::findFloppyImage(const Guid *aId, CBSTR aLocation, 2785 bool aSetError, 2786 ComObjPtr<FloppyImage> *aImage /* = NULL */) 2787 2787 { 2788 2788 AssertReturn (aId || aLocation, E_INVALIDARG); … … 2803 2803 bool found = false; 2804 2804 2805 for (FloppyImage 2List::const_iterator it = mData.mFloppyImages2.begin();2806 it != mData.mFloppyImages 2.end();2805 for (FloppyImageList::const_iterator it = mData.mFloppyImages.begin(); 2806 it != mData.mFloppyImages.end(); 2807 2807 ++ it) 2808 2808 { … … 2925 2925 2926 2926 { 2927 ComObjPtr <HardDisk2> hardDisk;2928 rc = findHardDisk 2(&aId, aLocation, false /* aSetError */, &hardDisk);2927 ComObjPtr<HardDisk> hardDisk; 2928 rc = findHardDisk(&aId, aLocation, false /* aSetError */, &hardDisk); 2929 2929 if (SUCCEEDED (rc)) 2930 2930 { … … 2953 2953 2954 2954 { 2955 ComObjPtr <FloppyImage2> image;2956 rc = findFloppyImage 2(&aId, aLocation, false /* aSetError */, &image);2955 ComObjPtr<FloppyImage> image; 2956 rc = findFloppyImage(&aId, aLocation, false /* aSetError */, &image); 2957 2957 if (SUCCEEDED (rc)) 2958 2958 { … … 3047 3047 it != hardDisks.end(); ++ it) 3048 3048 { 3049 ComObjPtr <HardDisk2> hardDisk;3049 ComObjPtr<HardDisk> hardDisk; 3050 3050 hardDisk.createObject(); 3051 3051 rc = hardDisk->init (this, NULL, *it); 3052 3052 CheckComRCBreakRC (rc); 3053 3053 3054 rc = registerHardDisk 2(hardDisk, false /* aSaveRegistry */);3054 rc = registerHardDisk(hardDisk, false /* aSaveRegistry */); 3055 3055 CheckComRCBreakRC (rc); 3056 3056 } … … 3081 3081 case 2: /* FloppyImages */ 3082 3082 { 3083 ComObjPtr <FloppyImage2> image;3083 ComObjPtr<FloppyImage> image; 3084 3084 image.createObject(); 3085 3085 rc = image->init (this, *it); … … 3168 3168 Key hardDisksNode = registryNode.createKey ("HardDisks"); 3169 3169 3170 for (HardDisk 2List::const_iterator it =3171 mData.mHardDisks 2.begin();3172 it != mData.mHardDisks 2.end();3170 for (HardDiskList::const_iterator it = 3171 mData.mHardDisks.begin(); 3172 it != mData.mHardDisks.end(); 3173 3173 ++ it) 3174 3174 { … … 3183 3183 3184 3184 for (DVDImageList::const_iterator it = 3185 mData.mDVDImages 2.begin();3186 it != mData.mDVDImages 2.end();3185 mData.mDVDImages.begin(); 3186 it != mData.mDVDImages.end(); 3187 3187 ++ it) 3188 3188 { … … 3196 3196 Key imagesNode = registryNode.createKey ("FloppyImages"); 3197 3197 3198 for (FloppyImage 2List::const_iterator it =3199 mData.mFloppyImages 2.begin();3200 it != mData.mFloppyImages 2.end();3198 for (FloppyImageList::const_iterator it = 3199 mData.mFloppyImages.begin(); 3200 it != mData.mFloppyImages.end(); 3201 3201 ++ it) 3202 3202 { … … 3307 3307 * @note Locks this object for writing and @a aHardDisk for reading. 3308 3308 */ 3309 HRESULT VirtualBox::registerHardDisk 2 (HardDisk2*aHardDisk,3310 3309 HRESULT VirtualBox::registerHardDisk(HardDisk *aHardDisk, 3310 bool aSaveRegistry /*= true*/) 3311 3311 { 3312 3312 AssertReturn (aHardDisk != NULL, E_INVALIDARG); … … 3340 3340 { 3341 3341 /* base (root) hard disk */ 3342 mData.mHardDisks 2.push_back (aHardDisk);3343 } 3344 3345 mData.mHardDisk 2Map3346 .insert (HardDisk 2Map::value_type (3347 aHardDisk->id(), HardDisk 2Map::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))); 3348 3348 3349 3349 if (aSaveRegistry) … … 3351 3351 rc = saveSettings(); 3352 3352 if (FAILED (rc)) 3353 unregisterHardDisk 2(aHardDisk, false /* aSaveRegistry */);3353 unregisterHardDisk(aHardDisk, false /* aSaveRegistry */); 3354 3354 } 3355 3355 … … 3372 3372 * @note Locks this object for writing and @a aHardDisk for reading. 3373 3373 */ 3374 HRESULT VirtualBox::unregisterHardDisk 2 (HardDisk2*aHardDisk,3375 3374 HRESULT VirtualBox::unregisterHardDisk(HardDisk *aHardDisk, 3375 bool aSaveRegistry /*= true*/) 3376 3376 { 3377 3377 AssertReturn (aHardDisk != NULL, E_INVALIDARG); … … 3387 3387 AutoReadLock hardDiskLock (aHardDisk); 3388 3388 3389 size_t cnt = mData.mHardDisk 2Map.erase (aHardDisk->id());3389 size_t cnt = mData.mHardDiskMap.erase (aHardDisk->id()); 3390 3390 Assert (cnt == 1); 3391 3391 … … 3393 3393 { 3394 3394 /* base (root) hard disk */ 3395 mData.mHardDisks 2.remove (aHardDisk);3395 mData.mHardDisks.remove (aHardDisk); 3396 3396 } 3397 3397 … … 3402 3402 rc = saveSettings(); 3403 3403 if (FAILED (rc)) 3404 registerHardDisk 2(aHardDisk, false /* aSaveRegistry */);3404 registerHardDisk(aHardDisk, false /* aSaveRegistry */); 3405 3405 } 3406 3406 … … 3453 3453 3454 3454 /* add to the collection */ 3455 mData.mDVDImages 2.push_back (aImage);3455 mData.mDVDImages.push_back (aImage); 3456 3456 3457 3457 if (aSaveRegistry) … … 3495 3495 AutoReadLock imageLock (aImage); 3496 3496 3497 mData.mDVDImages 2.remove (aImage);3497 mData.mDVDImages.remove (aImage); 3498 3498 3499 3499 HRESULT rc = S_OK; … … 3524 3524 * @note Locks this object for writing and @a aImage for reading. 3525 3525 */ 3526 HRESULT VirtualBox::registerFloppyImage (FloppyImage2*aImage,3527 3526 HRESULT VirtualBox::registerFloppyImage(FloppyImage *aImage, 3527 bool aSaveRegistry /*= true*/) 3528 3528 { 3529 3529 AssertReturn (aImage != NULL, E_INVALIDARG); … … 3554 3554 3555 3555 /* add to the collection */ 3556 mData.mFloppyImages 2.push_back (aImage);3556 mData.mFloppyImages.push_back (aImage); 3557 3557 3558 3558 if (aSaveRegistry) … … 3581 3581 * @note Locks this object for writing and @a aImage for reading. 3582 3582 */ 3583 HRESULT VirtualBox::unregisterFloppyImage (FloppyImage2*aImage,3584 3583 HRESULT VirtualBox::unregisterFloppyImage(FloppyImage *aImage, 3584 bool aSaveRegistry /*= true*/) 3585 3585 { 3586 3586 AssertReturn (aImage != NULL, E_INVALIDARG); … … 3596 3596 AutoReadLock imageLock (aImage); 3597 3597 3598 mData.mFloppyImages 2.remove (aImage);3598 mData.mFloppyImages.remove (aImage); 3599 3599 3600 3600 HRESULT rc = S_OK; … … 3620 3620 * @note Locks #childrenLock() for reading. 3621 3621 */ 3622 HRESULT VirtualBox::cast (IHardDisk 2 *aFrom, ComObjPtr <HardDisk2> &aTo)3622 HRESULT VirtualBox::cast (IHardDisk *aFrom, ComObjPtr <HardDisk> &aTo) 3623 3623 { 3624 3624 AssertReturn (aFrom != NULL, E_INVALIDARG); … … 3639 3639 * implementations of IHardDisk can be among our children */ 3640 3640 3641 aTo = static_cast <HardDisk2 *>(child);3641 aTo = static_cast<HardDisk*>(child); 3642 3642 3643 3643 return S_OK; … … 3667 3667 3668 3668 /* check DVD paths */ 3669 for (DVDImageList::iterator it = mData.mDVDImages 2.begin();3670 it != mData.mDVDImages 2.end();3669 for (DVDImageList::iterator it = mData.mDVDImages.begin(); 3670 it != mData.mDVDImages.end(); 3671 3671 ++ it) 3672 3672 { … … 3675 3675 3676 3676 /* check Floppy paths */ 3677 for (FloppyImage 2List::iterator it = mData.mFloppyImages2.begin();3678 it != mData.mFloppyImages 2.end();3677 for (FloppyImageList::iterator it = mData.mFloppyImages.begin(); 3678 it != mData.mFloppyImages .end(); 3679 3679 ++ it) 3680 3680 { … … 3683 3683 3684 3684 /* check HardDisk paths */ 3685 for (HardDisk 2List::const_iterator it = mData.mHardDisks2.begin();3686 it != mData.mHardDisks 2.end();3685 for (HardDiskList::const_iterator it = mData.mHardDisks.begin(); 3686 it != mData.mHardDisks.end(); 3687 3687 ++ it) 3688 3688 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r16853 r16867 437 437 438 438 The first diagram shows what happens when a lengthy setup operation is 439 being executed (such as <link to="IMachine::attachHardDisk 2"/>).439 being executed (such as <link to="IMachine::attachHardDisk"/>). 440 440 441 441 <pre> … … 1111 1111 <li><link to="DeviceType_HardDisk"/>: the media is a hard disk 1112 1112 that, if registered, can be obtained using the 1113 <link to="IVirtualBox::getHardDisk 2"/> call.</li>1113 <link to="IVirtualBox::getHardDisk"/> call.</li> 1114 1114 <li><link to="DeviceType_DVD"/>: the media is a CD/DVD image 1115 1115 that, if registered, can be obtained using the … … 1385 1385 </attribute> 1386 1386 1387 <attribute name="hardDisks 2" type="IHardDisk2" readonly="yes" safearray="yes">1387 <attribute name="hardDisks" type="IHardDisk" readonly="yes" safearray="yes"> 1388 1388 <desc> 1389 1389 Array of hard disk objects known to this VirtualBox installation. … … 1391 1391 This array contains only base (root) hard disks. All differencing 1392 1392 hard disks of the given base hard disk can be enumerated using 1393 <link to="IHardDisk 2::children"/>.1393 <link to="IHardDisk::children"/>. 1394 1394 </desc> 1395 1395 </attribute> … … 1401 1401 </attribute> 1402 1402 1403 <attribute name="floppyImages" type="IFloppyImage 2" readonly="yes" safearray="yes">1403 <attribute name="floppyImages" type="IFloppyImage" readonly="yes" safearray="yes"> 1404 1404 <desc> 1405 1405 Array of floppy image objects registered with this VirtualBox instance. … … 1738 1738 </method> 1739 1739 1740 <method name="createHardDisk 2">1740 <method name="createHardDisk"> 1741 1741 <desc> 1742 1742 Creates a new base hard disk object that will use the given storage … … 1748 1748 allocate a format-specific storage unit at the specified location: 1749 1749 <ul> 1750 <li><link to="IHardDisk 2::createDynamicStorage"/></li>1751 <li><link to="IHardDisk 2::createFixedStorage"/></li>1752 <li><link to="IHardDisk 2::createDiffStorage"/></li>1750 <li><link to="IHardDisk::createDynamicStorage"/></li> 1751 <li><link to="IHardDisk::createFixedStorage"/></li> 1752 <li><link to="IHardDisk::createDiffStorage"/></li> 1753 1753 </ul> 1754 1754 1755 Some hard disk attributes, such as <link to="IHardDisk 2::id"/>, may1755 Some hard disk attributes, such as <link to="IHardDisk::id"/>, may 1756 1756 remain uninitialized until the hard disk storage unit is successfully 1757 1757 created by one of the above methods. … … 1759 1759 After the storage unit is successfully created, the hard disk gets 1760 1760 remembered by this VirtualBox installation and will be accessible 1761 through <link to="#getHardDisk 2"/> and <link to="#findHardDisk2"/>1761 through <link to="#getHardDisk"/> and <link to="#findHardDisk"/> 1762 1762 methods. Remembered root (base) hard disks are also returned as part of 1763 the <link to="#hardDisks 2"/> array. See IHardDisk2for more details.1763 the <link to="#hardDisks"/> array. See IHardDisk for more details. 1764 1764 1765 1765 The list of all storage formats supported by this VirtualBox … … 1771 1771 1772 1772 Note that the format of the location string is storage format specific. 1773 See <link to="IMedium::location"/>, IHardDisk 2and1773 See <link to="IMedium::location"/>, IHardDisk and 1774 1774 <link to="ISystemProperties::defaultHardDiskFolder"/> for more details. 1775 1775 … … 1795 1795 </desc> 1796 1796 </param> 1797 <param name="hardDisk" type="IHardDisk 2" dir="return">1797 <param name="hardDisk" type="IHardDisk" dir="return"> 1798 1798 <desc>Created hard disk object.</desc> 1799 1799 </param> 1800 1800 </method> 1801 1801 1802 <method name="openHardDisk 2">1802 <method name="openHardDisk"> 1803 1803 <desc> 1804 1804 Opens a hard disk from an existing location. … … 1806 1806 After the hard disk is successfully opened by this method, it gets 1807 1807 remembered by (known to) this VirtualBox installation and will be 1808 accessible through <link to="#getHardDisk 2"/> and1809 <link to="#findHardDisk 2"/> methods. Remembered root (base) hard disks1810 are also returned as part of the <link to="#hardDisks 2"/> array and can1811 be attached to virtual machines. See IHardDisk 2for 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. 1812 1812 1813 1813 If a differencing hard disk is to be opened by this method, the … … 1820 1820 1821 1821 Note that the format of the location string is storage format specific. 1822 See <link to="IMedium::location"/>, IHardDisk 2and1822 See <link to="IMedium::location"/>, IHardDisk and 1823 1823 <link to="ISystemProperties::defaultHardDiskFolder"/> for more details. 1824 1824 … … 1841 1841 </desc> 1842 1842 </param> 1843 <param name="hardDisk" type="IHardDisk 2" dir="return">1843 <param name="hardDisk" type="IHardDisk" dir="return"> 1844 1844 <desc>Opened hard disk object.</desc> 1845 1845 </param> 1846 1846 </method> 1847 1847 1848 <method name="getHardDisk 2" const="yes">1848 <method name="getHardDisk" const="yes"> 1849 1849 <desc> 1850 1850 Returns a hard disk with the given UUID. … … 1852 1852 The hard disk with the given UUID must be known to this VirtualBox 1853 1853 installation, i.e. it must be previously created by 1854 <link to="#createHardDisk 2"/> or opened by <link1855 to="#openHardDisk 2"/>, 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. 1856 1856 1857 1857 <result name="VBOX_E_OBJECT_NOT_FOUND"> … … 1863 1863 <desc>UUID of the hard disk to look for.</desc> 1864 1864 </param> 1865 <param name="hardDisk" type="IHardDisk 2" dir="return">1865 <param name="hardDisk" type="IHardDisk" dir="return"> 1866 1866 <desc>Found hard disk object.</desc> 1867 1867 </param> 1868 1868 </method> 1869 1869 1870 <method name="findHardDisk 2">1870 <method name="findHardDisk"> 1871 1871 <desc> 1872 1872 Returns a hard disk that uses the given location to store hard … … 1875 1875 The given hard disk must be known to this VirtualBox installation, i.e. 1876 1876 it must be previously created by 1877 <link to="#createHardDisk 2"/> or opened by <link1878 to="#openHardDisk 2"/>, 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. 1879 1879 1880 1880 The search is done by comparing the value of the @a location argument to 1881 the <link to="IHardDisk 2::location"/> attribute of each known hard1881 the <link to="IHardDisk::location"/> attribute of each known hard 1882 1882 disk. 1883 1883 … … 1899 1899 <desc>Location string to search for.</desc> 1900 1900 </param> 1901 <param name="hardDisk" type="IHardDisk 2" dir="return">1901 <param name="hardDisk" type="IHardDisk" dir="return"> 1902 1902 <desc>Found hard disk object.</desc> 1903 1903 </param> … … 2039 2039 </desc> 2040 2040 </param> 2041 <param name="image" type="IFloppyImage 2" dir="return">2041 <param name="image" type="IFloppyImage" dir="return"> 2042 2042 <desc>Opened floppy image object.</desc> 2043 2043 </param> … … 2060 2060 <desc>UUID of the image to look for.</desc> 2061 2061 </param> 2062 <param name="image" type="IFloppyImage 2" dir="return">2062 <param name="image" type="IFloppyImage" dir="return"> 2063 2063 <desc>Found floppy image object.</desc> 2064 2064 </param> … … 2095 2095 <desc>Floppy image file path to look for.</desc> 2096 2096 </param> 2097 <param name="image" type="IFloppyImage 2" dir="return">2097 <param name="image" type="IFloppyImage" dir="return"> 2098 2098 <desc>Found floppy image object.</desc> 2099 2099 </param> … … 3935 3935 </attribute> 3936 3936 3937 <attribute name="hardDisk 2Attachments" type="IHardDisk2Attachment" readonly="yes" safearray="yes">3937 <attribute name="hardDiskAttachments" type="IHardDiskAttachment" readonly="yes" safearray="yes"> 3938 3938 <desc>Array of hard disks attached to this machine.</desc> 3939 3939 </attribute> … … 4244 4244 </method> 4245 4245 4246 <method name="attachHardDisk 2">4246 <method name="attachHardDisk"> 4247 4247 <desc> 4248 4248 Attaches a virtual hard disk identified by the given UUID @a id … … 4265 4265 this method will fail. 4266 4266 4267 See <link to="IHardDisk 2"/> for more detailed information about4267 See <link to="IHardDisk"/> for more detailed information about 4268 4268 attaching hard disks. 4269 4269 … … 4312 4312 </method> 4313 4313 4314 <method name="getHardDisk 2" const="yes">4314 <method name="getHardDisk" const="yes"> 4315 4315 <desc> 4316 4316 Returns the virtual hard disk attached to a device slot of the specified … … 4318 4318 4319 4319 Note that if the hard disk was indirectly attached by 4320 <link to="#attachHardDisk 2"/> to the given device slot then this4320 <link to="#attachHardDisk"/> to the given device slot then this 4321 4321 method will return not the same object as passed to the 4322 <link to="#attachHardDisk 2"/> call. See <link to="IHardDisk2"/> for4322 <link to="#attachHardDisk"/> call. See <link to="IHardDisk"/> for 4323 4323 more detailed information about attaching hard disks. 4324 4324 … … 4337 4337 <desc>Device slot in the given channel to query.</desc> 4338 4338 </param> 4339 <param name="hardDisk" type="IHardDisk 2" dir="return">4339 <param name="hardDisk" type="IHardDisk" dir="return"> 4340 4340 <desc>Attached hard disk object.</desc> 4341 4341 </param> 4342 4342 </method> 4343 4343 4344 <method name="detachHardDisk 2">4344 <method name="detachHardDisk"> 4345 4345 <desc> 4346 4346 Detaches the virtual hard disk attached to a device slot of the … … 4350 4350 that the hard disk remains associated with the machine when this method 4351 4351 returns and gets actually de-associated only after a successful 4352 <link to="#saveSettings"/> call. See <link to="IHardDisk 2"/>4352 <link to="#saveSettings"/> call. See <link to="IHardDisk"/> 4353 4353 for more detailed information about attaching hard disks. 4354 4354 … … 4358 4358 <note> 4359 4359 Detaching differencing hard disks implicitly created by <link 4360 to="#attachHardDisk 2"/> for the indirect attachment using this4360 to="#attachHardDisk"/> for the indirect attachment using this 4361 4361 method will <b>not</b> implicitly delete them. The 4362 <link to="IHardDisk 2::deleteStorage"/> operation should be4362 <link to="IHardDisk::deleteStorage"/> operation should be 4363 4363 explicitly performed by the caller after the hard disk is successfully 4364 4364 detached and the settings are saved with … … 6950 6950 6951 6951 <see> 6952 IHardDisk 2,6953 <link to="IVirtualBox::createHardDisk 2"/>,6954 <link to="IVirtualBox::openHardDisk 2"/>,6952 IHardDisk, 6953 <link to="IVirtualBox::createHardDisk"/>, 6954 <link to="IVirtualBox::openHardDisk"/>, 6955 6955 <link to="IMedium::location"/> 6956 6956 </see> … … 6965 6965 Keep in mind that the hard disk format identifier 6966 6966 (<link to="IHardDiskFormat::id"/>) used in other API calls like 6967 <link to="IVirtualBox::createHardDisk 2"/> to refer to a particular6967 <link to="IVirtualBox::createHardDisk"/> to refer to a particular 6968 6968 hard disk format is a case-insensitive string. This means that, for 6969 6969 example, all of the following strings: … … 6990 6990 The hard disk format set by this attribute is used by VirtualBox 6991 6991 when the hard disk format was not specified explicitly. One example is 6992 <link to="IVirtualBox::createHardDisk 2"/> with the <tt>null</tt>6992 <link to="IVirtualBox::createHardDisk"/> with the <tt>null</tt> 6993 6993 format argument. A more complex example is implicit creation of 6994 6994 differencing hard disks when taking a snapshot of a virtual machine: … … 7014 7014 <link to="#hardDiskFormats"/>, 7015 7015 <link to="IHardDiskFormat::id"/>, 7016 <link to="IVirtualBox::createHardDisk 2"/>7016 <link to="IVirtualBox::createHardDisk"/> 7017 7017 </see> 7018 7018 </desc> … … 7475 7475 Snapshots can be chained. Chained snapshots form a branch where 7476 7476 every next snapshot is based on the previous one. This chaining is 7477 mostly related to hard disk branching (see <link to="IHardDisk 2"/>7477 mostly related to hard disk branching (see <link to="IHardDisk"/> 7478 7478 description). This means that every time a new snapshot is created, 7479 7479 a new differencing hard disk is implicitly created for all normal … … 7722 7722 interface such as: 7723 7723 <ul> 7724 <li>IHardDisk 2(virtual hard disks)</li>7724 <li>IHardDisk (virtual hard disks)</li> 7725 7725 <li>IDVDImage (standard CD/DVD ISO image files)</li> 7726 <li>IFloppyImage 2(raw floppy image files)</li>7726 <li>IFloppyImage (raw floppy image files)</li> 7727 7727 </ul> 7728 7728 … … 7730 7730 media type: 7731 7731 <ul> 7732 <li><link to="IVirtualBox::openHardDisk 2"/></li>7732 <li><link to="IVirtualBox::openHardDisk"/></li> 7733 7733 <li><link to="IVirtualBox::openDVDImage"/></li> 7734 7734 <li><link to="IVirtualBox::openFloppyImage"/></li> … … 7736 7736 7737 7737 New hard disk media are created using the 7738 <link to="IVirtualBox::createHardDisk 2"/> method. CD/DVD and floppy7738 <link to="IVirtualBox::createHardDisk"/> method. CD/DVD and floppy 7739 7739 images are created outside VirtualBox, usually by storing a copy 7740 7740 of the real medium of the corresponding type in a regular file. … … 7749 7749 7750 7750 Newly created virtual hard disks get remembered only when the associated 7751 storage unit is actually created (see IHardDisk 2for more details).7751 storage unit is actually created (see IHardDisk for more details). 7752 7752 7753 7753 All known media can be enumerated using 7754 <link to="IVirtualBox::hardDisks 2"/>,7754 <link to="IVirtualBox::hardDisks"/>, 7755 7755 <link to="IVirtualBox::DVDImages"/> and 7756 7756 <link to="IVirtualBox::floppyImages"/> attributes. Individual media can be 7757 quickly found by UUID using <link to="IVirtualBox::getHardDisk 2"/>7757 quickly found by UUID using <link to="IVirtualBox::getHardDisk"/> 7758 7758 and similar methods or by location using 7759 <link to="IVirtualBox::findHardDisk 2"/> and similar methods.7759 <link to="IVirtualBox::findHardDisk"/> and similar methods. 7760 7760 7761 7761 Only known media can be attached to virtual machines. … … 7853 7853 <link to="MediaState_LockedWrite"/>, <link to="MediaState_Creating"/>, 7854 7854 <link to="MediaState_Deleting"/> are meaningless for IDVDImage and 7855 IFloppyImage 2media.7855 IFloppyImage media. 7856 7856 </desc> 7857 7857 </attribute> … … 8124 8124 deleted. In particular, this means that this hard disk can be 8125 8125 later opened again using the <link 8126 to="IVirtualBox::openHardDisk 2"/> call.8126 to="IVirtualBox::openHardDisk"/> call. 8127 8127 8128 8128 Note that after this method successfully returns, the given hard … … 8152 8152 8153 8153 <!-- 8154 // IHardDisk 28154 // IHardDisk 8155 8155 ///////////////////////////////////////////////////////////////////////// 8156 8156 --> … … 8186 8186 8187 8187 <interface 8188 name="IHardDisk 2Attachment" extends="$unknown"8189 uuid=" fa2f4619-2c14-4090-869e-73b45419b7b5"8188 name="IHardDiskAttachment" extends="$unknown" 8189 uuid="b1dd04bb-93c0-4ad3-a9cf-82316e595836" 8190 8190 wsmap="struct" 8191 8191 > 8192 8192 <desc> 8193 The IHardDisk 2Attachment interface represents a hard disk attachment of a8193 The IHardDiskAttachment interface represents a hard disk attachment of a 8194 8194 virtual machine. 8195 8195 … … 8198 8198 8199 8199 The array of hard disk attachments is returned by 8200 <link to="IMachine::hardDisk 2Attachments"/>.8200 <link to="IMachine::hardDiskAttachments"/>. 8201 8201 8202 8202 <note> … … 8206 8206 </note> 8207 8207 </desc> 8208 <attribute name="hardDisk" type="IHardDisk 2" readonly="yes">8208 <attribute name="hardDisk" type="IHardDisk" readonly="yes"> 8209 8209 <desc>Hard disk object associated with this attachment.</desc> 8210 8210 </attribute> … … 8225 8225 8226 8226 <interface 8227 name="IHardDisk 2" extends="IMedium"8228 uuid=" ed6e2525-c2fd-42a4-917a-7a9045ac9e15"8227 name="IHardDisk" extends="IMedium" 8228 uuid="244f89fe-1943-464d-baad-2efd73e5d532" 8229 8229 wsmap="managed" 8230 8230 > 8231 8231 <desc> 8232 The IHardDisk 2interface represents a virtual hard disk drive8233 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. 8234 8234 8235 8235 Virtual hard disk objects virtualize the hard disk hardware and look like … … 8277 8277 8278 8278 New base hard disks are created using 8279 <link to="IVirtualBox::createHardDisk 2"/>. Existing hard disks are8280 opened using <link to="IVirtualBox::openHardDisk 2"/>. Differencing hard8279 <link to="IVirtualBox::createHardDisk"/>. Existing hard disks are 8280 opened using <link to="IVirtualBox::openHardDisk"/>. Differencing hard 8281 8281 disks are usually implicitly created by VirtualBox when needed but may 8282 8282 also be created explicitly using <link to="#createDiffStorage"/>. … … 8285 8285 or opened, it becomes a known hard disk (remembered in the internal media 8286 8286 registry). Known hard disks can be attached to a virtual machine, accessed 8287 through <link to="IVirtualBox::getHardDisk 2"/> and8288 <link to="IVirtualBox::findHardDisk 2"/> methods or enumerated using the8289 <link to="IVirtualBox::hardDisks 2"/> 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). 8290 8290 8291 8291 The following methods, besides <link to="IMedium::close"/>, … … 8327 8327 8328 8328 Hard disks are attached to virtual machines using the 8329 <link to="IMachine::attachHardDisk 2"/> method and detached using the8330 <link to="IMachine::detachHardDisk 2"/> method. Depending on their8329 <link to="IMachine::attachHardDisk"/> method and detached using the 8330 <link to="IMachine::detachHardDisk"/> method. Depending on their 8331 8331 <link to="#type"/>, hard disks are attached either 8332 8332 <i>directly</i> or <i>indirectly</i>. … … 8337 8337 hard disk linked to it is implicitly created and this differencing hard 8338 8338 disk is associated with the machine and used for hard disk operations. 8339 This also means that if <link to="IMachine::attachHardDisk 2"/> performs8339 This also means that if <link to="IMachine::attachHardDisk"/> performs 8340 8340 a direct attachment then the same hard disk will be returned in response 8341 to the subsequent <link to="IMachine::getHardDisk 2"/> call; however if8341 to the subsequent <link to="IMachine::getHardDisk"/> call; however if 8342 8342 an indirect attachment is performed then 8343 <link to="IMachine::getHardDisk 2"/> will return the implicitly created8343 <link to="IMachine::getHardDisk"/> will return the implicitly created 8344 8344 differencing hard disk, not the original one passed to <link 8345 to="IMachine::attachHardDisk 2"/>. The following table shows the8345 to="IMachine::attachHardDisk"/>. The following table shows the 8346 8346 dependency of the attachment type on the hard disk type: 8347 8347 … … 8404 8404 Detaching hard disks is performed in a <i>deferred</i> fashion. This means 8405 8405 that the given hard disk remains associated with the given machine after a 8406 successful <link to="IMachine::detachHardDisk 2"/> call until8406 successful <link to="IMachine::detachHardDisk"/> call until 8407 8407 <link to="IMachine::saveSettings"/> is called to save all changes to 8408 8408 machine settings to disk. This deferring is necessary to guarantee that … … 8415 8415 <link to="IMachine::saveSettings"/> is made, it will implicitly delete 8416 8416 all differencing hard disks implicitly created by 8417 <link to="IMachine::attachHardDisk 2"/> for these indirect attachments.8417 <link to="IMachine::attachHardDisk"/> for these indirect attachments. 8418 8418 Such implicitly created hard disks will also be immediately deleted when 8419 detached explicitly using the <link to="IMachine::detachHardDisk 2"/>8419 detached explicitly using the <link to="IMachine::detachHardDisk"/> 8420 8420 call if it is made before <link to="IMachine::saveSettings"/>. This 8421 8421 implicit deletion is safe because newly created differencing hard … … 8423 8423 8424 8424 However, keep in mind that detaching differencing hard disks that were 8425 implicitly created by <link to="IMachine::attachHardDisk 2"/>8425 implicitly created by <link to="IMachine::attachHardDisk"/> 8426 8426 before the last <link to="IMachine::saveSettings"/> call will 8427 8427 <b>not</b> implicitly delete them as they may already contain some data … … 8541 8541 </attribute> 8542 8542 8543 <attribute name="parent" type="IHardDisk 2" readonly="yes">8543 <attribute name="parent" type="IHardDisk" readonly="yes"> 8544 8544 <desc> 8545 8545 Parent of this hard disk (a hard disk this hard disk is directly based … … 8551 8551 </attribute> 8552 8552 8553 <attribute name="children" type="IHardDisk 2" safearray="yes" readonly="yes">8553 <attribute name="children" type="IHardDisk" safearray="yes" readonly="yes"> 8554 8554 <desc> 8555 8555 Children of this hard disk (all differencing hard disks directly based … … 8559 8559 </attribute> 8560 8560 8561 <attribute name="root" type="IHardDisk 2" readonly="yes">8561 <attribute name="root" type="IHardDisk" readonly="yes"> 8562 8562 <desc> 8563 8563 Root hard disk of this hard disk. … … 8875 8875 </result> 8876 8876 </desc> 8877 <param name="target" type="IHardDisk 2" dir="in">8877 <param name="target" type="IHardDisk" dir="in"> 8878 8878 <desc>Target hard disk.</desc> 8879 8879 </param> … … 8989 8989 </note> 8990 8990 </desc> 8991 <param name="target" type="IHardDisk 2" dir="in">8991 <param name="target" type="IHardDisk" dir="in"> 8992 8992 <desc>Target hard disk.</desc> 8993 8993 </param> … … 9022 9022 </note> 9023 9023 </desc> 9024 <param name="target" type="IHardDisk 2" dir="in">9024 <param name="target" type="IHardDisk" dir="in"> 9025 9025 <desc>Target hard disk.</desc> 9026 9026 </param> … … 9116 9116 <desc> 9117 9117 Supports being used as a format for differencing hard disks (see <link 9118 to="IHardDisk 2::createDiffStorage"/>).9118 to="IHardDisk::createDiffStorage"/>). 9119 9119 </desc> 9120 9120 </const> … … 9161 9161 Each hard disk format is identified by a string represented by the 9162 9162 <link to="#id"/> attribute. This string is used in calls like 9163 <link to="IVirtualBox::createHardDisk 2"/> to specify the desired9163 <link to="IVirtualBox::createHardDisk"/> to specify the desired 9164 9164 format. 9165 9165 … … 9167 9167 <link to="ISystemProperties::hardDiskFormats"/>. 9168 9168 9169 <see>IHardDisk 2</see>9169 <see>IHardDisk</see> 9170 9170 </desc> 9171 9171 … … 9185 9185 This string is used in methods of other interfaces where it is necessary 9186 9186 to specify a hard disk format, such as 9187 <link to="IVirtualBox::createHardDisk 2"/>.9187 <link to="IVirtualBox::createHardDisk"/>. 9188 9188 </desc> 9189 9189 </attribute> … … 9259 9259 9260 9260 <!-- 9261 // IFloppyImage 29261 // IFloppyImage 9262 9262 ///////////////////////////////////////////////////////////////////////// 9263 9263 --> 9264 9264 9265 9265 <interface 9266 name="IFloppyImage 2" extends="IMedium"9267 uuid="f cdee8f0-03f9-11dd-95ff-0800200c9a66"9266 name="IFloppyImage" extends="IMedium" 9267 uuid="faa6101f-078c-4b3a-ab75-75670c8170b3" 9268 9268 wsmap="managed" 9269 9269 > 9270 9270 <desc> 9271 The IFloppyImage 2interface represents a medium containing the image9272 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. 9273 9273 </desc> 9274 9274 … … 9419 9419 <method name="getImage"> 9420 9420 <desc>Returns the currently mounted floppy image.</desc> 9421 <param name="image" type="IFloppyImage 2" dir="return"/>9421 <param name="image" type="IFloppyImage" dir="return"/> 9422 9422 </method> 9423 9423 -
trunk/src/VBox/Main/include/FloppyDriveImpl.h
r15991 r16867 56 56 57 57 BOOL enabled; 58 ComObjPtr <FloppyImage2> image;58 ComObjPtr<FloppyImage> image; 59 59 ComPtr <IHostFloppyDrive> hostDrive; 60 60 DriveState_T state; … … 94 94 STDMETHOD(CaptureHostDrive) (IHostFloppyDrive *aHostFloppyDrive); 95 95 STDMETHOD(Unmount)(); 96 STDMETHOD(GetImage) (IFloppyImage 2**aFloppyImage);96 STDMETHOD(GetImage) (IFloppyImage **aFloppyImage); 97 97 STDMETHOD(GetHostDrive) (IHostFloppyDrive **aHostFloppyDrive); 98 98 -
trunk/src/VBox/Main/include/HardDiskAttachmentImpl.h
r14949 r16867 25 25 #include "VirtualBoxBase.h" 26 26 27 #include "HardDisk 2Impl.h"27 #include "HardDiskImpl.h" 28 28 29 class ATL_NO_VTABLE HardDisk 2Attachment :29 class ATL_NO_VTABLE HardDiskAttachment : 30 30 public VirtualBoxBaseNEXT, 31 public com::SupportErrorInfoImpl <HardDisk2Attachment, IHardDisk2Attachment>,32 public VirtualBoxSupportTranslation <HardDisk2Attachment>,33 public IHardDisk 2Attachment31 public com::SupportErrorInfoImpl<HardDiskAttachment, IHardDiskAttachment>, 32 public VirtualBoxSupportTranslation<HardDiskAttachment>, 33 public IHardDiskAttachment 34 34 { 35 35 public: … … 37 37 /** Equality predicate for stdc++. */ 38 38 struct EqualsTo 39 : public std::unary_function <ComObjPtr <HardDisk2Attachment>, bool>39 : public std::unary_function <ComObjPtr<HardDiskAttachment>, bool> 40 40 { 41 41 explicit EqualsTo (StorageBus_T aBus, LONG aChannel, LONG aDevice) … … 55 55 /** Hard disk reference predicate for stdc++. */ 56 56 struct RefersTo 57 : public std::unary_function <ComObjPtr <HardDisk2Attachment>, bool>57 : public std::unary_function< ComObjPtr<HardDiskAttachment>, bool> 58 58 { 59 explicit RefersTo (HardDisk 2*aHardDisk) : hardDisk (aHardDisk) {}59 explicit RefersTo (HardDisk *aHardDisk) : hardDisk (aHardDisk) {} 60 60 61 61 bool operator() (const argument_type &aThat) const … … 64 64 } 65 65 66 const ComObjPtr <HardDisk 2> hardDisk;66 const ComObjPtr <HardDisk> hardDisk; 67 67 }; 68 68 69 DECLARE_NOT_AGGREGATABLE(HardDisk 2Attachment)69 DECLARE_NOT_AGGREGATABLE(HardDiskAttachment) 70 70 71 71 DECLARE_PROTECT_FINAL_CONSTRUCT() 72 72 73 BEGIN_COM_MAP (HardDisk 2Attachment)73 BEGIN_COM_MAP (HardDiskAttachment) 74 74 COM_INTERFACE_ENTRY(ISupportErrorInfo) 75 COM_INTERFACE_ENTRY(IHardDisk 2Attachment)75 COM_INTERFACE_ENTRY(IHardDiskAttachment) 76 76 END_COM_MAP() 77 77 … … 82 82 83 83 // public initializer/uninitializer for internal purposes only 84 HRESULT init (HardDisk2*aHD, StorageBus_T aBus, LONG aChannel,85 84 HRESULT init(HardDisk *aHD, StorageBus_T aBus, LONG aChannel, 85 LONG aDevice, bool aImplicit = false); 86 86 void uninit(); 87 87 88 // IHardDisk 2Attachment properties89 STDMETHOD(COMGETTER(HardDisk)) (IHardDisk 2**aHardDisk);88 // IHardDiskAttachment properties 89 STDMETHOD(COMGETTER(HardDisk)) (IHardDisk **aHardDisk); 90 90 STDMETHOD(COMGETTER(Bus)) (StorageBus_T *aBus); 91 91 STDMETHOD(COMGETTER(Channel)) (LONG *aChannel); … … 98 98 void setImplicit (bool aImplicit) { m.implicit = aImplicit; } 99 99 100 const ComObjPtr <HardDisk2> &hardDisk() const { return m.hardDisk; }100 const ComObjPtr<HardDisk> &hardDisk() const { return m.hardDisk; } 101 101 StorageBus_T bus() const { return m.bus; } 102 102 LONG channel() const { return m.channel; } … … 104 104 105 105 /** 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) 107 107 { 108 108 m.hardDisk = aHardDisk; … … 111 111 112 112 /** For com::SupportErrorInfoImpl. */ 113 static const char *ComponentName() { return "HardDisk 2Attachment"; }113 static const char *ComponentName() { return "HardDiskAttachment"; } 114 114 115 115 private: … … 122 122 /// @todo NEWMEDIA shouldn't it be constant too? It'd be nice to get 123 123 /// rid of locks at all in this simple readonly structure-like interface 124 ComObjPtr <HardDisk2> hardDisk;124 ComObjPtr<HardDisk> hardDisk; 125 125 const StorageBus_T bus; 126 126 const LONG channel; -
trunk/src/VBox/Main/include/HardDiskFormatImpl.h
r14949 r16867 37 37 * (IHardDiskFormat interface). 38 38 * 39 * @note Instances of this class are permanently caller-referenced by HardDisk 239 * @note Instances of this class are permanently caller-referenced by HardDisk 40 40 * objects (through addCaller()) so that an attempt to uninitialize or delete 41 * them before all HardDisk 2objects are uninitialized will produce an endless41 * them before all HardDisk objects are uninitialized will produce an endless 42 42 * wait! 43 43 */ -
trunk/src/VBox/Main/include/HardDiskImpl.h
r16850 r16867 22 22 */ 23 23 24 #ifndef ____H_HARDDISK 2IMPL25 #define ____H_HARDDISK 2IMPL24 #ifndef ____H_HARDDISKIMPL 25 #define ____H_HARDDISKIMPL 26 26 27 27 #include "VirtualBoxBase.h" … … 42 42 43 43 /** 44 * The HardDisk 2 component class implements the IHardDisk2interface.44 * The HardDisk component class implements the IHardDisk interface. 45 45 */ 46 class ATL_NO_VTABLE HardDisk 247 : public com::SupportErrorInfoDerived <MediumBase, HardDisk2, IHardDisk2>48 , public VirtualBoxBaseWithTypedChildrenNEXT <HardDisk2>49 , public VirtualBoxSupportTranslation <HardDisk2>50 , public IHardDisk 246 class ATL_NO_VTABLE HardDisk 47 : public com::SupportErrorInfoDerived<MediumBase, HardDisk, IHardDisk> 48 , public VirtualBoxBaseWithTypedChildrenNEXT<HardDisk> 49 , public VirtualBoxSupportTranslation<HardDisk> 50 , public IHardDisk 51 51 { 52 52 public: 53 53 54 typedef VirtualBoxBaseWithTypedChildrenNEXT <HardDisk 2>::DependentChildren54 typedef VirtualBoxBaseWithTypedChildrenNEXT <HardDisk>::DependentChildren 55 55 List; 56 56 57 57 class MergeChain; 58 58 59 VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (HardDisk 2)60 61 DECLARE_NOT_AGGREGATABLE (HardDisk 2)59 VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (HardDisk) 60 61 DECLARE_NOT_AGGREGATABLE (HardDisk) 62 62 63 63 DECLARE_PROTECT_FINAL_CONSTRUCT() 64 64 65 BEGIN_COM_MAP (HardDisk 2)65 BEGIN_COM_MAP (HardDisk) 66 66 COM_INTERFACE_ENTRY (ISupportErrorInfo) 67 67 COM_INTERFACE_ENTRY2 (IMedium, MediumBase) 68 COM_INTERFACE_ENTRY (IHardDisk 2)68 COM_INTERFACE_ENTRY (IHardDisk) 69 69 END_COM_MAP() 70 70 71 71 NS_DECL_ISUPPORTS 72 72 73 DECLARE_EMPTY_CTOR_DTOR (HardDisk 2)73 DECLARE_EMPTY_CTOR_DTOR (HardDisk) 74 74 75 75 HRESULT FinalConstruct(); … … 81 81 HRESULT init (VirtualBox *aVirtualBox, 82 82 CBSTR aLocation); 83 HRESULT init (VirtualBox *aVirtualBox, HardDisk 2*aParent,83 HRESULT init (VirtualBox *aVirtualBox, HardDisk *aParent, 84 84 const settings::Key &aNode); 85 85 void uninit(); … … 88 88 COM_FORWARD_IMedium_TO_BASE (MediumBase) 89 89 90 // IHardDisk 2properties90 // IHardDisk properties 91 91 STDMETHOD(COMGETTER(Format)) (BSTR *aFormat); 92 92 STDMETHOD(COMGETTER(Type)) (HardDiskType_T *aType); 93 93 STDMETHOD(COMSETTER(Type)) (HardDiskType_T aType); 94 STDMETHOD(COMGETTER(Parent)) (IHardDisk 2**aParent);95 STDMETHOD(COMGETTER(Children)) (ComSafeArrayOut (IHardDisk 2*, aChildren));96 STDMETHOD(COMGETTER(Root)) (IHardDisk 2**aRoot);94 STDMETHOD(COMGETTER(Parent)) (IHardDisk **aParent); 95 STDMETHOD(COMGETTER(Children)) (ComSafeArrayOut (IHardDisk *, aChildren)); 96 STDMETHOD(COMGETTER(Root)) (IHardDisk **aRoot); 97 97 STDMETHOD(COMGETTER(ReadOnly)) (BOOL *aReadOnly); 98 98 STDMETHOD(COMGETTER(LogicalSize)) (ULONG64 *aLogicalSize); 99 99 100 // IHardDisk 2methods100 // IHardDisk methods 101 101 STDMETHOD(GetProperty) (IN_BSTR aName, BSTR *aValue); 102 102 STDMETHOD(SetProperty) (IN_BSTR aName, IN_BSTR aValue); … … 109 109 STDMETHOD(CreateFixedStorage) (ULONG64 aLogicalSize, IProgress **aProgress); 110 110 STDMETHOD(DeleteStorage) (IProgress **aProgress); 111 STDMETHOD(CreateDiffStorage) (IHardDisk 2*aTarget, IProgress **aProgress);111 STDMETHOD(CreateDiffStorage) (IHardDisk *aTarget, IProgress **aProgress); 112 112 STDMETHOD(MergeTo) (IN_GUID aTargetId, IProgress **aProgress); 113 STDMETHOD(CloneTo) (IHardDisk 2*aTarget, IProgress **aProgress);114 STDMETHOD(FlattenTo) (IHardDisk 2*aTarget, IProgress **aProgress);113 STDMETHOD(CloneTo) (IHardDisk *aTarget, IProgress **aProgress); 114 STDMETHOD(FlattenTo) (IHardDisk *aTarget, IProgress **aProgress); 115 115 STDMETHOD(Compact) (IProgress **aProgress); 116 116 … … 124 124 void updatePaths (const char *aOldPath, const char *aNewPath); 125 125 126 ComObjPtr <HardDisk2> root (uint32_t *aLevel = NULL);126 ComObjPtr<HardDisk> root (uint32_t *aLevel = NULL); 127 127 128 128 bool isReadOnly(); … … 150 150 * completion and implies the progress object will be used for waiting. 151 151 */ 152 HRESULT createDiffStorageNoWait (ComObjPtr <HardDisk2> &aTarget,152 HRESULT createDiffStorageNoWait (ComObjPtr<HardDisk> &aTarget, 153 153 ComObjPtr <Progress> &aProgress) 154 154 { return createDiffStorage (aTarget, &aProgress, false /* aWait */); } … … 158 158 * blocking the current thread. 159 159 */ 160 HRESULT createDiffStorageAndWait (ComObjPtr <HardDisk2> &aTarget,160 HRESULT createDiffStorageAndWait (ComObjPtr<HardDisk> &aTarget, 161 161 ComObjPtr <Progress> *aProgress = NULL) 162 162 { return createDiffStorage (aTarget, aProgress, true /* aWait */); } 163 163 164 HRESULT prepareMergeTo (HardDisk 2*aTarget, MergeChain * &aChain,164 HRESULT prepareMergeTo (HardDisk *aTarget, MergeChain * &aChain, 165 165 bool aIgnoreAttachments = false); 166 166 … … 195 195 // a caller and a read lock before calling them!) 196 196 197 ComObjPtr <HardDisk 2> parent() const { return static_cast <HardDisk2*> (mParent); }197 ComObjPtr <HardDisk> parent() const { return static_cast <HardDisk *> (mParent); } 198 198 HardDiskType_T type() const { return mm.type; } 199 199 200 200 /** For com::SupportErrorInfoImpl. */ 201 static const char *ComponentName() { return "HardDisk 2"; }201 static const char *ComponentName() { return "HardDisk"; } 202 202 203 203 protected: … … 205 205 HRESULT deleteStorage (ComObjPtr <Progress> *aProgress, bool aWait); 206 206 207 HRESULT createDiffStorage (ComObjPtr <HardDisk 2> &aTarget,207 HRESULT createDiffStorage (ComObjPtr <HardDisk> &aTarget, 208 208 ComObjPtr <Progress> *aProgress, 209 209 bool aWait); … … 262 262 263 263 /** weak parent */ 264 ComObjPtr <HardDisk 2, ComWeakRef> mParent;264 ComObjPtr <HardDisk, ComWeakRef> mParent; 265 265 266 266 struct Task; … … 307 307 }; 308 308 309 #endif /* ____H_HARDDISK 2IMPL */309 #endif /* ____H_HARDDISKIMPL */ 310 310 311 311 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/include/MachineImpl.h
r15582 r16867 290 290 bool operator== (const HDData &that) const; 291 291 292 typedef std::list <ComObjPtr <HardDisk2Attachment> > AttachmentList;292 typedef std::list< ComObjPtr<HardDiskAttachment> > AttachmentList; 293 293 AttachmentList mAttachments; 294 294 }; … … 503 503 STDMETHOD(COMGETTER(SnapshotFolder))(BSTR *aSavedStateFolder); 504 504 STDMETHOD(COMSETTER(SnapshotFolder))(IN_BSTR aSavedStateFolder); 505 STDMETHOD(COMGETTER(HardDisk 2Attachments))(ComSafeArrayOut (IHardDisk2Attachment *, aAttachments));505 STDMETHOD(COMGETTER(HardDiskAttachments))(ComSafeArrayOut (IHardDiskAttachment *, aAttachments)); 506 506 STDMETHOD(COMGETTER(VRDPServer))(IVRDPServer **vrdpServer); 507 507 STDMETHOD(COMGETTER(DVDDrive))(IDVDDrive **dvdDrive); … … 532 532 STDMETHOD(SetBootOrder)(ULONG aPosition, DeviceType_T aDevice); 533 533 STDMETHOD(GetBootOrder)(ULONG aPosition, DeviceType_T *aDevice); 534 STDMETHOD(AttachHardDisk 2)(IN_GUID aId, StorageBus_T aBus,535 536 STDMETHOD(GetHardDisk 2)(StorageBus_T aBus, LONG aChannel, LONG aDevice,537 IHardDisk2**aHardDisk);538 STDMETHOD(DetachHardDisk 2)(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); 539 539 STDMETHOD(GetSerialPort) (ULONG slot, ISerialPort **port); 540 540 STDMETHOD(GetParallelPort) (ULONG slot, IParallelPort **port); … … 772 772 HRESULT deleteImplicitDiffs(); 773 773 774 void fixupHardDisks 2(bool aCommit, bool aOnline = false);774 void fixupHardDisks(bool aCommit, bool aOnline = false); 775 775 776 776 HRESULT lockConfig(); -
trunk/src/VBox/Main/include/MediumImpl.h
r16853 r16867 289 289 290 290 /** 291 * The FloppyImage 2 component class implements the IFloppyImage2interface.292 */ 293 class ATL_NO_VTABLE FloppyImage 2294 : public com::SupportErrorInfoDerived <ImageMediumBase, FloppyImage 2, IFloppyImage2>295 , public VirtualBoxSupportTranslation <FloppyImage 2>296 , public IFloppyImage 2291 * The FloppyImage component class implements the IFloppyImage interface. 292 */ 293 class ATL_NO_VTABLE FloppyImage 294 : public com::SupportErrorInfoDerived <ImageMediumBase, FloppyImage, IFloppyImage> 295 , public VirtualBoxSupportTranslation <FloppyImage> 296 , public IFloppyImage 297 297 { 298 298 public: … … 300 300 COM_FORWARD_IMedium_TO_BASE (ImageMediumBase) 301 301 302 VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (FloppyImage 2)303 304 DECLARE_NOT_AGGREGATABLE (FloppyImage 2)302 VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (FloppyImage) 303 304 DECLARE_NOT_AGGREGATABLE (FloppyImage) 305 305 306 306 DECLARE_PROTECT_FINAL_CONSTRUCT() 307 307 308 BEGIN_COM_MAP (FloppyImage 2)308 BEGIN_COM_MAP (FloppyImage) 309 309 COM_INTERFACE_ENTRY (ISupportErrorInfo) 310 310 COM_INTERFACE_ENTRY2 (IMedium, ImageMediumBase) 311 COM_INTERFACE_ENTRY (IFloppyImage 2)311 COM_INTERFACE_ENTRY (IFloppyImage) 312 312 END_COM_MAP() 313 313 314 314 NS_DECL_ISUPPORTS 315 315 316 DECLARE_EMPTY_CTOR_DTOR (FloppyImage 2)316 DECLARE_EMPTY_CTOR_DTOR (FloppyImage) 317 317 318 318 // public initializer/uninitializer for internal purposes only … … 332 332 333 333 /** For com::SupportErrorInfoImpl. */ 334 static const char *ComponentName() { return "FloppyImage 2"; }334 static const char *ComponentName() { return "FloppyImage"; } 335 335 336 336 private: -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r16853 r16867 43 43 class Machine; 44 44 class SessionMachine; 45 class HardDisk 2;45 class HardDisk; 46 46 class DVDImage; 47 class FloppyImage 2;47 class FloppyImage; 48 48 class MachineCollection; 49 49 class GuestOSType; … … 126 126 STDMETHOD(COMGETTER(SystemProperties)) (ISystemProperties **aSystemProperties); 127 127 STDMETHOD(COMGETTER(Machines2)) (ComSafeArrayOut (IMachine *, aMachines)); 128 STDMETHOD(COMGETTER(HardDisks 2)) (ComSafeArrayOut (IHardDisk2*, aHardDisks));128 STDMETHOD(COMGETTER(HardDisks)) (ComSafeArrayOut (IHardDisk *, aHardDisks)); 129 129 STDMETHOD(COMGETTER(DVDImages)) (ComSafeArrayOut (IDVDImage *, aDVDImages)); 130 STDMETHOD(COMGETTER(FloppyImages)) (ComSafeArrayOut (IFloppyImage 2*, aFloppyImages));130 STDMETHOD(COMGETTER(FloppyImages)) (ComSafeArrayOut (IFloppyImage *, aFloppyImages)); 131 131 STDMETHOD(COMGETTER(ProgressOperations)) (ComSafeArrayOut (IProgress *, aOperations)); 132 132 STDMETHOD(COMGETTER(GuestOSTypes)) (IGuestOSTypeCollection **aGuestOSTypes); … … 147 147 STDMETHOD(CreateAppliance) (IAppliance **anAppliance); 148 148 149 STDMETHOD(CreateHardDisk 2)(IN_BSTR aFormat, IN_BSTR aLocation,150 IHardDisk2**aHardDisk);151 STDMETHOD(OpenHardDisk 2) (IN_BSTR aLocation, IHardDisk2**aHardDisk);152 STDMETHOD(GetHardDisk 2) (IN_GUID aId, IHardDisk2**aHardDisk);153 STDMETHOD(FindHardDisk 2) (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); 154 154 155 155 STDMETHOD(OpenDVDImage) (IN_BSTR aLocation, IN_GUID aId, … … 159 159 160 160 STDMETHOD(OpenFloppyImage) (IN_BSTR aLocation, IN_GUID aId, 161 IFloppyImage 2**aFloppyImage);162 STDMETHOD(GetFloppyImage) (IN_GUID aId, IFloppyImage 2**aFloppyImage);163 STDMETHOD(FindFloppyImage) (IN_BSTR aLocation, IFloppyImage 2**aFloppyImage);161 IFloppyImage **aFloppyImage); 162 STDMETHOD(GetFloppyImage) (IN_GUID aId, IFloppyImage **aFloppyImage); 163 STDMETHOD(FindFloppyImage) (IN_BSTR aLocation, IFloppyImage **aFloppyImage); 164 164 165 165 STDMETHOD(GetGuestOSType) (IN_BSTR aId, IGuestOSType **aType); … … 234 234 ComObjPtr <Machine> *machine = NULL); 235 235 236 HRESULT findHardDisk 2(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); 238 238 HRESULT findDVDImage(const Guid *aId, CBSTR aLocation, 239 239 bool aSetError, ComObjPtr<DVDImage> *aImage = NULL); 240 HRESULT findFloppyImage 2(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); 242 242 243 243 const ComObjPtr <Host> &host() { return mData.mHost; } … … 256 256 void calculateRelativePath (const char *aPath, Utf8Str &aResult); 257 257 258 HRESULT registerHardDisk 2 (HardDisk2*aHardDisk, bool aSaveRegistry = true);259 HRESULT unregisterHardDisk 2 (HardDisk2*aHardDisk, bool aSaveRegistry = true);258 HRESULT registerHardDisk(HardDisk *aHardDisk, bool aSaveRegistry = true); 259 HRESULT unregisterHardDisk(HardDisk *aHardDisk, bool aSaveRegistry = true); 260 260 261 261 HRESULT registerDVDImage(DVDImage *aImage, bool aSaveRegistry = true); 262 262 HRESULT unregisterDVDImage(DVDImage *aImage, bool aSaveRegistry = true); 263 263 264 HRESULT registerFloppyImage (FloppyImage 2*aImage, bool aSaveRegistry = true);265 HRESULT unregisterFloppyImage (FloppyImage 2*aImage, bool aSaveRegistry = true);266 267 HRESULT cast (IHardDisk 2 *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); 268 268 269 269 HRESULT saveSettings(); … … 337 337 /** 338 338 * Returns a lock handle used to protect changes to the hard disk hierarchy 339 * (e.g. serialize access to the HardDisk 2::mParent fields and methods339 * (e.g. serialize access to the HardDisk::mParent fields and methods 340 340 * adding/removing children). When using this lock, the following rules must 341 341 * be obeyed: … … 361 361 typedef std::map <Guid, ComPtr <IProgress> > ProgressMap; 362 362 363 typedef std::list <ComObjPtr <HardDisk 2> > HardDisk2List;363 typedef std::list <ComObjPtr <HardDisk> > HardDiskList; 364 364 typedef std::list <ComObjPtr <DVDImage> > DVDImageList; 365 typedef std::list <ComObjPtr <FloppyImage 2> > FloppyImage2List;365 typedef std::list <ComObjPtr <FloppyImage> > FloppyImageList; 366 366 typedef std::list <ComObjPtr <SharedFolder> > SharedFolderList; 367 367 368 typedef std::map <Guid, ComObjPtr <HardDisk2> > HardDisk2Map;368 typedef std::map <Guid, ComObjPtr<HardDisk> > HardDiskMap; 369 369 370 370 /** … … 428 428 ProgressMap mProgressOperations; 429 429 430 HardDisk 2List mHardDisks2;431 DVDImageList mDVDImages 2;432 FloppyImage 2List mFloppyImages2;430 HardDiskList mHardDisks; 431 DVDImageList mDVDImages; 432 FloppyImageList mFloppyImages; 433 433 SharedFolderList mSharedFolders; 434 434 435 435 /// @todo NEWMEDIA do we really need this map? Used only in 436 436 /// find() it seems 437 HardDisk 2Map mHardDisk2Map;437 HardDiskMap mHardDiskMap; 438 438 439 439 CallbackList mCallbacks; -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r16853 r16867 631 631 do 632 632 { 633 ComPtr <IHardDisk 2> hd;633 ComPtr <IHardDisk> hd; 634 634 static const wchar_t *Names[] = 635 635 { … … 651 651 Bstr src = Names [i]; 652 652 printf ("Searching for hard disk '%ls'...\n", src.raw()); 653 rc = virtualBox->FindHardDisk 2(src, hd.asOutParam());653 rc = virtualBox->FindHardDisk (src, hd.asOutParam()); 654 654 if (SUCCEEDED (rc)) 655 655 { … … 901 901 { 902 902 { 903 com::SafeIfaceArray <IHardDisk 2> disks;903 com::SafeIfaceArray <IHardDisk> disks; 904 904 CHECK_ERROR_BREAK (virtualBox, 905 COMGETTER(HardDisks 2)(ComSafeArrayAsOutParam (disks)));905 COMGETTER(HardDisks)(ComSafeArrayAsOutParam (disks))); 906 906 907 907 printf ("%u base hard disks registered (disks.isNull()=%d).\n", -
trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp
r16853 r16867 298 298 * Create a virtual harddisk 299 299 */ 300 nsCOMPtr<IHardDisk 2> hardDisk = 0;301 rc = virtualBox->CreateHardDisk 2(NS_LITERAL_STRING("VDI").get(),302 303 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)); 304 304 if (NS_FAILED(rc)) 305 305 { … … 344 344 nsID *vdiUUID = nsnull; 345 345 hardDisk->GetId(&vdiUUID); 346 rc = machine->AttachHardDisk 2(*vdiUUID,347 348 349 346 rc = machine->AttachHardDisk(*vdiUUID, 347 StorageBus::IDE, // controler identifier 348 0, // channel number on the controller 349 0); // device number on the controller 350 350 nsMemory::Free(vdiUUID); 351 351 if (NS_FAILED(rc)) -
trunk/src/VBox/Main/xpcom/server.cpp
r16853 r16867 95 95 #include <SnapshotImpl.h> 96 96 #include <MediumImpl.h> 97 #include <HardDisk 2Impl.h>97 #include <HardDiskImpl.h> 98 98 #include <HardDiskFormatImpl.h> 99 99 #include <ProgressImpl.h> … … 147 147 IMedium, ImageMediumBase, 148 148 IDVDImage, DVDImage) 149 NS_DECL_CLASSINFO(FloppyImage 2)150 NS_IMPL_THREADSAFE_ISUPPORTS2_AMBIGUOUS_CI(FloppyImage 2,149 NS_DECL_CLASSINFO(FloppyImage) 150 NS_IMPL_THREADSAFE_ISUPPORTS2_AMBIGUOUS_CI(FloppyImage, 151 151 IMedium, ImageMediumBase, 152 IFloppyImage 2, FloppyImage2)153 154 NS_DECL_CLASSINFO(HardDisk 2)155 NS_IMPL_THREADSAFE_ISUPPORTS2_AMBIGUOUS_CI(HardDisk 2,152 IFloppyImage, FloppyImage) 153 154 NS_DECL_CLASSINFO(HardDisk) 155 NS_IMPL_THREADSAFE_ISUPPORTS2_AMBIGUOUS_CI(HardDisk, 156 156 IMedium, MediumBase, 157 IHardDisk 2, HardDisk2)157 IHardDisk, HardDisk) 158 158 159 159 NS_DECL_CLASSINFO(HardDiskFormat) 160 160 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HardDiskFormat, IHardDiskFormat) 161 161 162 NS_DECL_CLASSINFO(HardDisk 2Attachment)163 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HardDisk 2Attachment, IHardDisk2Attachment)162 NS_DECL_CLASSINFO(HardDiskAttachment) 163 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HardDiskAttachment, IHardDiskAttachment) 164 164 165 165 NS_DECL_CLASSINFO(Progress)
Note:
See TracChangeset
for help on using the changeset viewer.