VirtualBox

Changeset 10220

Show
Ignore:
Timestamp:
07/04/08 14:19:35 (2 months ago)
Author:
vboxsync
Message:

Frontends/VBoxManage: reverted r32673, which was wrong, and added missing ifdefs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk

    r10058 r10220  
    3535                         $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \ 
    3636                         $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \ 
    37                          $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) 
     37                         $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \ 
     38                         $(if $(VBOX_WITH_INFO_SVC),VBOX_WITH_INFO_SVC,) 
    3839VBoxManage_DEFS.win    = _WIN32_WINNT=0x0500 
    3940VBoxManage_SOURCES     = \ 
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r10178 r10220  
    649649    } 
    650650 
     651#ifdef VBOX_WITH_INFO_SVC 
    651652    if (u64Cmd & USAGE_GETGUESTPROPERTY) 
    652653    { 
     
    661662                 "\n"); 
    662663    } 
     664#endif /* VBOX_WITH_INFO_SVC defined */ 
    663665 
    664666} 
     
    74787480} 
    74797481 
     7482#ifdef VBOX_WITH_INFO_SVC 
    74807483static int handleGetGuestProperty(int argc, char *argv[], 
    74817484                                  ComPtr<IVirtualBox> virtualBox, 
     
    74977500    if (machine) 
    74987501    { 
    7499         /** @todo r=bird: Why do you do this? argv was converted down in main (around line 7812). */ 
    7500         char *pszKey = NULL; 
    7501         int rrc = RTStrCurrentCPToUtf8(&pszKey, argv[1]); 
    7502         if (RT_SUCCESS(rrc)) 
    7503         { 
    7504             Bstr value; 
    7505             CHECK_ERROR(machine, GetGuestProperty(Bstr(pszKey), value.asOutParam())); 
    7506             if (value) 
    7507                 RTPrintf("Value: %lS\n", value.raw()); 
    7508             else 
    7509                 RTPrintf("No value set!\n"); 
    7510             RTStrFree(pszKey); 
    7511         } 
     7502        Bstr value; 
     7503        CHECK_ERROR(machine, GetGuestProperty(Bstr(argv[1]), value.asOutParam())); 
     7504        if (value) 
     7505            RTPrintf("Value: %lS\n", value.raw()); 
    75127506        else 
    7513             rc = E_INVALIDARG
     7507            RTPrintf("No value set!\n")
    75147508    } 
    75157509    return SUCCEEDED(rc) ? 0 : 1; 
     
    75357529    if (machine) 
    75367530    { 
    7537         /** @todo r=bird: Why do you do this? argv was converted down in main (around line 7812). */ 
    7538         char *pszKey = NULL; 
    7539         int rrc = RTStrCurrentCPToUtf8(&pszKey, argv[1]); 
    7540         if (RT_SUCCESS(rrc)) 
    7541         { 
    7542             if (argc < 3) 
    7543                 CHECK_ERROR(machine, SetGuestProperty(Bstr(argv[1]), NULL)); 
    7544             else if (argc == 3) 
    7545             { 
    7546                 char *pszValue = NULL; 
    7547                 rrc = RTStrCurrentCPToUtf8(&pszKey, argv[1]); 
    7548                 if (RT_SUCCESS(rrc)) 
    7549                     CHECK_ERROR(machine, SetGuestProperty(Bstr(argv[1]), Bstr(argv[2]))); 
    7550                 else 
    7551                     rc = E_INVALIDARG; 
    7552                 RTStrFree(pszValue); 
    7553             } 
    7554             else 
    7555                 return errorSyntax(USAGE_SETGUESTPROPERTY, "Too many parameters"); 
    7556             RTStrFree(pszKey); 
    7557         } 
     7531        if (argc < 3) 
     7532            CHECK_ERROR(machine, SetGuestProperty(Bstr(argv[1]), NULL)); 
     7533        else if (argc == 3) 
     7534            CHECK_ERROR(machine, SetGuestProperty(Bstr(argv[1]), Bstr(argv[2]))); 
    75587535        else 
    7559             rc = E_INVALIDARG
     7536            return errorSyntax(USAGE_SETGUESTPROPERTY, "Too many parameters")
    75607537    } 
    75617538    return SUCCEEDED(rc) ? 0 : 1; 
    75627539} 
     7540#endif /* VBOX_WITH_INFO_SVC defined */ 
    75637541 
    75647542enum ConvertSettings 
     
    78967874        { "sharedfolder",     handleSharedFolder }, 
    78977875        { "vmstatistics",     handleVMStatistics }, 
     7876#ifdef VBOX_WITH_INFO_SVC 
    78987877        { "getguestproperty", handleGetGuestProperty }, 
    78997878        { "setguestproperty", handleSetGuestProperty }, 
     7879#endif /* VBOX_WITH_INFO_SVC defined */ 
    79007880        { NULL,               NULL } 
    79017881    }; 
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r10000 r10220  
    7070#define USAGE_MODUNINSTALL          RT_BIT_64(38) 
    7171#define USAGE_RENAMEVMDK            RT_BIT_64(39) 
     72#ifdef VBOX_WITH_INFO_SVC 
    7273#define USAGE_GETGUESTPROPERTY      RT_BIT_64(40) 
    7374#define USAGE_SETGUESTPROPERTY      RT_BIT_64(41) 
     75#endif  /* VBOX_WITH_INFO_SVC defined */ 
    7476#define USAGE_ALL                   (~(uint64_t)0) 
    7577/** @} */ 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy