VirtualBox

Changeset 82681 in vbox


Ignore:
Timestamp:
Jan 9, 2020 4:31:04 AM (5 years ago)
Author:
vboxsync
Message:

Network/DevVirtioNet_1_0.cpp: Ported skeletal framwork from VirtIO 0.9 to VirtIO 1.0 semantics. Builds but not working. See BugRef(8561) Comment #49 for details

Location:
trunk
Files:
1 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxPktDmp.h

    r76585 r82681  
    5050
    5151
    52 DECLHIDDEN(void) vboxEthPacketDump(const char *pcszInstance, const char *pcszText, const uint8_t *pcPacket, uint32_t cb)
     52//DECLHIDDEN(void)
     53DECLINLINE(void) vboxEthPacketDump(const char *pcszInstance, const char *pcszText, const uint8_t *pcPacket, uint32_t cb)
    5354{
    5455#if defined(LOG_ENABLED) && !defined(VBOX_DEVICE_STRUCT_TESTCASE)
  • trunk/src/VBox/Devices/Makefile.kmk

    r82561 r82681  
    476476  VBoxDD_SOURCES        += \
    477477        VirtIO/Virtio.cpp \
     478        VirtIO/Virtio_1_0.cpp \
    478479        Network/DevVirtioNet.cpp
    479480 endif
     481
     482 if defined(VBOX_WITH_VIRTIO) && defined(VBOX_WITH_VIRTIO_NET_1_0)
     483  VBoxDD_DEFS         += VBOX_WITH_VIRTIO_NET_1_0
     484  VBoxDD_SOURCES      += \
     485        Network/DevVirtioNet_1_0.cpp
     486endif
    480487
    481488 ifdef VBOX_WITH_UDPTUNNEL
     
    525532 endif
    526533
    527  ifdef VBOX_WITH_VIRTIO_SCSI
     534 if defined(VBOX_WITH_VIRTIO) && defined(VBOX_WITH_VIRTIO_SCSI)
    528535  VBoxDD_DEFS           += VBOX_WITH_VIRTIO_SCSI
    529536  VBoxDD_SOURCES        += \
    530         VirtIO/Virtio_1_0.cpp \
    531537        Storage/DevVirtioSCSI.cpp
    532538 endif
     
    958964   VBoxDDRC_SOURCES     += \
    959965        VirtIO/Virtio.cpp \
     966        VirtIO/Virtio_1_0.cpp \
    960967        Network/DevVirtioNet.cpp
     968  endif
     969
     970  ifdef defined(VBOX_WITH_VIRTIO) && defined(VBOX_WITH_VIRTIO_NET_1_0)
     971   VBoxDDRC_DEFS         += VBOX_WITH_VIRTIO_NET_1_0
     972   VBoxDDRC_SOURCES      += \
     973         Network/DevVirtioNet_1_0.cpp
    961974  endif
    962975
     
    11461159  VBoxDDR0_SOURCES      += \
    11471160        VirtIO/Virtio.cpp \
     1161        VirtIO/Virtio_1_0.cpp \
    11481162        Network/DevVirtioNet.cpp
     1163 endif
     1164
     1165 if defined(VBOX_WITH_VIRTIO) && defined(VBOX_WITH_VIRTIO_NET_1_0)
     1166  VBoxDDR0_DEFS         += VBOX_WITH_VIRTIO_NET_1_0
     1167  VBoxDDR0_SOURCES      += \
     1168        Network/DevVirtioNet_1_0.cpp
    11491169 endif
    11501170
     
    12171237 endif
    12181238
    1219  if defined(VBOX_WITH_VIRTIO_SCSI)
     1239 if defined (VBOX_WITH_VIRTIO) && defined(VBOX_WITH_VIRTIO_SCSI)
    12201240  VBoxDDR0_DEFS         += VBOX_WITH_VIRTIO_SCSI
    12211241  VBoxDDR0_SOURCES      += \
    1222         VirtIO/Virtio_1_0.cpp \
    12231242        Storage/DevVirtioSCSI.cpp
    12241243 endif
  • trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp

    r82571 r82681  
    382382    /** Flag whether device is present. */
    383383    bool                            fPresent;
     384
    384385    /** Media port interface. */
    385386    PDMIMEDIAPORT                   IMediaPort;
     
    412413    VIRTIOCORE                      Virtio;
    413414
     415    /** VirtIO Host SCSI device runtime configuration parameters */
     416    VIRTIOSCSI_CONFIG_T             virtioScsiConfig;
     417
    414418    bool                            fBootable;
    415419    bool                            afPadding0[3];
     
    442446    volatile uint32_t               cActiveReqs;
    443447
    444     /** VirtIO Host SCSI device runtime configuration parameters */
    445     VIRTIOSCSI_CONFIG_T             virtioScsiConfig;
    446448
    447449    /** True if the guest/driver and VirtIO framework are in the ready state */
     
    493495    /** Status Target: LEDs port interface. */
    494496    PDMILEDPORTS                    ILeds;
    495 
    496     /** Status Target: Partner of ILeds. */
    497     R3PTRTYPE(PPDMILEDCONNECTORS)   pLedsConnector;
    498497
    499498    /** IMediaExPort: Media ejection notification */
     
    25502549        pTarget->pDevIns = pDevIns;
    25512550        pTarget->uTarget = uTarget;
    2552         pTarget->led.u32Magic = PDMLED_MAGIC;
    25532551
    25542552        pTarget->IBase.pfnQueryInterface                 = virtioScsiR3TargetQueryInterface;
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp

    r82560 r82681  
    17221722    AssertReturn(pVirtioCC->pfnStatusChanged, VERR_INVALID_POINTER);
    17231723    AssertReturn(pVirtioCC->pfnQueueNotified, VERR_INVALID_POINTER);
    1724     AssertReturn(pVirtioCC->pfnDevCapRead,    VERR_INVALID_POINTER);
    1725     AssertReturn(pVirtioCC->pfnDevCapWrite,   VERR_INVALID_POINTER);
     1724//    AssertReturn(pVirtioCC->pfnDevCapRead,    VERR_INVALID_POINTER);
     1725//    AssertReturn(pVirtioCC->pfnDevCapWrite,   VERR_INVALID_POINTER);
    17261726
    17271727#if 0 /* Until pdmR3DvHlp_PCISetIrq() impl is fixed and Assert that limits vec to 0 is removed */
  • trunk/src/VBox/Devices/build/VBoxDD.cpp

    r80531 r82681  
    117117        return rc;
    118118#endif
     119#ifdef VBOX_WITH_VIRTIO_NET_1_0
     120    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVirtioNet_1_0);
     121    if (RT_FAILURE(rc))
     122        return rc;
     123#endif
    119124#ifdef VBOX_WITH_INIP
    120125    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceINIP);
  • trunk/src/VBox/Devices/build/VBoxDD.h

    r78799 r82681  
    5757extern const PDMDEVREG g_DeviceVirtioNet;
    5858#endif
     59#ifdef VBOX_WITH_VIRTIO_NET_1_0
     60extern const PDMDEVREG g_DeviceVirtioNet_1_0;
     61#endif
    5962#ifdef VBOX_WITH_INIP
    6063extern const PDMDEVREG g_DeviceINIP;
  • trunk/src/VBox/Devices/build/VBoxDDR0.cpp

    r81512 r82681  
    6060#ifdef VBOX_WITH_VIRTIO
    6161    &g_DeviceVirtioNet,
     62#endif
     63#ifdef VBOX_WITH_VIRTIO_NET_1_0
     64    &g_DeviceVirtioNet_1_0,
    6265#endif
    6366    &g_DeviceICHAC97,
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r81964 r82681  
    14571457#ifdef VBOX_WITH_VIRTIO
    14581458                    case NetworkAdapterType_Virtio:     pszNICType = "virtio";      break;
     1459
     1460#endif
     1461#ifdef VBOX_WITH_VIRTIO_NET_1_0
     1462                    case NetworkAdapterType_Virtio_1_0: pszNICType = "virtio_1.0";  break;
    14591463#endif
    14601464                    default: AssertFailed();            pszNICType = "unknown";     break;
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r82442 r82681  
    14981498                }
    14991499#endif /* VBOX_WITH_VIRTIO */
     1500#ifdef VBOX_WITH_VIRTIO_NET_1_0
     1501                else if (!RTStrICmp(ValueUnion.psz, "virtio_1.0"))
     1502                {
     1503                    CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_Virtio_1_0));
     1504                }
     1505#endif /* VBOX_WITH_VIRTIO_NET_1_0 */
    15001506                else
    15011507                {
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r81964 r82681  
    16571657    elif (natype == ctx['global'].constants.NetworkAdapterType_Virtio):
    16581658        return "virtio"
     1659    elif (natype == ctx['global'].constants.NetworkAdapterType_Virtio_1_0):
     1660        return "virtio_1.0"
    16591661    elif (natype == ctx['global'].constants.NetworkAdapterType_Null):
    16601662        return None
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp

    r82605 r82681  
    365365        case KNetworkAdapterType_Virtio:    return QApplication::translate("UICommon", "Paravirtualized Network (virtio-net)", "NetworkAdapterType");
    366366#endif /* VBOX_WITH_VIRTIO */
     367        case KNetworkAdapterType_Virtio_1_0: return QApplication::translate("UICommon", "Paravirtualized Network (virtio-net-1-dot-0)", "NetworkAdapterType");
    367368        case KNetworkAdapterType_Am79C960:  return QApplication::translate("UICommon", "PCnet-ISA (Am79C960)", "NetworkAdapterType");
    368369        default: AssertMsgFailed(("No text for %d", type)); break;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r82568 r82681  
    696696            ++iAdapterTypeIndex;
    697697        }
     698#ifdef VBOX_WITH_VIRTIO_1_0
     699        m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, gpConverter->toString(KNetworkAdapterType_Virtio_1_0));
     700        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Virtio_1_0);
     701        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole);
     702        ++iAdapterTypeIndex;
     703#endif /* VBOX_WITH_VIRTIO_1_0 */
    698704
    699705        /* Choose requested adapter type: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r82570 r82681  
    841841                }
    842842                /* Pass editor back: */
     843#ifdef VBOX_WITH_VIRTIO_NET_1_0
     844                pComboBox->addItem(gpConverter->toString(KNetworkAdapterType_Virtio_1_0), KNetworkAdapterType_Virtio_1_0);
     845#endif /* VBOX_WITH_VIRTIO */
    843846                pEditor = pComboBox;
    844847                break;
  • trunk/src/VBox/Main/Makefile.kmk

    r82502 r82681  
    145145ifdef VBOX_WITH_VIRTIO
    146146VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO
     147endif
     148ifdef VBOX_WITH_VIRTIO_1_0
     149VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO_1_0
     150endif
     151ifdef VBOX_WITH_VIRTIO_NET_1_0
     152VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO_NET_1_0
    147153endif
    148154ifdef VBOX_WITH_VMSVGA
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r82619 r82681  
    1955319553        <desc>AMD PCnet-ISA/NE2100 network card (Am79C960).</desc>
    1955419554    </const>
     19555    <const name="Virtio_1_0"            value="8">
     19556        <desc>Virtio 1.0 network device.</desc>
     19557    </const>
    1955519558  </enum>
    1955619559
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r82502 r82681  
    15251525            return "virtio-net";
    15261526#endif
     1527#ifdef VBOX_WITH_VIRTIO_NET_1_0
     1528        case NetworkAdapterType_Virtio_1_0:
     1529            return "virtio-net-1-dot-0";
     1530#endif
    15271531        default:
    15281532            AssertFailed();
     
    42154219            notifyNatDnsChange(ptrVM.rawUVM(), "e1000", ulInstanceMax);
    42164220            notifyNatDnsChange(ptrVM.rawUVM(), "virtio-net", ulInstanceMax);
     4221            notifyNatDnsChange(ptrVM.rawUVM(), "virtio-net-1-dot-0", ulInstanceMax);
    42174222        }
    42184223    }
     
    48934898    AssertMsg(   (   !strcmp(pszDevice, "pcnet")
    48944899                  || !strcmp(pszDevice, "e1000")
    4895                   || !strcmp(pszDevice, "virtio-net"))
     4900                  || !strcmp(pszDevice, "virtio-net")
     4901                  || !strcmp(pszDevice, "virtio-net-1-dot-0"))
    48964902              && uLun == 0
    48974903              && uInstance < maxNetworkAdapters,
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r82502 r82681  
    24812481        InsertConfigNode(pDevices, "virtio-net", &pDevVirtioNet);
    24822482#endif /* VBOX_WITH_VIRTIO */
     2483#ifdef VBOX_WITH_VIRTIO_NET_1_0
     2484        PCFGMNODE pDevVirtioNet1_0 = NULL;          /* Virtio network devices */
     2485        InsertConfigNode(pDevices, "virtio-net-1-dot-0", &pDevVirtioNet1_0);
     2486#endif /* VBOX_WITH_VIRTIO_NET_1_0 */
    24832487        std::list<BootNic> llBootNics;
    24842488        for (ULONG uInstance = 0; uInstance < maxNetworkAdapters; ++uInstance)
     
    25182522                    break;
    25192523#endif /* VBOX_WITH_VIRTIO */
     2524#ifdef VBOX_WITH_VIRTIO_NET_1_0
     2525                case NetworkAdapterType_Virtio_1_0:
     2526                    pDev = pDevVirtioNet1_0;
     2527                    pszAdapterName = "virtio-net-1-dot-0";
     2528                    break;
     2529#endif /* VBOX_WITH_VIRTIO_NET_1_0 */
    25202530                default:
    25212531                    AssertMsgFailed(("Invalid network adapter type '%d' for slot '%d'", adapterType, uInstance));
     
    26042614                    break;
    26052615                case NetworkAdapterType_Virtio:
     2616                    break;
     2617                case NetworkAdapterType_Virtio_1_0:
    26062618                    break;
    26072619                case NetworkAdapterType_Null:      AssertFailedBreak(); /* (compiler warnings) */
  • trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp

    r81603 r82681  
    245245#ifdef VBOX_WITH_VIRTIO
    246246        case NetworkAdapterType_Virtio:
     247#endif
     248#ifdef VBOX_WITH_VIRTIO_NET_1_0
     249        case NetworkAdapterType_Virtio_1_0:
    247250#endif /* VBOX_WITH_VIRTIO */
    248251            break;
  • trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp

    r82569 r82681  
    14531453        NetworkAdapterType_I82545EM,
    14541454        NetworkAdapterType_Virtio,
     1455        NetworkAdapterType_Virtio_1_0,
     1456        NetworkAdapterType_Am79C960,
    14551457    };
    14561458    aSupportedNetworkAdapterTypes.assign(aNetworkAdapterTypes,
  • trunk/src/VBox/Main/xml/Settings.cpp

    r81964 r82681  
    39133913            else if (strTemp == "virtio")
    39143914                nic.type = NetworkAdapterType_Virtio;
     3915            else if (strTemp == "virtio_1.0")
     3916                nic.type = NetworkAdapterType_Virtio_1_0;
    39153917            else
    39163918                throw ConfigFileError(this, pelmAdapter, N_("Invalid value '%s' in Adapter/@type attribute"), strTemp.c_str());
     
    65236525                        case NetworkAdapterType_I82545EM:   pcszType = "82545EM"; break;
    65246526                        case NetworkAdapterType_Virtio:     pcszType = "virtio"; break;
     6527                        case NetworkAdapterType_Virtio_1_0: pcszType = "virtio_1.0"; break;
    65256528                        default: /*case NetworkAdapterType_Am79C970A:*/  pcszType = "Am79C970A"; break;
    65266529                    }
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