- Timestamp:
- Oct 15, 2007 12:04:26 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r5280 r5292 302 302 " [-register]\n" 303 303 " [-basefolder <path> | -settingsfile <path>]\n" 304 " [-uuid <uuid>]\n" 304 305 " \n" 305 306 "\n"); … … 3434 3435 Bstr settingsFile; 3435 3436 Bstr name; 3437 RTUUID id; 3436 3438 bool fRegister = false; 3437 3439 … … 3465 3467 name = argv[i]; 3466 3468 } 3469 else if (strcmp(argv[i], "-uuid") == 0) 3470 { 3471 if (argc <= i + 1) 3472 { 3473 return errorArgument("Missing argument to '%s'", argv[i]); 3474 } 3475 i++; 3476 if (VBOX_FAILURE(RTUuidFromStr(&id, argv[i]))) 3477 { 3478 return errorArgument("Invalid UUID format %s\n", argv[i]); 3479 } 3480 } 3467 3481 else if (strcmp(argv[i], "-register") == 0) 3468 3482 { … … 3489 3503 if (!settingsFile) 3490 3504 CHECK_ERROR_BREAK(virtualBox, 3491 CreateMachine(baseFolder, name, machine.asOutParam()));3505 CreateMachine(baseFolder, name, Guid(id), machine.asOutParam())); 3492 3506 else 3493 3507 CHECK_ERROR_BREAK(virtualBox, 3494 CreateLegacyMachine(settingsFile, name, machine.asOutParam()));3508 CreateLegacyMachine(settingsFile, name, Guid(id), machine.asOutParam())); 3495 3509 3496 3510 CHECK_ERROR_BREAK(machine, SaveSettings()); -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewVMWzd.ui.h
r4071 r5292 311 311 if (cmachine.isNull()) 312 312 { 313 cmachine = vbox.CreateMachine (QString(), leName->text() );313 cmachine = vbox.CreateMachine (QString(), leName->text(), QUuid()); 314 314 if (!vbox.isOk()) 315 315 { -
trunk/src/VBox/Main/MachineImpl.cpp
r5235 r5292 337 337 * user and should never change. Used only in Init_New 338 338 * mode (ignored otherwise). 339 * @param aId UUID of the machine (used only for consistency 339 * @param aId UUID of the machine. Required for aMode==Init_Registered 340 * and optional for aMode==Init_New. Used for consistency 340 341 * check when aMode is Init_Registered; must match UUID 341 * stored in the settings file). 342 * stored in the settings file. Used for predefining the 343 * UUID of a VM when aMode is Init_New. 342 344 * 343 345 * @return Success indicator. if not S_OK, the machine object is invalid … … 454 456 { 455 457 /* create the machine UUID */ 456 unconst (mData->mUuid).create(); 458 if (aId) 459 unconst (mData->mUuid) = *aId; 460 else 461 unconst (mData->mUuid).create(); 457 462 458 463 /* memorize the provided new machine's name */ … … 2618 2623 * Returns @c true if the given DVD image is attached to this machine either 2619 2624 * in the current state or in any of the snapshots. 2620 * 2625 * 2621 2626 * @param aId Image ID to check. 2622 2627 * @param aUsage Type of the check. … … 2691 2696 } 2692 2697 2693 /** 2698 /** 2694 2699 * Returns @c true if the given Floppy image is attached to this machine either 2695 2700 * in the current state or in any of the snapshots. 2696 * 2701 * 2697 2702 * @param aId Image ID to check. 2698 2703 * @param aUsage Type of the check. … … 3423 3428 ///////////////////////////////////////////////////////////////////////////// 3424 3429 3425 /** 3430 /** 3426 3431 * Performs machine state checks based on the @a aDepType value. If a check 3427 3432 * fails, this method will set extended error info, otherwise it will return … … 3436 3441 * and not saved). It is useful to call this method from Machine setters 3437 3442 * before performing any change. 3438 * 3443 * 3439 3444 * When @a aDepType is MutableOrSavedStateDep, this method behaves the same 3440 3445 * as for MutableStateDep except that if the machine is saved, S_OK is also … … 6470 6475 !!mNetworkAdapters [slot]->data()->mCableConnected); 6471 6476 6472 CFGLDRSetUInt32 (networkAdapterNode, "speed", 6477 CFGLDRSetUInt32 (networkAdapterNode, "speed", 6473 6478 mNetworkAdapters [slot]->data()->mLineSpeed); 6474 6479 … … 6718 6723 mHWData->mMemoryBalloonSize); 6719 6724 CFGLDRSetUInt32 (guestNode, "StatisticsUpdateInterval", 6720 mHWData->mStatisticsUpdateInterval); 6725 mHWData->mStatisticsUpdateInterval); 6721 6726 6722 6727 CFGLDRReleaseNode (guestNode); -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r5236 r5292 626 626 STDMETHODIMP VirtualBox::CreateMachine (INPTR BSTR aBaseFolder, 627 627 INPTR BSTR aName, 628 INPTR GUIDPARAM aId, 628 629 IMachine **aMachine) 629 630 { … … 669 670 if (SUCCEEDED (rc)) 670 671 { 672 /* Create UUID if an empty one was specified. */ 673 Guid id = aId; 674 if (id.isEmpty()) 675 id.create(); 676 671 677 /* initialize the machine object */ 672 rc = machine->init (this, settingsFile, Machine::Init_New, aName );678 rc = machine->init (this, settingsFile, Machine::Init_New, aName, TRUE, &id); 673 679 if (SUCCEEDED (rc)) 674 680 { … … 687 693 STDMETHODIMP VirtualBox::CreateLegacyMachine (INPTR BSTR aSettingsFile, 688 694 INPTR BSTR aName, 695 INPTR GUIDPARAM aId, 689 696 IMachine **aMachine) 690 697 { … … 717 724 if (SUCCEEDED (rc)) 718 725 { 726 /* Create UUID if an empty one was specified. */ 727 Guid id = aId; 728 if (id.isEmpty()) 729 id.create(); 730 719 731 /* initialize the machine object */ 720 732 rc = machine->init (this, Bstr (settingsFile), Machine::Init_New, 721 aName, FALSE /* aNameSync */ );733 aName, FALSE /* aNameSync */, &id); 722 734 if (SUCCEEDED (rc)) 723 735 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r5252 r5292 808 808 <interface 809 809 name="IVirtualBox" extends="$dispatched" 810 uuid=" 76b25f3c-15d4-4785-a9d3-adc6a462beec"810 uuid="e1606565-8954-4703-b22a-620941b85a1c" 811 811 wsmap="global" 812 812 > … … 915 915 <base_folder>/<machine_name>/<machine_name>.xml</pre> 916 916 917 Optionally the UUID of the machine can be predefined. If this is 918 not desired (i.e. a new UUID should be generated), pass just an 919 empty or null UUID. 920 917 921 Note that the configuration of the newly created machine is not 918 922 saved to disk (and therefore no settings subfolder and file are … … 940 944 <desc>Machine name.</desc> 941 945 </param> 946 <param name="id" type="uuid" dir="in"> 947 <desc> 948 UUID of the newly created VM, when non-null or non-empty. 949 Otherwise a UUID is automatically generated. 950 </desc> 951 </param> 942 952 <param name="machine" type="IMachine" dir="return"> 943 953 <desc>Created machine object.</desc> … … 962 972 appended. 963 973 974 Optionally the UUID of the machine can be predefined. If this is 975 not desired (i.e. a new UUID should be generated), pass just an 976 empty or null UUID. 977 964 978 Note that the configuration of the newly created machine is not 965 979 saved to disk (and therefore no settings file is created) … … 990 1004 <param name="name" type="wstring" dir="in"> 991 1005 <desc>Machine name.</desc> 1006 </param> 1007 <param name="id" type="uuid" dir="in"> 1008 <desc> 1009 UUID of the newly created VM, when non-null or non-empty. 1010 Otherwise a UUID is automatically generated. 1011 </desc> 992 1012 </param> 993 1013 <param name="machine" type="IMachine" dir="return"> -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r5218 r5292 124 124 125 125 STDMETHOD(CreateMachine) (INPTR BSTR aBaseFolder, INPTR BSTR aName, 126 I Machine **aMachine);126 INPTR GUIDPARAM aId, IMachine **aMachine); 127 127 STDMETHOD(CreateLegacyMachine) (INPTR BSTR aSettingsFile, INPTR BSTR aName, 128 I Machine **aMachine);128 INPTR GUIDPARAM aId, IMachine **aMachine); 129 129 STDMETHOD(OpenMachine) (INPTR BSTR aSettingsFile, IMachine **aMachine); 130 130 STDMETHOD(RegisterMachine) (IMachine *aMachine); -
trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp
r4246 r5292 140 140 * in the configuration until we explicitely choose to do so. 141 141 */ 142 nsID VMuuid = {0}; 142 143 nsCOMPtr <IMachine> machine; 143 144 rc = virtualBox->CreateMachine(nsnull, NS_LITERAL_STRING("A brand new name").get(), 144 getter_AddRefs(machine));145 VMuuid, getter_AddRefs(machine)); 145 146 if (NS_FAILED(rc)) 146 147 {
Note:
See TracChangeset
for help on using the changeset viewer.