Changeset 33238 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 19, 2010 3:41:23 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66787
- Location:
- trunk/src/VBox/Main
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r33080 r33238 633 633 634 634 /** 635 * Little shortcut to SystemProperties::DefaultHardDiskFolder.636 * @param str637 * @return638 */639 HRESULT Appliance::getDefaultHardDiskFolder(Utf8Str &str) const640 {641 /* We need the default path for storing disk images */642 ComPtr<ISystemProperties> systemProps;643 HRESULT rc = mVirtualBox->COMGETTER(SystemProperties)(systemProps.asOutParam());644 if (FAILED(rc)) return rc;645 Bstr bstrDefaultHardDiskFolder;646 rc = systemProps->COMGETTER(DefaultHardDiskFolder)(bstrDefaultHardDiskFolder.asOutParam());647 if (FAILED(rc)) return rc;648 str = bstrDefaultHardDiskFolder;649 650 return S_OK;651 }652 653 /**654 635 * Called from the import and export background threads to synchronize the second 655 636 * background disk thread's progress object with the current progress object so -
trunk/src/VBox/Main/ApplianceImplImport.cpp
r33102 r33238 126 126 /* Clear any previous virtual system descriptions */ 127 127 m->virtualSystemDescriptions.clear(); 128 129 Utf8Str strDefaultHardDiskFolder;130 rc = getDefaultHardDiskFolder(strDefaultHardDiskFolder);131 if (FAILED(rc)) return rc;132 128 133 129 if (!m->pReader) … … 256 252 /* RAM */ 257 253 uint64_t ullMemSizeVBox = vsysThis.ullMemorySize / _1M; 258 /* Check for the constrain s */254 /* Check for the constraints */ 259 255 if ( ullMemSizeVBox != 0 260 256 && ( ullMemSizeVBox < MM_RAM_MIN_IN_MB … … 499 495 if (!strFilename.length()) 500 496 strFilename = Utf8StrFmt("%s.vmdk", nameVBox.c_str()); 501 /* Construct a unique target path */502 Utf8StrFmt strPath("%s%c%s",503 strDefaultHardDiskFolder.c_str(),504 RTPATH_DELIMITER,505 strFilename.c_str());506 searchUniqueDiskImageFilePath(strPath);507 497 508 498 /* find the description for the hard disk controller … … 522 512 hd.strDiskId, 523 513 di.strHref, 524 str Path,514 strFilename, 525 515 di.ulSuggestedSizeMB, 526 516 strExtraConfig); … … 1263 1253 tr("Missing VM name")); 1264 1254 stack.strNameVBox = vsdeName.front()->strVboxCurrent; 1255 1256 // have VirtualBox suggest where the filename would be placed so we can 1257 // put the disk images in the same directory 1258 Bstr bstrMachineFilename; 1259 rc = mVirtualBox->ComposeMachineFilename(Bstr(stack.strNameVBox).raw(), 1260 NULL, 1261 bstrMachineFilename.asOutParam()); 1262 if (FAILED(rc)) throw rc; 1263 // and determine the machine folder from that 1264 stack.strMachineFolder = bstrMachineFilename; 1265 stack.strMachineFolder.stripFilename(); 1265 1266 1266 1267 // guest OS type … … 2200 2201 Assert(vsdescThis->m->pConfig); 2201 2202 2203 HRESULT rc = S_OK; 2204 2202 2205 settings::MachineConfigFile &config = *vsdescThis->m->pConfig; 2203 2204 Utf8Str strDefaultHardDiskFolder;2205 HRESULT rc = getDefaultHardDiskFolder(strDefaultHardDiskFolder);2206 if (FAILED(rc)) throw rc;2207 2206 2208 2207 /* … … 2295 2294 if (di.uuidVbox == strUuid) 2296 2295 { 2297 Utf8Str strTargetPath(st rDefaultHardDiskFolder);2296 Utf8Str strTargetPath(stack.strMachineFolder); 2298 2297 strTargetPath.append(RTPATH_DELIMITER); 2299 2298 strTargetPath.append(di.strHref); -
trunk/src/VBox/Main/SystemPropertiesImpl.cpp
r32531 r33238 85 85 86 86 setDefaultMachineFolder(Utf8Str::Empty); 87 setDefaultHardDiskFolder(Utf8Str::Empty);88 87 setDefaultHardDiskFormat(Utf8Str::Empty); 89 88 … … 565 564 } 566 565 567 STDMETHODIMP SystemProperties::COMGETTER( DefaultHardDiskFolder)(BSTR *aDefaultHardDiskFolder)568 { 569 CheckComArgOut PointerValid(aDefaultHardDiskFolder);566 STDMETHODIMP SystemProperties::COMGETTER(MediumFormats)(ComSafeArrayOut(IMediumFormat *, aMediumFormats)) 567 { 568 CheckComArgOutSafeArrayPointerValid(aMediumFormats); 570 569 571 570 AutoCaller autoCaller(this); … … 574 573 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 575 574 576 m_strDefaultHardDiskFolderFull.cloneTo(aDefaultHardDiskFolder); 577 578 return S_OK; 579 } 580 581 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFolder)(IN_BSTR aDefaultHardDiskFolder) 575 SafeIfaceArray<IMediumFormat> mediumFormats(m_llMediumFormats); 576 mediumFormats.detachTo(ComSafeArrayOutArg(aMediumFormats)); 577 578 return S_OK; 579 } 580 581 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat)(BSTR *aDefaultHardDiskFormat) 582 { 583 CheckComArgOutPointerValid(aDefaultHardDiskFormat); 584 585 AutoCaller autoCaller(this); 586 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 587 588 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 589 590 m->strDefaultHardDiskFormat.cloneTo(aDefaultHardDiskFormat); 591 592 return S_OK; 593 } 594 595 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat)(IN_BSTR aDefaultHardDiskFormat) 582 596 { 583 597 AutoCaller autoCaller(this); … … 585 599 586 600 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 587 HRESULT rc = setDefaultHardDiskFo lder(aDefaultHardDiskFolder);601 HRESULT rc = setDefaultHardDiskFormat(aDefaultHardDiskFormat); 588 602 alock.release(); 589 603 … … 598 612 } 599 613 600 STDMETHODIMP SystemProperties::COMGETTER(MediumFormats)(ComSafeArrayOut(IMediumFormat *, aMediumFormats)) 601 { 602 CheckComArgOutSafeArrayPointerValid(aMediumFormats); 614 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceWarning)(LONG64 *aFreeSpace) 615 { 616 CheckComArgOutPointerValid(aFreeSpace); 617 618 ReturnComNotImplemented(); 619 } 620 621 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceWarning)(LONG64 /* aFreeSpace */) 622 { 623 ReturnComNotImplemented(); 624 } 625 626 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentWarning)(ULONG *aFreeSpacePercent) 627 { 628 CheckComArgOutPointerValid(aFreeSpacePercent); 629 630 ReturnComNotImplemented(); 631 } 632 633 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentWarning)(ULONG /* aFreeSpacePercent */) 634 { 635 ReturnComNotImplemented(); 636 } 637 638 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceError)(LONG64 *aFreeSpace) 639 { 640 CheckComArgOutPointerValid(aFreeSpace); 641 642 ReturnComNotImplemented(); 643 } 644 645 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceError)(LONG64 /* aFreeSpace */) 646 { 647 ReturnComNotImplemented(); 648 } 649 650 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentError)(ULONG *aFreeSpacePercent) 651 { 652 CheckComArgOutPointerValid(aFreeSpacePercent); 653 654 ReturnComNotImplemented(); 655 } 656 657 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentError)(ULONG /* aFreeSpacePercent */) 658 { 659 ReturnComNotImplemented(); 660 } 661 662 STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary)(BSTR *aRemoteDisplayAuthLibrary) 663 { 664 CheckComArgOutPointerValid(aRemoteDisplayAuthLibrary); 603 665 604 666 AutoCaller autoCaller(this); … … 607 669 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 608 670 609 SafeIfaceArray<IMediumFormat> mediumFormats(m_llMediumFormats); 610 mediumFormats.detachTo(ComSafeArrayOutArg(aMediumFormats)); 611 612 return S_OK; 613 } 614 615 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat)(BSTR *aDefaultHardDiskFormat) 616 { 617 CheckComArgOutPointerValid(aDefaultHardDiskFormat); 618 619 AutoCaller autoCaller(this); 620 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 621 622 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 623 624 m->strDefaultHardDiskFormat.cloneTo(aDefaultHardDiskFormat); 625 626 return S_OK; 627 } 628 629 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat)(IN_BSTR aDefaultHardDiskFormat) 671 m->strRemoteDisplayAuthLibrary.cloneTo(aRemoteDisplayAuthLibrary); 672 673 return S_OK; 674 } 675 676 STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary)(IN_BSTR aRemoteDisplayAuthLibrary) 630 677 { 631 678 AutoCaller autoCaller(this); … … 633 680 634 681 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 635 HRESULT rc = set DefaultHardDiskFormat(aDefaultHardDiskFormat);682 HRESULT rc = setRemoteDisplayAuthLibrary(aRemoteDisplayAuthLibrary); 636 683 alock.release(); 637 684 … … 646 693 } 647 694 648 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceWarning)(LONG64 *aFreeSpace) 649 { 650 CheckComArgOutPointerValid(aFreeSpace); 651 652 ReturnComNotImplemented(); 653 } 654 655 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceWarning)(LONG64 /* aFreeSpace */) 656 { 657 ReturnComNotImplemented(); 658 } 659 660 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentWarning)(ULONG *aFreeSpacePercent) 661 { 662 CheckComArgOutPointerValid(aFreeSpacePercent); 663 664 ReturnComNotImplemented(); 665 } 666 667 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentWarning)(ULONG /* aFreeSpacePercent */) 668 { 669 ReturnComNotImplemented(); 670 } 671 672 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceError)(LONG64 *aFreeSpace) 673 { 674 CheckComArgOutPointerValid(aFreeSpace); 675 676 ReturnComNotImplemented(); 677 } 678 679 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceError)(LONG64 /* aFreeSpace */) 680 { 681 ReturnComNotImplemented(); 682 } 683 684 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentError)(ULONG *aFreeSpacePercent) 685 { 686 CheckComArgOutPointerValid(aFreeSpacePercent); 687 688 ReturnComNotImplemented(); 689 } 690 691 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentError)(ULONG /* aFreeSpacePercent */) 692 { 693 ReturnComNotImplemented(); 694 } 695 696 STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary)(BSTR *aRemoteDisplayAuthLibrary) 697 { 698 CheckComArgOutPointerValid(aRemoteDisplayAuthLibrary); 695 STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary)(BSTR *aWebServiceAuthLibrary) 696 { 697 CheckComArgOutPointerValid(aWebServiceAuthLibrary); 699 698 700 699 AutoCaller autoCaller(this); … … 703 702 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 704 703 705 m->str RemoteDisplayAuthLibrary.cloneTo(aRemoteDisplayAuthLibrary);706 707 return S_OK; 708 } 709 710 STDMETHODIMP SystemProperties::COMSETTER( RemoteDisplayAuthLibrary)(IN_BSTR aRemoteDisplayAuthLibrary)704 m->strWebServiceAuthLibrary.cloneTo(aWebServiceAuthLibrary); 705 706 return S_OK; 707 } 708 709 STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary)(IN_BSTR aWebServiceAuthLibrary) 711 710 { 712 711 AutoCaller autoCaller(this); … … 714 713 715 714 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 716 HRESULT rc = set RemoteDisplayAuthLibrary(aRemoteDisplayAuthLibrary);715 HRESULT rc = setWebServiceAuthLibrary(aWebServiceAuthLibrary); 717 716 alock.release(); 718 717 … … 727 726 } 728 727 729 STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary)(BSTR *aWebServiceAuthLibrary)730 {731 CheckComArgOutPointerValid(aWebServiceAuthLibrary);732 733 AutoCaller autoCaller(this);734 if (FAILED(autoCaller.rc())) return autoCaller.rc();735 736 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);737 738 m->strWebServiceAuthLibrary.cloneTo(aWebServiceAuthLibrary);739 740 return S_OK;741 }742 743 STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary)(IN_BSTR aWebServiceAuthLibrary)744 {745 AutoCaller autoCaller(this);746 if (FAILED(autoCaller.rc())) return autoCaller.rc();747 748 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);749 HRESULT rc = setWebServiceAuthLibrary(aWebServiceAuthLibrary);750 alock.release();751 752 if (SUCCEEDED(rc))753 {754 // VirtualBox::saveSettings() needs vbox write lock755 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS);756 rc = mParent->saveSettings();757 }758 759 return rc;760 }761 762 728 STDMETHODIMP SystemProperties::COMGETTER(LogHistoryCount)(ULONG *count) 763 729 { … … 817 783 818 784 rc = setDefaultMachineFolder(data.strDefaultMachineFolder); 819 if (FAILED(rc)) return rc;820 821 rc = setDefaultHardDiskFolder(data.strDefaultHardDiskFolder);822 785 if (FAILED(rc)) return rc; 823 786 … … 905 868 } 906 869 907 HRESULT SystemProperties::setDefaultHardDiskFolder(const Utf8Str &aPath)908 {909 Utf8Str path(aPath);910 if (path.isEmpty())911 path = "HardDisks";912 913 /* get the full file name */914 Utf8Str folder;915 int vrc = mParent->calculateFullPath(path, folder);916 if (RT_FAILURE(vrc))917 return setError(E_FAIL,918 tr("Invalid default hard disk folder '%s' (%Rrc)"),919 path.c_str(),920 vrc);921 922 m->strDefaultHardDiskFolder = path;923 m_strDefaultHardDiskFolderFull = folder;924 925 return S_OK;926 }927 928 870 HRESULT SystemProperties::setDefaultHardDiskFormat(const Utf8Str &aFormat) 929 871 { -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r33232 r33238 1149 1149 ///////////////////////////////////////////////////////////////////////////// 1150 1150 1151 STDMETHODIMP VirtualBox::ComposeMachineFilename(IN_BSTR aName, 1152 IN_BSTR aBaseFolder, 1153 BSTR *aFilename) 1154 { 1155 LogFlowThisFuncEnter(); 1156 LogFlowThisFunc(("aName=\"%ls\",aBaseFolder=\"%ls\"\n", aName, aBaseFolder)); 1157 1158 CheckComArgStrNotEmptyOrNull(aName); 1159 CheckComArgOutPointerValid(aFilename); 1160 1161 AutoCaller autoCaller(this); 1162 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1163 1164 /* Compose the settings file name using the following scheme: 1165 * 1166 * <base_folder>/<machine_name>/<machine_name>.xml 1167 * 1168 * If a non-null and non-empty base folder is specified, the default 1169 * machine folder will be used as a base folder. 1170 */ 1171 Utf8Str strBase = aBaseFolder; 1172 if (strBase.isEmpty()) 1173 /* we use the non-full folder value below to keep the path relative */ 1174 getDefaultMachineFolder(strBase); 1175 1176 Bstr bstrSettingsFile = BstrFmt("%s%c%ls%c%ls.vbox", 1177 strBase.c_str(), 1178 RTPATH_DELIMITER, 1179 aName, 1180 RTPATH_DELIMITER, 1181 aName); 1182 1183 bstrSettingsFile.detachTo(aFilename); 1184 1185 return S_OK; 1186 } 1187 1151 1188 /** @note Locks mSystemProperties object for reading. */ 1152 1189 STDMETHODIMP VirtualBox::CreateMachine(IN_BSTR aName, … … 1167 1204 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1168 1205 1169 /* Compose the settings file name using the following scheme: 1170 * 1171 * <base_folder>/<machine_name>/<machine_name>.xml 1172 * 1173 * If a non-null and non-empty base folder is specified, the default 1174 * machine folder will be used as a base folder. 1175 */ 1176 Utf8Str strSettingsFile = aBaseFolder; 1177 if (strSettingsFile.isEmpty()) 1178 /* we use the non-full folder value below to keep the path relative */ 1179 getDefaultMachineFolder(strSettingsFile); 1180 1181 strSettingsFile = Utf8StrFmt("%s%c%ls%c%ls.vbox", 1182 strSettingsFile.c_str(), 1183 RTPATH_DELIMITER, 1184 aName, 1185 RTPATH_DELIMITER, 1186 aName); 1187 1188 HRESULT rc = E_FAIL; 1206 Bstr bstrSettingsFilename; 1207 HRESULT rc = ComposeMachineFilename(aName, aBaseFolder, bstrSettingsFilename.asOutParam()); 1208 if (FAILED(rc)) return rc; 1189 1209 1190 1210 /* create a new object */ … … 1204 1224 /* initialize the machine object */ 1205 1225 rc = machine->init(this, 1206 strSettingsFile,1226 Utf8Str(bstrSettingsFilename), 1207 1227 Utf8Str(aName), 1208 1228 id, … … 2846 2866 AutoReadLock propsLock(m->pSystemProperties COMMA_LOCKVAL_SRC_POS); 2847 2867 str = m->pSystemProperties->m->strDefaultMachineFolder; 2848 }2849 2850 /**2851 * Returns the default hard disk folder from the system properties2852 * with proper locking.2853 * @return2854 */2855 void VirtualBox::getDefaultHardDiskFolder(Utf8Str &str) const2856 {2857 AutoReadLock propsLock(m->pSystemProperties COMMA_LOCKVAL_SRC_POS);2858 str = m->pSystemProperties->m->strDefaultHardDiskFolder;2859 2868 } 2860 2869 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r33201 r33238 1374 1374 <interface 1375 1375 name="IVirtualBox" extends="$unknown" 1376 uuid=" ec6cc7e7-06a2-4c5d-8993-1e3619c53817"1376 uuid="1489e5b2-40ed-4037-b8c9-d316bbf5e07c" 1377 1377 wsmap="managed" 1378 1378 > … … 1514 1514 </attribute> 1515 1515 1516 1517 <method name="createMachine"> 1518 <desc> 1519 Creates a new virtual machine. 1520 1521 The new machine is created unregistered, with the initial configuration 1522 set according to the specified guest OS type. A typical sequence of 1523 actions to create a new virtual machine is as follows: 1524 1525 <ol> 1526 <li> 1527 Call this method to have a new machine created. The returned machine 1528 object will be "mutable" allowing to change any machine property. 1529 </li> 1530 1531 <li> 1532 Configure the machine using the appropriate attributes and methods. 1533 </li> 1534 1535 <li> 1536 Call <link to="IMachine::saveSettings" /> to write the settings 1537 to the machine's XML settings file. The configuration of the newly 1538 created machine will not be saved to disk until this method is 1539 called. 1540 </li> 1541 1542 <li> 1543 Call <link to="#registerMachine" /> to add the machine to the list 1544 of machines known to VirtualBox. 1545 </li> 1546 </ol> 1547 1548 You should specify valid name for the newly created machine when calling 1549 this method. See the <link to="IMachine::name"/> attribute description 1550 for more details about the machine name. 1551 1552 The specified guest OS type identifier must match an ID of one of known 1553 guest OS types listed in the <link to="IVirtualBox::guestOSTypes"/> 1554 array. 1516 <method name="composeMachineFilename"> 1517 <desc> 1518 Returns the full path of the settings file name that <link to="#createMachine" /> 1519 would use. This method gets called by createMachine(), but calling this method 1520 independently might be helpful if one needs to create the machine directory 1521 to place files (such as disk images) there before actually creating the machine. 1522 1523 See the <link to="IMachine::name"/> attribute description for more details about 1524 the machine name. 1555 1525 1556 1526 Every machine has a <i>settings file</i> that is used to store … … 1573 1543 </pre> 1574 1544 1575 Note that if the resulting settings file already exists, this method 1576 will fail with <link to="VBOX_E_FILE_ERROR"/>. 1545 1546 This method does not access the host disks. In particular, it does not check for 1547 whether a machine of this name already exists. 1548 </desc> 1549 <param name="name" type="wstring" dir="in"> 1550 <desc>Suggested machine name.</desc> 1551 </param> 1552 <param name="baseFolder" type="wstring" dir="in"> 1553 <desc>Base machine folder (optional).</desc> 1554 </param> 1555 <param name="file" type="wstring" dir="return"> 1556 <desc>Fully qualified path where the machine would be created.</desc> 1557 </param> 1558 </method> 1559 1560 <method name="createMachine"> 1561 <desc> 1562 Creates a new virtual machine. 1563 1564 The new machine is created unregistered, with the initial configuration 1565 set according to the specified guest OS type. A typical sequence of 1566 actions to create a new virtual machine is as follows: 1567 1568 <ol> 1569 <li> 1570 Call this method to have a new machine created. The returned machine 1571 object will be "mutable" allowing to change any machine property. 1572 </li> 1573 1574 <li> 1575 Configure the machine using the appropriate attributes and methods. 1576 </li> 1577 1578 <li> 1579 Call <link to="IMachine::saveSettings" /> to write the settings 1580 to the machine's XML settings file. The configuration of the newly 1581 created machine will not be saved to disk until this method is 1582 called. 1583 </li> 1584 1585 <li> 1586 Call <link to="#registerMachine" /> to add the machine to the list 1587 of machines known to VirtualBox. 1588 </li> 1589 </ol> 1590 1591 The specified guest OS type identifier must match an ID of one of known 1592 guest OS types listed in the <link to="IVirtualBox::guestOSTypes"/> 1593 array. 1594 1595 This method uses the <link to="#composeMachineFilename" /> method to determine 1596 where to create the machine's directory and settings file. Please refer 1597 to the additional remarks and restrictions there. 1598 1599 If the resulting settings file already exists, this method will fail 1600 with <link to="VBOX_E_FILE_ERROR"/>. 1577 1601 1578 1602 Optionally, you may specify an UUID of to assign to the created machine. … … 1746 1770 1747 1771 Note that the format of the location string is storage format specific. 1748 See <link to="IMedium::location"/>, IMedium and 1749 <link to="ISystemProperties::defaultHardDiskFolder"/> for more details. 1772 See <link to="IMedium::location"/> and IMedium for more details. 1750 1773 1751 1774 <result name="VBOX_E_OBJECT_NOT_FOUND"> … … 1825 1848 1826 1849 The format of the location string is storage format specific. See 1827 <link to="IMedium::location"/>, IMedium and 1828 <link to="ISystemProperties::defaultHardDiskFolder"/> for more details. 1850 <link to="IMedium::location"/> and IMedium for more details. 1829 1851 1830 1852 Prior to VirtualBox 3.3, opening a medium added it to a global media … … 1876 1898 <method name="findMedium"> 1877 1899 <desc> 1878 Returns a medium of the given type that uses the given location or1879 UUID to store medium data.1900 Returns a medium of the given type that uses the given fully qualified 1901 location or UUID to store medium data. 1880 1902 1881 1903 The given medium must be known to this VirtualBox installation, i.e. … … 1887 1909 attributes of each known medium. 1888 1910 1889 For locations represented by file names in the host's file system, the 1890 requested location can be a path relative to the 1891 <link to="IVirtualBox::homeFolder">VirtualBox home folder</link>. If 1892 only a file name without any path is given, the 1893 <link to="ISystemProperties::defaultHardDiskFolder"> default medium 1894 folder</link> will be prepended to the file name before searching. Note 1895 that on case sensitive file systems, a case sensitive comparison is 1896 performed, otherwise the case of symbols in the file path is ignored. 1911 On case sensitive file systems, a case sensitive comparison is performed, 1912 otherwise the case of symbols in the file path is ignored. 1897 1913 1898 1914 <result name="VBOX_E_OBJECT_NOT_FOUND"> … … 7203 7219 name="ISystemProperties" 7204 7220 extends="$unknown" 7205 uuid=" 5e54e767-293c-441b-a5e4-03a1fdbc0dcb"7221 uuid="f8fff1f1-eeb4-4483-a2a4-b4186fab5a1e" 7206 7222 wsmap="managed" 7207 7223 > … … 7312 7328 </attribute> 7313 7329 7314 <attribute name="defaultHardDiskFolder" type="wstring">7315 <desc>7316 Full path to the default directory used to create new or open existing7317 virtual disks.7318 7319 This path is used when the storage unit of a hard disk is a regular file7320 in the host's file system and only a file name that contains no path is7321 given.7322 7323 The initial value of this property is7324 <tt><</tt>7325 <link to="IVirtualBox::homeFolder">VirtualBox_home</link>7326 <tt>>/HardDisks</tt>.7327 7328 <note>7329 Setting this property to @c null or empty string will restore the7330 initial value.7331 </note>7332 <note>7333 When settings this property, the specified path can be relative7334 to the7335 <link to="IVirtualBox::homeFolder">VirtualBox home directory</link> or7336 absolute. When reading this property, a full path is7337 always returned.7338 </note>7339 <note>7340 The specified path may not exist, it will be created7341 when necessary.7342 </note>7343 7344 <see>7345 IMedium,7346 <link to="IVirtualBox::createHardDisk"/>,7347 <link to="IVirtualBox::openMedium"/>,7348 <link to="IMedium::location"/>7349 </see>7350 </desc>7351 </attribute>7352 7353 7330 <attribute name="mediumFormats" type="IMediumFormat" safearray="yes" readonly="yes"> 7354 7331 <desc> … … 8817 8794 If the storage unit of the hard disk is a regular file in the host's 8818 8795 file system then the rules stated in the description of the 8819 <link to="IMedium::location"/> attribute apply when setting its value. In 8820 addition, a plain file name without any path may be given, in which case 8821 the <link to="ISystemProperties::defaultHardDiskFolder"> default hard disk 8822 folder</link> will be prepended to it. 8796 <link to="IMedium::location"/> attribute apply when setting its value. 8823 8797 8824 8798 <h4>Automatic composition of the file name part</h4> -
trunk/src/VBox/Main/include/ApplianceImpl.h
r33060 r33238 121 121 HRESULT searchUniqueVMName(Utf8Str& aName) const; 122 122 HRESULT searchUniqueDiskImageFilePath(Utf8Str& aName) const; 123 HRESULT getDefaultHardDiskFolder(Utf8Str &str) const;124 123 void waitForAsyncProgress(ComObjPtr<Progress> &pProgressThis, ComPtr<IProgress> &pProgressAsync); 125 124 void addWarning(const char* aWarning, ...); -
trunk/src/VBox/Main/include/ApplianceImplPrivate.h
r33060 r33238 147 147 // input parameters from VirtualSystemDescriptions 148 148 Utf8Str strNameVBox; // VM name 149 Utf8Str strMachineFolder; // FQ host folder where the VirtualBox machine would be created 149 150 Utf8Str strOsTypeVBox; // VirtualBox guest OS type as string 150 151 Utf8Str strDescription; -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r32531 r33238 75 75 STDMETHOD(COMGETTER(DefaultMachineFolder))(BSTR *aDefaultMachineFolder); 76 76 STDMETHOD(COMSETTER(DefaultMachineFolder))(IN_BSTR aDefaultMachineFolder); 77 STDMETHOD(COMGETTER(DefaultHardDiskFolder))(BSTR *aDefaultHardDiskFolder);78 STDMETHOD(COMSETTER(DefaultHardDiskFolder))(IN_BSTR aDefaultHardDiskFolder);79 77 STDMETHOD(COMGETTER(MediumFormats))(ComSafeArrayOut(IMediumFormat *, aMediumFormats)); 80 78 STDMETHOD(COMGETTER(DefaultHardDiskFormat))(BSTR *aDefaultHardDiskFormat); … … 118 116 119 117 HRESULT setDefaultMachineFolder(const Utf8Str &aPath); 120 HRESULT setDefaultHardDiskFolder(const Utf8Str &aPath);121 118 HRESULT setDefaultHardDiskFormat(const Utf8Str &aFormat); 122 119 … … 129 126 130 127 Utf8Str m_strDefaultMachineFolderFull; 131 Utf8Str m_strDefaultHardDiskFolderFull;132 128 133 129 MediumFormatList m_llMediumFormats; -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r33232 r33238 122 122 123 123 /* IVirtualBox methods */ 124 STDMETHOD(ComposeMachineFilename) (IN_BSTR aName, IN_BSTR aBaseFolder, BSTR *aFilename); 124 125 STDMETHOD(CreateMachine) (IN_BSTR aName, IN_BSTR aOsTypeId, IN_BSTR aBaseFolder, 125 126 IN_BSTR aId, BOOL aOverride, IMachine **aMachine); … … 241 242 242 243 void getDefaultMachineFolder(Utf8Str &str) const; 243 void getDefaultHardDiskFolder(Utf8Str &str) const;244 244 void getDefaultHardDiskFormat(Utf8Str &str) const; 245 245 -
trunk/src/VBox/Main/xml/Settings.cpp
r33201 r33238 1228 1228 { 1229 1229 pelmGlobalChild->getAttributeValue("defaultMachineFolder", systemProperties.strDefaultMachineFolder); 1230 if (!pelmGlobalChild->getAttributeValue("defaultHardDiskFolder", systemProperties.strDefaultHardDiskFolder))1231 // pre-1.4 used @defaultVDIFolder instead1232 pelmGlobalChild->getAttributeValue("defaultVDIFolder", systemProperties.strDefaultHardDiskFolder);1233 1230 pelmGlobalChild->getAttributeValue("defaultHardDiskFormat", systemProperties.strDefaultHardDiskFormat); 1234 1231 pelmGlobalChild->getAttributeValue("remoteDisplayAuthLibrary", systemProperties.strRemoteDisplayAuthLibrary); … … 1336 1333 if (systemProperties.strDefaultMachineFolder.length()) 1337 1334 pelmSysProps->setAttribute("defaultMachineFolder", systemProperties.strDefaultMachineFolder); 1338 if (systemProperties.strDefaultHardDiskFolder.length())1339 pelmSysProps->setAttribute("defaultHardDiskFolder", systemProperties.strDefaultHardDiskFolder);1340 1335 if (systemProperties.strDefaultHardDiskFormat.length()) 1341 1336 pelmSysProps->setAttribute("defaultHardDiskFormat", systemProperties.strDefaultHardDiskFormat);
Note:
See TracChangeset
for help on using the changeset viewer.