Changeset 33313 in vbox for trunk/src/VBox/Frontends/VBoxHeadless
- Timestamp:
- Oct 21, 2010 2:56:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r33294 r33313 548 548 "(C) 2008-" VBOX_C_YEAR " " VBOX_VENDOR "\n" 549 549 "All rights reserved.\n\n"); 550 551 Bstr id;552 /* the below cannot be Bstr because on Linux Bstr doesn't work until XPCOM (nsMemory) is initialized */553 const char *name = NULL;554 550 555 551 #ifdef VBOX_FFMPEG … … 616 612 }; 617 613 614 const char *pcszNameOrUUID = NULL; 615 618 616 // parse the command line 619 617 int ch; … … 626 624 { 627 625 case 's': 628 id = asGuidStr(ValueUnion.psz); 629 /* If the argument was not a UUID, then it must be a name. */ 630 if (id.isEmpty()) 631 name = ValueUnion.psz; 626 pcszNameOrUUID = ValueUnion.psz; 632 627 break; 633 628 #ifdef VBOX_WITH_VRDP … … 746 741 #endif /* defined VBOX_FFMPEG */ 747 742 748 if ( id.isEmpty() && !name)743 if (!pcszNameOrUUID) 749 744 { 750 745 show_usage(); … … 793 788 ComPtr<IMachine> m; 794 789 795 rc = virtualBox->FindMachine(Bstr( name).raw(), m.asOutParam());790 rc = virtualBox->FindMachine(Bstr(pcszNameOrUUID).raw(), m.asOutParam()); 796 791 if (FAILED(rc)) 797 792 { … … 799 794 break; 800 795 } 796 Bstr id; 801 797 m->COMGETTER(Id)(id.asOutParam()); 802 798 AssertComRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.