VirtualBox

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


Ignore:
Timestamp:
Aug 15, 2019 7:48:27 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132766
Message:

Storage/DevVirtioSCSI.cpp: Some cleanup of r132764

File:
1 edited

Legend:

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

    r80306 r80308  
    8383 * of req queues is variable and determined by virtio_scsi_config.num_queues. See VirtIO 1.0 spec section 5.6.4
    8484 */
    85 #define VIRTIOSCSI_VIRTQ_CONTROLQ                   0            /* Index of control queue                            */
    86 #define VIRTIOSCSI_VIRTQ_EVENTQ                     1            /* Index of event queue                              */
     85#define VIRTIOSCSI_CONTROLQ_IDX                     0            /* Index of control queue                            */
     86#define VIRTIOSCSI_EVENTQ_IDX                       1            /* Index of event queue                              */
    8787#define VIRTIOSCSI_VIRTQ_REQ_BASE                   2            /* Base index of req queues                          */
    8888
     89#define REQ_NBR_TO_QIDX(uReqQueueNum) (VIRTIOSCSI_VIRTQ_REQ_BASE + uReqQueueNum)
     90#define REQ_QIDX_TO_NBR(qIdx)         (qIdx - VIRTIOSCSI_VIRTQ_REQ_BASE)
    8991/**
    9092 * The following struct is the VirtIO SCSI Host Device device-specific configuration described in section 5.6.4
     
    539541
    540542
    541 /**
    542  * Get this callback from the virtio framework when the driver is ready so we know
    543  * the request for the number of queues is valid (for now presuming the driver(s) aren't
    544  * dynamically adding req queues but create them all while initializing
    545  * based on config information on host).
    546  */
    547543static DECLCALLBACK(void) virtioScsiStatusChanged(VIRTIOHANDLE hVirtio, bool fVirtioReady)
    548544{
     
    553549    {
    554550        Log2Func(("VirtIO reports ready... Initializing queues\n"));
    555         virtioQueueAttach(hVirtio, VIRTIOSCSI_VIRTQ_CONTROLQ, "controlq");
    556         virtioQueueAttach(hVirtio, VIRTIOSCSI_VIRTQ_EVENTQ,   "eventq");
     551        virtioQueueAttach(hVirtio, VIRTIOSCSI_CONTROLQ_IDX, "controlq");
     552        virtioQueueAttach(hVirtio, VIRTIOSCSI_EVENTQ_IDX,   "eventq");
    557553        for (uint16_t qIdx = VIRTIOSCSI_VIRTQ_REQ_BASE;
    558554                      qIdx < VIRTIOSCSI_VIRTQ_REQ_BASE + VIRTIOSCSI_REQ_QUEUE_CNT;
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