VirtualBox

Changeset 101381 in vbox


Ignore:
Timestamp:
Oct 6, 2023 10:00:59 AM (18 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159384
Message:

Main: More guest OS id marking. bugref:10384

Location:
trunk/src/VBox/Main
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r101379 r101381  
    302302<cpp line="#define GUEST_OS_ID_STR_ARM32(a_szOSid)   GUEST_OS_ID_STR_A32(a_szOSid)"/>
    303303<cpp line="#define GUEST_OS_ID_STR_ARM64(a_szOSid)   GUEST_OS_ID_STR_A64(a_szOSid)"/>
     304<cpp line="#define GUEST_OS_ID_STR_PARTIAL(a_szOSidPart) a_szOSidPart"/>
    304305
    305306<!--
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp

    r101374 r101381  
    680680    BOOL fW9xGuest = FALSE;
    681681    BOOL fDosGuest = FALSE;
    682     if (!pGuestOSType.isNull())
     682    if (pGuestOSType.isNotNull())
    683683    {
    684684        Bstr guestTypeFamilyId;
     
    686686        fOsXGuest = guestTypeFamilyId == Bstr("MacOS");
    687687        fWinGuest = guestTypeFamilyId == Bstr("Windows");
    688         fOs2Guest = osTypeId.startsWith("OS2");
    689         fW9xGuest = osTypeId.startsWith("Windows9");    /* Does not include Windows Me. */
    690         fDosGuest = osTypeId.startsWith("DOS") || osTypeId.startsWith("Windows31");
     688        fOs2Guest = osTypeId.startsWith(GUEST_OS_ID_STR_PARTIAL("OS2"));
     689        fW9xGuest = osTypeId.startsWith(GUEST_OS_ID_STR_PARTIAL("Windows9"));    /* Does not include Windows Me. */
     690        fDosGuest = osTypeId.equals(GUEST_OS_ID_STR_X86("DOS")) || osTypeId.equals(GUEST_OS_ID_STR_X86("Windows31"));
    691691    }
    692692
     
    767767        /* We must limit CPUID count for Windows NT 4, as otherwise it stops
    768768        with error 0x3e (MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED). */
    769         if (osTypeId == "WindowsNT4")
     769        if (osTypeId == GUEST_OS_ID_STR_X86("WindowsNT4"))
    770770        {
    771771            LogRel(("Limiting CPUID leaf count for NT4 guests\n"));
     
    925925                but that requires quite a bit of API change in Main. */
    926926            if (    fIOAPIC
    927                 &&  (   osTypeId == "WindowsNT4"
    928                      || osTypeId == "Windows2000"
    929                      || osTypeId == "WindowsXP"
    930                      || osTypeId == "Windows2003"))
     927                &&  (   osTypeId == GUEST_OS_ID_STR_X86("WindowsNT4")
     928                     || osTypeId == GUEST_OS_ID_STR_X86("Windows2000")
     929                     || osTypeId == GUEST_OS_ID_STR_X86("WindowsXP")
     930                     || osTypeId == GUEST_OS_ID_STR_X86("Windows2003")))
    931931            {
    932932                /* Only allow TPR patching for NT, Win2k, XP and Windows Server 2003. (32 bits mode)
     
    10081008
    10091009        /* Enable workaround for missing TLB flush for OS/2 guests, see ticketref:20625. */
    1010         if (osTypeId.startsWith("OS2"))
     1010        if (fOs2Guest)
    10111011            InsertConfigInteger(pHM, "MissingOS2TlbFlushWorkaround", 1);
    10121012
     
    16381638            /** @todo @bugref{7145}: We might want to enable this by default for new VMs. For now,
    16391639             *        this is required for Windows 2012 guests. */
    1640             if (osTypeId == "Windows2012_64")
     1640            if (osTypeId == GUEST_OS_ID_STR_X64("Windows2012"))
    16411641                InsertConfigInteger(pBiosCfg, "DmiExposeMemoryTable", 1); /* boolean */
    16421642        }
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r99252 r101381  
    28782878         * Determine guest OS type and the required installer image.
    28792879         */
     2880/** @todo r=bird: Why are we using the guest properties for this instead of the
     2881 * reported guest VBOXOSTYPE/ID?  Since we've got guest properties, we must
     2882 * have GAs, so the guest additions must've reported the guest OS type. That
     2883 * would allow proper OS categorization by family ID instead of this ridiculous
     2884 * naive code assuming anything that isn't windows or solaris must be linux.  */
    28802885        Utf8Str strOSType;
    28812886        vrc = getGuestProperty(pGuest, "/VirtualBox/GuestInfo/OS/Product", strOSType);
    28822887        if (RT_SUCCESS(vrc))
    28832888        {
    2884             if (   strOSType.contains("Microsoft", Utf8Str::CaseInsensitive)
    2885                 || strOSType.contains("Windows", Utf8Str::CaseInsensitive))
     2889            if (   strOSType.contains(GUEST_OS_ID_STR_PARTIAL("Microsoft"), Utf8Str::CaseInsensitive)
     2890                || strOSType.contains(GUEST_OS_ID_STR_PARTIAL("Windows"), Utf8Str::CaseInsensitive))
    28862891            {
    28872892                osType = eOSType_Windows;
     
    29272932                }
    29282933            }
    2929             else if (strOSType.contains("Solaris", Utf8Str::CaseInsensitive))
     2934            else if (strOSType.contains(GUEST_OS_ID_STR_PARTIAL("Solaris"), Utf8Str::CaseInsensitive))
    29302935            {
    29312936                osType = eOSType_Solaris;
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r101317 r101381  
    42844284     */
    42854285    const char *pszOSTypeId = Global::OSTypeId(rImage.mOSType);
    4286     if (pszOSTypeId && strcmp(pszOSTypeId, "Other") != 0)
     4286    if (pszOSTypeId && !RTStrStartsWith(pszOSTypeId, GUEST_OS_ID_STR_PARTIAL("Other"))) /** @todo set x64/a64 other variants or not? */
    42874287        mStrDetectedOSTypeId = pszOSTypeId;
    42884288    else
  • trunk/src/VBox/Main/testcase/tstVBoxAPIXPCOM.cpp

    r101035 r101381  
    230230     */
    231231    nsCOMPtr<IGuestOSType> osType;
    232     rc = virtualBox->GetGuestOSType(NS_LITERAL_STRING("Windows2000").get(),
     232    rc = virtualBox->GetGuestOSType(NS_LITERAL_STRING(GUEST_OS_ID_STR_X86("Windows2000")).get(),
    233233                                    getter_AddRefs(osType));
    234234    if (NS_FAILED(rc))
     
    238238    else
    239239    {
    240         machine->SetOSTypeId(NS_LITERAL_STRING("Windows2000").get());
     240        machine->SetOSTypeId(NS_LITERAL_STRING(GUEST_OS_ID_STR_X86("Windows2000")).get());
    241241    }
    242242
  • trunk/src/VBox/Main/xml/Settings.cpp

    r101379 r101381  
    68326832} const g_aConvertGuestOSTypesPre1_5[] =
    68336833{
    6834     { "unknown", "Other" },
    6835     { "dos", "DOS" },
    6836     { "win31", "Windows31" },
    6837     { "win95", "Windows95" },
    6838     { "win98", "Windows98" },
    6839     { "winme", "WindowsMe" },
    6840     { "winnt4", "WindowsNT4" },
    6841     { "win2k", "Windows2000" },
    6842     { "winxp", "WindowsXP" },
    6843     { "win2k3", "Windows2003" },
    6844     { "winvista", "WindowsVista" },
    6845     { "win2k8", "Windows2008" },
    6846     { "os2warp3", "OS2Warp3" },
    6847     { "os2warp4", "OS2Warp4" },
    6848     { "os2warp45", "OS2Warp45" },
    6849     { "ecs", "OS2eCS" },
    6850     { "linux22", "Linux22" },
    6851     { "linux24", "Linux24" },
    6852     { "linux26", "Linux26" },
    6853     { "archlinux", "ArchLinux" },
    6854     { "debian", "Debian" },
    6855     { "opensuse", "OpenSUSE" },
    6856     { "fedoracore", "Fedora" },
    6857     { "gentoo", "Gentoo" },
    6858     { "mandriva", "Mandriva" },
    6859     { "redhat", "RedHat" },
    6860     { "ubuntu", "Ubuntu" },
    6861     { "xandros", "Xandros" },
    6862     { "freebsd", "FreeBSD" },
    6863     { "openbsd", "OpenBSD" },
    6864     { "netbsd", "NetBSD" },
    6865     { "netware", "Netware" },
    6866     { "solaris", "Solaris" },
    6867     { "opensolaris", "OpenSolaris" },
    6868     { "l4", "L4" }
     6834    { "unknown",        GUEST_OS_ID_STR_X86("Other") },
     6835    { "dos",            GUEST_OS_ID_STR_X86("DOS") },
     6836    { "win31",          GUEST_OS_ID_STR_X86("Windows31") },
     6837    { "win95",          GUEST_OS_ID_STR_X86("Windows95") },
     6838    { "win98",          GUEST_OS_ID_STR_X86("Windows98") },
     6839    { "winme",          GUEST_OS_ID_STR_X86("WindowsMe") },
     6840    { "winnt4",         GUEST_OS_ID_STR_X86("WindowsNT4") },
     6841    { "win2k",          GUEST_OS_ID_STR_X86("Windows2000") },
     6842    { "winxp",          GUEST_OS_ID_STR_X86("WindowsXP") },
     6843    { "win2k3",         GUEST_OS_ID_STR_X86("Windows2003") },
     6844    { "winvista",       GUEST_OS_ID_STR_X86("WindowsVista") },
     6845    { "win2k8",         GUEST_OS_ID_STR_X86("Windows2008") },
     6846    { "os2warp3",       GUEST_OS_ID_STR_X86("OS2Warp3") },
     6847    { "os2warp4",       GUEST_OS_ID_STR_X86("OS2Warp4") },
     6848    { "os2warp45",      GUEST_OS_ID_STR_X86("OS2Warp45") },
     6849    { "ecs",            GUEST_OS_ID_STR_X86("OS2eCS") },
     6850    { "linux22",        GUEST_OS_ID_STR_X86("Linux22") },
     6851    { "linux24",        GUEST_OS_ID_STR_X86("Linux24") },
     6852    { "linux26",        GUEST_OS_ID_STR_X86("Linux26") },
     6853    { "archlinux",      GUEST_OS_ID_STR_X86("ArchLinux") },
     6854    { "debian",         GUEST_OS_ID_STR_X86("Debian") },
     6855    { "opensuse",       GUEST_OS_ID_STR_X86("OpenSUSE") },
     6856    { "fedoracore",     GUEST_OS_ID_STR_X86("Fedora") },
     6857    { "gentoo",         GUEST_OS_ID_STR_X86("Gentoo") },
     6858    { "mandriva",       GUEST_OS_ID_STR_X86("Mandriva") },
     6859    { "redhat",         GUEST_OS_ID_STR_X86("RedHat") },
     6860    { "ubuntu",         GUEST_OS_ID_STR_X86("Ubuntu") },
     6861    { "xandros",        GUEST_OS_ID_STR_X86("Xandros") },
     6862    { "freebsd",        GUEST_OS_ID_STR_X86("FreeBSD") },
     6863    { "openbsd",        GUEST_OS_ID_STR_X86("OpenBSD") },
     6864    { "netbsd",         GUEST_OS_ID_STR_X86("NetBSD") },
     6865    { "netware",        GUEST_OS_ID_STR_X86("Netware") },
     6866    { "solaris",        GUEST_OS_ID_STR_X86("Solaris") },
     6867    { "opensolaris",    GUEST_OS_ID_STR_X86("OpenSolaris") },
     6868    { "l4",             GUEST_OS_ID_STR_X86("L4") },
    68696869};
    68706870
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