VirtualBox

Changeset 23935 in vbox


Ignore:
Timestamp:
Oct 21, 2009 2:18:11 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53747
Message:

VBoxManage: don't use machine uuid variable for other purposes.

File:
1 edited

Legend:

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

    r23934 r23935  
    572572    /* try to find the given machine */
    573573    ComPtr <IMachine> machine;
    574     Bstr uuid (a->argv[0]);
    575     if (!Guid(uuid).isEmpty())
    576     {
    577         CHECK_ERROR(a->virtualBox, GetMachine(uuid, machine.asOutParam()));
     574    Bstr machineuuid (a->argv[0]);
     575    if (!Guid(machineuuid).isEmpty())
     576    {
     577        CHECK_ERROR(a->virtualBox, GetMachine(machineuuid, machine.asOutParam()));
    578578    }
    579579    else
    580580    {
    581         CHECK_ERROR(a->virtualBox, FindMachine(uuid, machine.asOutParam()));
     581        CHECK_ERROR(a->virtualBox, FindMachine(machineuuid, machine.asOutParam()));
    582582        if (SUCCEEDED (rc))
    583             machine->COMGETTER(Id)(uuid.asOutParam());
     583            machine->COMGETTER(Id)(machineuuid.asOutParam());
    584584    }
    585585    if (FAILED (rc))
     
    587587
    588588    /* open a session for the VM */
    589     CHECK_ERROR_RET(a->virtualBox, OpenExistingSession(a->session, uuid), 1);
     589    CHECK_ERROR_RET(a->virtualBox, OpenExistingSession(a->session, machineuuid), 1);
    590590
    591591    do
     
    11211121        else if (!strcmp(a->argv[1], "dvdattach"))
    11221122        {
     1123            Bstr uuid;
    11231124            if (a->argc != 3)
    11241125            {
     
    11531154            {
    11541155                /* first assume it's a UUID */
    1155                 Bstr uuid(a->argv[2]);
     1156                uuid = a->argv[2];
    11561157                rc = a->virtualBox->GetDVDImage(uuid, dvdMedium.asOutParam());
    11571158                if (FAILED(rc) || !dvdMedium)
     
    11841185        else if (!strcmp(a->argv[1], "floppyattach"))
    11851186        {
     1187            Bstr uuid;
    11861188            if (a->argc != 3)
    11871189            {
     
    12151217            {
    12161218                /* first assume it's a UUID */
    1217                 Bstr uuid(a->argv[2]);
     1219                uuid = a->argv[2];
    12181220                rc = a->virtualBox->GetFloppyImage(uuid, floppyMedium.asOutParam());
    12191221                if (FAILED(rc) || !floppyMedium)
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