VirtualBox

Changeset 18007 in vbox


Ignore:
Timestamp:
Mar 17, 2009 10:10:57 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
44595
Message:

OVF: be a little bit smarter on the network card type import

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r17970 r18007  
    14001400                        strNetwork = "NAT";
    14011401
     1402                    /* Figure out the hardware type */
    14021403                    NetworkAdapterType_T nwAdapterVBox = defaultAdapterVBox;
    14031404                    if (!ea.strAdapterType.compare("PCNet32", Utf8Str::CaseInsensitive))
    1404                         nwAdapterVBox = NetworkAdapterType_Am79C973;
     1405                    {
     1406                        /* If the default adapter is already one of the two
     1407                         * PCNet adapters use the default one. If not use the
     1408                         * Am79C970A as fallback. */
     1409                        if (!(defaultAdapterVBox == NetworkAdapterType_Am79C970A ||
     1410                              defaultAdapterVBox == NetworkAdapterType_Am79C973))
     1411                            nwAdapterVBox = NetworkAdapterType_Am79C970A;
     1412                    }
     1413#ifdef VBOX_WITH_E1000
    14051414                    else if (!ea.strAdapterType.compare("E1000", Utf8Str::CaseInsensitive))
    1406                         nwAdapterVBox = NetworkAdapterType_I82540EM;
     1415                    {
     1416                        /* If the default adapter is already one of the two
     1417                         * E1000 adapters use the default one. If not use the
     1418                         * I82540EM as fallback. */
     1419                        if (!(defaultAdapterVBox == NetworkAdapterType_I82540EM ||
     1420                              defaultAdapterVBox == NetworkAdapterType_I82543GC))
     1421                            nwAdapterVBox = NetworkAdapterType_I82540EM;
     1422                    }
     1423#endif /* VBOX_WITH_E1000 */
    14071424
    14081425                    pNewDesc->addEntry(VirtualSystemDescriptionType_NetworkAdapter,
     
    28732890                                /* Set the hardware type to something useful.
    28742891                                 * To be compatible with vmware & others we set
    2875                                  * PCNet32 for our PCNet types. For the E1000
    2876                                  * cards we invented E1000 as a generic type.
    2877                                  * */
     2892                                 * PCNet32 for our PCNet types & E1000 for the
     2893                                 * E1000 cards. */
    28782894                                switch (desc.strVbox.toInt32())
    28792895                                {
    28802896                                    case NetworkAdapterType_Am79C970A:
    28812897                                    case NetworkAdapterType_Am79C973: strResourceSubType = "PCNet32"; break;
     2898#ifdef VBOX_WITH_E1000
    28822899                                    case NetworkAdapterType_I82540EM:
    28832900                                    case NetworkAdapterType_I82543GC: strResourceSubType = "E1000"; break;
     2901#endif /* VBOX_WITH_E1000 */
    28842902                                }
    28852903                                strConnection = desc.strOvf;
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