VirtualBox

Changeset 91310 in vbox


Ignore:
Timestamp:
Sep 20, 2021 11:05:45 AM (3 years ago)
Author:
vboxsync
Message:

include/VBox/vmm/pdmifs.h: A simple VFS interface for devices/drivers to store state data in a centralized place, bugref:10075

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmifs.h

    r90691 r91310  
    22542254#define PDMIPCIRAWCONNECTOR_IID                 "14aa9c6c-8869-4782-9dfc-910071a6aebf"
    22552255
     2256
     2257/** Pointer to a VFS connector interface. */
     2258typedef struct PDMIVFSCONNECTOR *PPDMIVFSCONNECTOR;
     2259/**
     2260 * VFS connector interface (up).
     2261 */
     2262typedef struct PDMIVFSCONNECTOR
     2263{
     2264    /**
     2265     * Queries the size of the given path.
     2266     *
     2267     * @returns VBox status code.
     2268     * @retval  VERR_NOT_FOUND if the path is not available.
     2269     * @param   pInterface          Pointer to this interface.
     2270     * @param   pszNamespace        The namespace for the path (usually driver/device name) or NULL for default namespace.
     2271     * @param   pszPath             The path to query the size for.
     2272     * @param   pcb                 Where to store the size of the path in bytes on success.
     2273     */
     2274    DECLR3CALLBACKMEMBER(int, pfnQuerySize, (PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
     2275                                             uint64_t *pcb));
     2276
     2277    /**
     2278     * Reads everything from the given path and stores the data into the supplied buffer.
     2279     *
     2280     * @returns VBox status code.
     2281     * @retval  VERR_NOT_FOUND if the path is not available.
     2282     * @retval  VERR_BUFFER_OVERFLOW if the supplied buffer is too small to read everything.
     2283     * @retval  VINF_BUFFER_UNDERFLOW if the supplied buffer is too large.
     2284     * @param   pInterface          Pointer to this interface.
     2285     * @param   pszNamespace        The namespace for the path (usually driver/device name) or NULL for default namespace.
     2286     * @param   pszPath             The path to read everything for.
     2287     * @param   pvBuf               Where to store the data.
     2288     * @param   cbRead              How much to read.
     2289     */
     2290    DECLR3CALLBACKMEMBER(int, pfnReadAll, (PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
     2291                                           void *pvBuf, size_t cbRead));
     2292
     2293    /**
     2294     * Writes the supplied data to the given path, overwriting any previously existing data.
     2295     *
     2296     * @returns VBox status code.
     2297     * @param   pInterface          Pointer to this interface.
     2298     * @param   pszNamespace        The namespace for the path (usually driver/device name) or NULL for default namespace.
     2299     * @param   pszPath             The path to write everything to.
     2300     * @param   pvBuf               The data to store.
     2301     * @param   cbWrite             How many bytes to write.
     2302     */
     2303    DECLR3CALLBACKMEMBER(int, pfnWriteAll, (PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
     2304                                            const void *pvBuf, size_t cbWrite));
     2305
     2306    /** @todo Add standard open/read/write/close callbacks when the need arises. */
     2307
     2308} PDMIVFSCONNECTOR;
     2309/** PDMIVFSCONNECTOR interface ID. */
     2310#define PDMIVFSCONNECTOR_IID               "a1fc51e0-414a-4e78-8388-8053b9dc6521"
     2311
    22562312/** @} */
    22572313
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