xref: /dpdk/dts/framework/testbed_model/virtual_device.py (revision 3e967643bc51c87928453e4b718a9e09d731cb21)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2023 PANTHEON.tech s.r.o.
3
4"""Virtual devices model.
5
6Alongside support for physical hardware, DPDK can create various virtual devices.
7"""
8
9
10class VirtualDevice:
11    """Base class for virtual devices used by DPDK.
12
13    Attributes:
14        name: The name of the virtual device.
15    """
16
17    name: str
18
19    def __init__(self, name: str):
20        """Initialize the virtual device.
21
22        Args:
23            name: The name of the virtual device.
24        """
25        self.name = name
26
27    def __str__(self) -> str:
28        """This corresponds to the name used for DPDK devices."""
29        return self.name
30