VirtualBox

Changeset 44039 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Dec 5, 2012 12:08:52 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
82492
Message:

Main: renavation com::Guid class. PR5744

Location:
trunk/src/VBox/Frontends
Files:
3 edited

Legend:

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

    r42551 r44039  
    874874
    875875            Bstr usbId = a->argv[2];
    876             if (Guid(usbId).isEmpty())
     876
     877            Guid guid(usbId);
     878            if (!guid.isValid())
    877879            {
    878880                // assume address
     
    897899                    CHECK_ERROR_BREAK(dev, COMGETTER(Id)(usbId.asOutParam()));
    898900                }
     901            }
     902            else if (guid.isZero())
     903            {
     904                errorArgument("Zero UUID argument '%s'", a->argv[2]);
     905                rc = E_FAIL;
     906                break;
    899907            }
    900908
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp

    r44028 r44039  
    159159
    160160    /* If it is no UUID, convert the filename to an absolute one. */
    161     if (id.isEmpty())
     161    if (!id.isValid())
    162162    {
    163163        int irc = RTPathAbs(pszFilenameOrUuid, szFilenameAbs, sizeof(szFilenameAbs));
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r42472 r44039  
    950950            // first check if a UUID was supplied
    951951            uuidVM = argv[curArg];
    952             if (uuidVM.isEmpty())
     952
     953            if (!uuidVM.isValid())
    953954            {
    954955                LogFlow(("invalid UUID format, assuming it's a VM name\n"));
    955956                vmName = argv[curArg];
     957            }
     958            else if (uuidVM.isZero())
     959            {
     960                RTPrintf("Error: UUID argument is zero!\n");
     961                return 1;
    956962            }
    957963        }
     
    14171423     * Do we have a UUID?
    14181424     */
    1419     if (!uuidVM.isEmpty())
     1425    if (uuidVM.isValid())
    14201426    {
    14211427        rc = pVirtualBox->FindMachine(uuidVM.toUtf16().raw(), pMachine.asOutParam());
     
    14431449            goto leave;
    14441450        }
    1445     }
    1446     else if (uuidVM.isEmpty())
    1447     {
    1448         RTPrintf("Error: no machine specified!\n");
    1449         goto leave;
    14501451    }
    14511452
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