VirtualBox

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


Ignore:
Timestamp:
Jul 5, 2018 2:44:31 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123468
Message:

Main/*: From now on any valid UTF8 string is considered a valid guest OS type. Of course not all of them are known, so the API clients must be prepared to deal with not having a matching IGuestOSType object.
Frontends/VBoxManage+VBoxShell: adjust to deal with the change

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

Legend:

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

    r70790 r72919  
    673673
    674674    SHOW_STRING_PROP(      machine, Name,                       "name",                 "Name:");
    675 
     675    SHOW_STRINGARRAY_PROP( machine, Groups,                     "groups",               "Groups:");
    676676    Bstr osTypeId;
    677677    CHECK_ERROR2I_RET(machine, COMGETTER(OSTypeId)(osTypeId.asOutParam()), hrcCheck);
    678678    ComPtr<IGuestOSType> osType;
    679     CHECK_ERROR2I_RET(pVirtualBox, GetGuestOSType(osTypeId.raw(), osType.asOutParam()), hrcCheck);
    680     SHOW_STRINGARRAY_PROP( machine, Groups,                     "groups",               "Groups:");
    681     SHOW_STRING_PROP(       osType, Description,                "ostype",               "Guest OS:");
     679    pVirtualBox->GetGuestOSType(osTypeId.raw(), osType.asOutParam());
     680    if (!osType.isNull())
     681        SHOW_STRING_PROP(       osType, Description,                "ostype",               "Guest OS:");
     682    else
     683        SHOW_STRING_PROP(      machine, OSTypeId,                   "ostype",               "Guest OS:");
    682684    SHOW_UUID_PROP(        machine, Id,                         "UUID",                 "UUID:");
    683685    SHOW_STRING_PROP(      machine, SettingsFilePath,           "CfgFile",              "Config file:");
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r72143 r72919  
    564564            case MODIFYVM_OSTYPE:
    565565            {
    566                 ComPtr<IGuestOSType> guestOSType;
    567                 CHECK_ERROR(a->virtualBox, GetGuestOSType(Bstr(ValueUnion.psz).raw(),
    568                                                           guestOSType.asOutParam()));
    569                 if (SUCCEEDED(rc) && guestOSType)
    570                 {
    571                     CHECK_ERROR(sessionMachine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw()));
    572                 }
    573                 else
    574                 {
    575                     errorArgument("Invalid guest OS type '%s'", ValueUnion.psz);
    576                     rc = E_FAIL;
    577                 }
     566                CHECK_ERROR(sessionMachine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw()));
    578567                break;
    579568            }
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r71179 r72919  
    962962    if mach == None:
    963963        return 0
    964     vmos = ctx['vb'].getGuestOSType(mach.OSTypeId)
     964    try:
     965        vmos = ctx['vb'].getGuestOSType(mach.OSTypeId)
     966    except:
     967        vmos = None
    965968    print(" One can use setvar <mach> <var> <value> to change variable, using name in [].")
    966969    print("  Name [name]: %s" % (colVm(ctx, mach.name)))
    967970    print("  Description [description]: %s" % (mach.description))
    968971    print("  ID [n/a]: %s" % (mach.id))
    969     print("  OS Type [via OSTypeId]: %s" % (vmos.description))
     972    print("  OS Type [via OSTypeId]: %s" % (vmos.description if vmos is not None else mach.OSTypeId))
    970973    print("  Firmware [firmwareType]: %s (%s)" % (asEnumElem(ctx, "FirmwareType", mach.firmwareType), mach.firmwareType))
    971974    print()
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