VirtualBox

Changeset 79973 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Jul 25, 2019 8:10:25 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132404
Message:

Just checking in changes. Working out new interface between Virtio_1.0.cpp and its clients. Currently crashing in DrvSCSI construct (that was working when it was all contained in DevVirtioScsi). Next thing to troubleshoot.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp

    r79929 r79973  
    5555typedef struct VIRTIOSCSITARGET
    5656{
    57 
    58 
    59     /** Pointer to the owning virtioScsi device instance. - R3 pointer */
     57    /** Pointer to PCI device that owns this target instance. - R3 /pointer */
    6058    R3PTRTYPE(struct VIRTIOSCSI *)  pVirtioScsiR3;
    61     /** Pointer to the owning virtioScsi device instance. - R0 pointer */
     59    /** Pointer to PCI device that owns this target instance. - R0 pointer */
    6260    R3PTRTYPE(struct VIRTIOSCSI *)  pVirtioScsiR0;
    63     /** Pointer to the owning virtioScsi device instance. - RC pointer */
     61    /** Pointer to PCI device that owns this target instance. - RC pointer */
    6462    R3PTRTYPE(struct VIRTIOSCSI *)  pVirtioScsiRC;
    6563
     
    108106typedef struct VIRTIOSCSI
    109107{
     108    /* virtioState must be first member */
     109    VIRTIOSTATE                     virtioState;
     110
     111    /* SCSI target instances data */
     112    VIRTIOSCSITARGET                aTargetInstances[VIRTIOSCSI_MAX_TARGETS];
    110113
    111114    PPDMDEVINSR3           pDevInsR3;              /**< Device instance - R3. */
    112115    PPDMDEVINSR0           pDevInsR0;              /**< Device instance - R0. */
    113116    PPDMDEVINSRC           pDevInsRC;              /**< Device instance - RC. */
    114 
    115     /* virtioState must be first member */
    116     VIRTIOSTATE                     virtioState;
    117 
    118     /* SCSI target instances data */
    119     VIRTIOSCSITARGET                aTargetInstances[VIRTIOSCSI_MAX_TARGETS];
    120 
    121     /** Base address of the I/O ports. */
    122     RTIOPORT                        IOPortBase;
    123117
    124118    /** Base address of the memory mapping. */
     
    766760    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAPORT, &pTarget->IMediaPort);
    767761    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAEXPORT, &pTarget->IMediaExPort);
     762
     763    /* This call back is necessary to get Status / LED support */
     764    return virtioQueryInterface(pInterface, pszIID);
     765
    768766    return NULL;
    769767}
     
    867865    pVirtioPciParams->uInterruptPin  = 0x01;
    868866
    869 
    870     PVIRTIOSTATE pVirtioScsi = &(pThis->virtioState);
    871     rc = virtioConstruct(pDevIns, pVirtioScsi, iInstance, pVirtioPciParams,
     867    PVIRTIOSTATE pVirtio = &(pThis->virtioState);
     868    pDevIns->IBase.pfnQueryInterface = virtioScsiR3DeviceQueryInterface;
     869
     870    rc = virtioConstruct(pDevIns, pVirtio, iInstance, pVirtioPciParams,
    872871                         VIRTIO_SCSI_NAME_FMT, VIRTIO_SCSI_N_QUEUES, VIRTIO_SCSI_REGION_PCI_CAP,
    873                          virtioScsiR3DevCapRead, virtioScsiR3DevCapWrite, sizeof(VIRTIODEVCFG));
     872                         virtioScsiR3DevCapRead, virtioScsiR3DevCapWrite, sizeof(VIRTIODEVCAP));
    874873    if (RT_FAILURE(rc))
    875874        return PDMDEV_SET_ERROR(pDevIns, rc, N_("virtio-scsi: failed to initialize VirtIO"));
    876875
    877     rc = PDMDevHlpPCIIORegionRegister(pDevIns, VIRTIO_SCSI_REGION_PORT_IO, 32,
     876    rc = PDMDevHlpPCIIORegionRegister(pDevIns, VIRTIO_SCSI_REGION_MEM_IO, 32,
    878877                                      PCI_ADDRESS_SPACE_MEM, virtioScsiR3Map);
    879878    if (RT_FAILURE(rc))
     
    904903        PVIRTIOSCSITARGET pTarget = &pThis->aTargetInstances[iLUN];
    905904
    906         if (RTStrAPrintf(&pTarget->pszLunName, "VSCSI%u", iLUN) < 0)
     905        if (RTStrAPrintf(&pTarget->pszLunName, "VIRTIOSCSI%u", iLUN) < 0)
    907906            AssertLogRelFailedReturn(VERR_NO_MEMORY);
    908907
     
    919918        pTarget->IMediaExPort.pfnIoReqQueryBuf           = NULL;
    920919        pTarget->IMediaExPort.pfnIoReqQueryDiscardRanges = NULL;
    921         pDevIns->IBase.pfnQueryInterface                 = virtioScsiR3DeviceQueryInterface;
    922920
    923921        LogFunc(("Attaching LUN: %s\n", pTarget->pszLunName));
     
    986984    "virtio-scsi",
    987985    /* szRCMod */
    988     "",
     986    "VBoxDDRC.rc",
    989987    /* szR0Mod */
    990     "",
     988    "VBoxDDR0.r0",
    991989    /* pszDescription */
    992     "Virtio SCSI.\n",
     990    "Virtio Host SCSI.\n",
    993991    /* fFlags */
    994992#ifdef VIRTIOSCSI_GC_SUPPORT
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