VirtualBox

Changeset 101593 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Oct 25, 2023 3:37:09 PM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159677
Message:

doc/manual,Frontends/VBoxManage,Main/{Global,GuestOSType,VirtualBox.xidl}:
Revisit the OS guest OS changes which added a new 'variant' field to the
Global::sOSTypes[] table along with a new VBoxManage subcommand and
IVirtualBox methods for accessing the guest OS variant information
(r159137). After discussion with the documentation team the identifier
'variant' is being changed to the clearer 'subtype' which also doesn't
overlap with the 'variant' terminology used with medium management
(IMedium::variant(), the MediumVariant enum, etc.). bugref:5936

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/GuestOSTypeImpl.cpp

    r101215 r101593  
    100100    unconst(mFamilyID)                  = ostype.familyId;
    101101    unconst(mFamilyDescription)         = ostype.familyDescription;
    102     unconst(mOSVariant)                 = ostype.variant;
     102    unconst(mOSSubtype)                 = ostype.subtype;
    103103    unconst(mID)                        = ostype.id;
    104104    unconst(mDescription)               = ostype.description;
     
    159159
    160160
    161 HRESULT GuestOSType::getVariant(com::Utf8Str &aVariant)
    162 {
    163     /* mOSVariant is constant during life time, no need to lock */
    164     aVariant = mOSVariant;
     161HRESULT GuestOSType::getSubtype(com::Utf8Str &aSubtype)
     162{
     163    /* mOSSubtype is constant during life time, no need to lock */
     164    aSubtype = mOSSubtype;
    165165
    166166    return S_OK;
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r101471 r101593  
    45184518/**
    45194519 * Walk the list of GuestOSType objects and return a list of guest OS
    4520  * variants which correspond to the supplied guest OS family ID.
     4520 * subtypes which correspond to the supplied guest OS family ID.
    45214521 *
    45224522 * @param strOSFamily    Guest OS family ID.
    4523  * @param aOSVariants    Where to store the list of guest OS variants.
     4523 * @param aOSSubtypes    Where to store the list of guest OS subtypes.
    45244524 *
    45254525 * @note Locks the guest OS types list for reading.
    45264526 */
    4527 HRESULT VirtualBox::getGuestOSVariantsByFamilyId(const Utf8Str &strOSFamily,
    4528                                                  std::vector<com::Utf8Str> &aOSVariants)
    4529 {
    4530     std::list<com::Utf8Str> allOSVariants;
     4527HRESULT VirtualBox::getGuestOSSubtypesByFamilyId(const Utf8Str &strOSFamily,
     4528                                                 std::vector<com::Utf8Str> &aOSSubtypes)
     4529{
     4530    std::list<com::Utf8Str> allOSSubtypes;
    45314531
    45324532    AutoReadLock alock(m->allGuestOSTypes.getLockHandle() COMMA_LOCKVAL_SRC_POS);
     
    45564556        if (familyId.compare(strOSFamily, Utf8Str::CaseInsensitive) == 0)
    45574557        {
    4558             const Utf8Str &strOSVariant = (*it)->i_variant();
    4559             if (!strOSVariant.isEmpty())
    4560                 allOSVariants.push_back(strOSVariant);
     4558            const Utf8Str &strOSSubtype = (*it)->i_subtype();
     4559            if (!strOSSubtype.isEmpty())
     4560                allOSSubtypes.push_back(strOSSubtype);
    45614561        }
    45624562    }
    45634563
    45644564    /* throw out any duplicates */
    4565     allOSVariants.sort();
    4566     allOSVariants.unique();
    4567 
    4568     aOSVariants.resize(allOSVariants.size());
     4565    allOSSubtypes.sort();
     4566    allOSSubtypes.unique();
     4567
     4568    aOSSubtypes.resize(allOSSubtypes.size());
    45694569    size_t i = 0;
    4570     for (std::list<com::Utf8Str>::const_iterator it = allOSVariants.begin();
    4571          it != allOSVariants.end(); ++it, ++i)
    4572         aOSVariants[i] = (*it);
     4570    for (std::list<com::Utf8Str>::const_iterator it = allOSSubtypes.begin();
     4571         it != allOSSubtypes.end(); ++it, ++i)
     4572        aOSSubtypes[i] = (*it);
    45734573
    45744574    return S_OK;
     
    45774577/**
    45784578 * Walk the list of GuestOSType objects and return a list of guest OS
    4579  * descriptions which correspond to the supplied guest OS variant.
    4580  *
    4581  * @param strOSVariant     Guest OS variant.
     4579 * descriptions which correspond to the supplied guest OS subtype.
     4580 *
     4581 * @param strOSSubtype     Guest OS subtype.
    45824582 * @param aGuestOSDescs    Where to store the list of guest OS descriptions..
    45834583 *
    45844584 * @note Locks the guest OS types list for reading.
    45854585 */
    4586 HRESULT VirtualBox::getGuestOSDescsByVariant(const Utf8Str &strOSVariant,
     4586HRESULT VirtualBox::getGuestOSDescsBySubtype(const Utf8Str &strOSSubtype,
    45874587                                             std::vector<com::Utf8Str> &aGuestOSDescs)
    45884588{
     
    45914591    AutoReadLock alock(m->allGuestOSTypes.getLockHandle() COMMA_LOCKVAL_SRC_POS);
    45924592
    4593     bool fFoundGuestOSVariant = false;
     4593    bool fFoundGuestOSSubtype = false;
    45944594    for (GuestOSTypesOList::const_iterator it = m->allGuestOSTypes.begin();
    45954595         it != m->allGuestOSTypes.end(); ++it)
    45964596    {
    4597         const Utf8Str &guestOSVariant = (*it)->i_variant();
    4598         /* Only some guest OS types have a populated variant value. */
    4599         if (guestOSVariant.isNotEmpty() &&
    4600             guestOSVariant.compare(strOSVariant, Utf8Str::CaseInsensitive) == 0)
    4601         {
    4602             fFoundGuestOSVariant = true;
     4597        const Utf8Str &guestOSSubtype = (*it)->i_subtype();
     4598        /* Only some guest OS types have a populated subtype value. */
     4599        if (guestOSSubtype.isNotEmpty() &&
     4600            guestOSSubtype.compare(strOSSubtype, Utf8Str::CaseInsensitive) == 0)
     4601        {
     4602            fFoundGuestOSSubtype = true;
    46034603            break;
    46044604        }
    46054605    }
    46064606
    4607     if (!fFoundGuestOSVariant)
     4607    if (!fFoundGuestOSSubtype)
    46084608       return setError(VBOX_E_OBJECT_NOT_FOUND,
    4609                        tr("'%s' is not a valid guest OS variant."), strOSVariant.c_str());
     4609                       tr("'%s' is not a valid guest OS subtype."), strOSSubtype.c_str());
    46104610
    46114611    for (GuestOSTypesOList::const_iterator it = m->allGuestOSTypes.begin();
    46124612         it != m->allGuestOSTypes.end(); ++it)
    46134613    {
    4614         const Utf8Str &guestOSVariant = (*it)->i_variant();
    4615         /* Only some guest OS types have a populated variant value. */
    4616         if (guestOSVariant.isNotEmpty() &&
    4617             guestOSVariant.compare(strOSVariant, Utf8Str::CaseInsensitive) == 0)
     4614        const Utf8Str &guestOSSubtype = (*it)->i_subtype();
     4615        /* Only some guest OS types have a populated subtype value. */
     4616        if (guestOSSubtype.isNotEmpty() &&
     4617            guestOSSubtype.compare(strOSSubtype, Utf8Str::CaseInsensitive) == 0)
    46184618        {
    46194619            const Utf8Str &strOSDesc = (*it)->i_description();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette