File: virtual_device.py

package info (click to toggle)
dpdk 25.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 127,892 kB
  • sloc: ansic: 2,358,479; python: 16,426; sh: 4,474; makefile: 1,713; awk: 70
file content (29 lines) | stat: -rw-r--r-- 666 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2023 PANTHEON.tech s.r.o.

"""Virtual devices model.

Alongside support for physical hardware, DPDK can create various virtual devices.
"""


class VirtualDevice:
    """Base class for virtual devices used by DPDK.

    Attributes:
        name: The name of the virtual device.
    """

    name: str

    def __init__(self, name: str) -> None:
        """Initialize the virtual device.

        Args:
            name: The name of the virtual device.
        """
        self.name = name

    def __str__(self) -> str:
        """This corresponds to the name used for DPDK devices."""
        return self.name