VirtualBox

Changeset 80657 in vbox for trunk/src/VBox/Devices/VirtIO


Ignore:
Timestamp:
Sep 9, 2019 7:14:32 AM (5 years ago)
Author:
vboxsync
Message:

Storage/DevVirtioScsi.cpp: Start to implement suspend/resume/reset/power on and power off handling. Compiles and code still does SCSI stuff, but the code is untested and unfinished. Posted questions to bugref:9440, Comment #83

Location:
trunk/src/VBox/Devices/VirtIO
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp

    r80647 r80657  
    6464const char *virtioQueueGetName(VIRTIOHANDLE hVirtio, uint16_t qIdx)
    6565{
    66     PVIRTIOSTATE pVirtio = (PVIRTIOSTATE)hVirtio;
    67     AssertMsgReturn(DRIVER_OK(pVirtio) && pVirtio->uQueueEnable[qIdx],
    68                     ("Guest driver not in ready state.\n"), "<null>");
    69 
    7066    return (const char *)((PVIRTIOSTATE)hVirtio)->virtqProxy[qIdx].szVirtqName;
    7167}
     
    9389}
    9490
    95 
    9691/**
    9792 * See API comments in header file for description
     
    10297    return pVirtio->uDriverFeatures;
    10398}
    104 
    10599
    106100/**
     
    227221    PVIRTQ_DESC_CHAIN_T pDescChain = pVirtqProxy->pDescChain;
    228222
    229     AssertMsgReturn(DRIVER_OK(pVirtio) && pVirtio->uQueueEnable[qIdx],
     223    AssertMsgReturn(DRIVER_OK(pVirtio) /*&& pVirtio->uQueueEnable[qIdx]*/,
    230224                    ("Guest driver not in ready state.\n"), VERR_INVALID_STATE);
    231225    /**
     
    451445    for (uint16_t qIdx = 0; qIdx < pVirtio->uNumQueues; qIdx++)
    452446        virtioResetQueue(pVirtio, qIdx);
     447}
     448
     449/**
     450 * See API comments in header file for description
     451 */
     452bool virtioIsQueueEnabled(VIRTIOHANDLE hVirtio, uint16_t qIdx)
     453{
     454    PVIRTIOSTATE pVirtio = (PVIRTIOSTATE)hVirtio;
     455    return pVirtio->uQueueEnable[qIdx];
     456}
     457
     458/**
     459 * See API comments in header file for description
     460 */
     461void virtioQueueEnable(VIRTIOHANDLE hVirtio, uint16_t qIdx, bool fEnabled)
     462{
     463    PVIRTIOSTATE pVirtio = (PVIRTIOSTATE)hVirtio;
     464    if (fEnabled)
     465        pVirtio->uQueueSize[qIdx] = VIRTQ_MAX_SIZE;
     466    else
     467        pVirtio->uQueueSize[qIdx] = 0;
    453468}
    454469
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.h

    r80639 r80657  
    265265
    266266/**
     267 * Return queue enable state
     268  *
     269 * @param hVirtio   - Handle for VirtIO framework
     270 * @param qIdx      - Queue number
     271 * @param fEnabled  - Flag indicating whether to enable queue or not
     272 */
     273bool virtioIsQueueEnabled(VIRTIOHANDLE hVirtio, uint16_t qIdx);
     274
     275/**
     276 * Enable or disable queue
     277 *
     278 * @param hVirtio   - Handle for VirtIO framework
     279 * @param qIdx      - Queue number
     280 * @param fEnabled  - Flag indicating whether to enable queue or not
     281 */
     282void virtioQueueEnable(VIRTIOHANDLE hVirtio, uint16_t qIdx, bool fEnabled);
     283
     284/**
    267285 * Request orderly teardown of VirtIO on host and guest
     286 * @param hVirtio   - Handle for VirtIO framework
     287 *
    268288 */
    269289void virtioResetAll(VIRTIOHANDLE hVirtio);
     290
     291
    270292
    271293/** CLIENT MUST CALL ON RELOCATE CALLBACK! */
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