VirtualBox

Changeset 27792 in vbox


Ignore:
Timestamp:
Mar 29, 2010 1:08:44 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59446
Message:

Main/VirtualBox: new parameter for overriding VM file existence check on creation (2nd try)

Location:
trunk/src/VBox
Files:
10 edited

Legend:

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

    r27730 r27792  
    247247        if (settingsFile.isEmpty())
    248248            CHECK_ERROR_BREAK(a->virtualBox,
    249                 CreateMachine(name, osTypeId, baseFolder, Guid(id).toUtf16(), machine.asOutParam()));
     249                CreateMachine(name, osTypeId, baseFolder, Guid(id).toUtf16(), FALSE, machine.asOutParam()));
    250250        else
    251251            CHECK_ERROR_BREAK(a->virtualBox,
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp

    r27730 r27792  
    636636    if (m_Machine.isNull())
    637637    {
    638         m_Machine = vbox.CreateMachine(field("name").toString(), typeId, QString::null, QString::null);
     638        m_Machine = vbox.CreateMachine(field("name").toString(), typeId, QString::null, QString::null, false);
    639639        if (!vbox.isOk())
    640640        {
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r27779 r27792  
    66
    77/*
    8  * Copyright (C) 2008-2009 Sun Microsystems, Inc.
     8 * Copyright (C) 2008-2010 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    12781278            const Utf8Str &strNameVBox = vsdeName.front()->strVbox;
    12791279            rc = mVirtualBox->CreateMachine(Bstr(strNameVBox), Bstr(strOsTypeVBox),
    1280                                                  Bstr(), Bstr(),
     1280                                                 Bstr(), Bstr(), FALSE,
    12811281                                                 pNewMachine.asOutParam());
    12821282            if (FAILED(rc)) throw rc;
  • trunk/src/VBox/Main/MachineImpl.cpp

    r27761 r27792  
    267267 *                      (ignored otherwise)
    268268 *  @param aOsType      OS Type of this machine
     269 *  @param aOverride    |TRUE| to override VM config file existence checks.
     270 *                      |FALSE| refuses to overwrite existing VM configs.
    269271 *  @param aNameSync    |TRUE| to automatically sync settings dir and file
    270272 *                      name with the machine name. |FALSE| is used for legacy
     
    285287                      CBSTR aName /* = NULL */,
    286288                      GuestOSType *aOsType /* = NULL */,
     289                      BOOL aOverride /* = FALSE */,
    287290                      BOOL aNameSync /* = TRUE */,
    288291                      const Guid *aId /* = NULL */)
     
    352355               )
    353356            {
    354                 rc = setError(VBOX_E_FILE_ERROR,
    355                               tr("Machine settings file '%s' already exists"),
    356                               mData->m_strConfigFileFull.raw());
     357                if (!aOverride)
     358                {
     359                    rc = setError(VBOX_E_FILE_ERROR,
     360                                  tr("Machine settings file '%s' already exists"),
     361                                  mData->m_strConfigFileFull.raw());
     362                }
    357363                if (RT_SUCCESS(vrc))
    358364                    RTFileClose(f);
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r27730 r27792  
    66
    77/*
    8  * Copyright (C) 2006-2009 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    516516                                NULL,
    517517                                NULL,
     518                                FALSE, /* aOverride */
    518519                                FALSE, /* aNameSync */
    519520                                &uuid);
     
    10311032                                       IN_BSTR aBaseFolder,
    10321033                                       IN_BSTR aId,
     1034                                       BOOL aOverride,
    10331035                                       IMachine **aMachine)
    10341036{
     
    10841086                       aName,
    10851087                       osType,
     1088                       aOverride,
    10861089                       TRUE /* aNameSync */,
    10871090                       &id);
     
    11391142                       aName,
    11401143                       osType,
     1144                       FALSE /* aOverride */,
    11411145                       FALSE /* aNameSync */,
    11421146                       &id);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r27767 r27792  
    16901690  <interface
    16911691    name="IVirtualBox" extends="$dispatched"
    1692     uuid="2158464a-f706-414b-a8c4-fb589dfc6b62"
     1692    uuid="3f36e024-7fed-4f20-a02c-9158a82b44e6"
    16931693    wsmap="managed"
    16941694  >
     
    19191919      <param name="id" type="uuid" mod="string" dir="in">
    19201920        <desc>Machine UUID (optional).</desc>
     1921      </param>
     1922      <param name="override" type="boolean" dir="in">
     1923        <desc>Create the VM even if there are conflicting files.</desc>
    19211924      </param>
    19221925      <param name="machine" type="IMachine" dir="return">
  • trunk/src/VBox/Main/include/MachineImpl.h

    r27761 r27792  
    355355                 CBSTR aName = NULL,
    356356                 GuestOSType *aOsType = NULL,
     357                 BOOL aOverride = FALSE,
    357358                 BOOL aNameSync = TRUE,
    358359                 const Guid *aId = NULL);
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r27730 r27792  
    77
    88/*
    9  * Copyright (C) 2006-2009 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    125125
    126126    STDMETHOD(CreateMachine) (IN_BSTR aName, IN_BSTR aOsTypeId, IN_BSTR aBaseFolder,
    127                               IN_BSTR aId, IMachine **aMachine);
     127                              IN_BSTR aId, BOOL aOverride, IMachine **aMachine);
    128128    STDMETHOD(CreateLegacyMachine) (IN_BSTR aName, IN_BSTR aOsTypeId, IN_BSTR aSettingsFile,
    129129                                    IN_BSTR aId, IMachine **aMachine);
  • trunk/src/VBox/Main/testcase/tstAPI.cpp

    r27730 r27792  
    55
    66/*
    7  * Copyright (C) 2006-2009 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    742742        RTPrintf ("Creating a new machine object (base dir '%ls', name '%ls')...\n",
    743743                baseDir.raw(), name.raw());
    744         CHECK_ERROR_BREAK (virtualBox, CreateMachine (baseDir, name,
     744        CHECK_ERROR_BREAK (virtualBox, CreateMachine (name, L"", baseDir, L"",
     745                                                      false,
    745746                                                      machine.asOutParam()));
    746747
  • trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp

    r27730 r27792  
    88
    99/*
    10  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     10 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    1111 *
    1212 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    195195    nsCOMPtr <IMachine> machine;
    196196    rc = virtualBox->CreateMachine(NS_LITERAL_STRING("A brand new name").get(),
    197                                    nsnull, nsnull, nsnull, getter_AddRefs(machine));
     197                                   nsnull, nsnull, nsnull, false, getter_AddRefs(machine));
    198198    if (NS_FAILED(rc))
    199199    {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette