aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/virtio-net.h
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>2018-07-30 22:21:42 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-07 17:28:42 +0100
commit583349d1ef8b73968428b8443e39d74c43d127f9 (patch)
tree4386cfa198810175781d2ff404f39b72241f8682 /tests/libqos/virtio-net.h
parent5cb8f0db0a5eff0206376f2f344cf73fb7d2cf5f (diff)
downloadqemu-583349d1ef8b73968428b8443e39d74c43d127f9.zip
qemu-583349d1ef8b73968428b8443e39d74c43d127f9.tar.gz
qemu-583349d1ef8b73968428b8443e39d74c43d127f9.tar.bz2
tests/libqos: virtio-net driver and interface nodes
Add qgraph nodes for virtio-net-pci and virtio-net-device. Both nodes produce virtio-net, but virtio-net-pci receives a pci-bus and overrides virtio-pci QOSGraphObject and its functions, while virtio-net-device receives a virtio and implements its own functions Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/libqos/virtio-net.h')
-rw-r--r--tests/libqos/virtio-net.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/libqos/virtio-net.h b/tests/libqos/virtio-net.h
new file mode 100644
index 0000000..e6905cd
--- /dev/null
+++ b/tests/libqos/virtio-net.h
@@ -0,0 +1,41 @@
+/*
+ * libqos driver framework
+ *
+ * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "libqos/qgraph.h"
+#include "libqos/virtio.h"
+#include "libqos/virtio-pci.h"
+
+typedef struct QVirtioNet QVirtioNet;
+typedef struct QVirtioNetPCI QVirtioNetPCI;
+typedef struct QVirtioNetDevice QVirtioNetDevice;
+
+struct QVirtioNet {
+ QVirtioDevice *vdev;
+ QVirtQueue *rx;
+ QVirtQueue *tx;
+};
+
+struct QVirtioNetPCI {
+ QVirtioPCIDevice pci_vdev;
+ QVirtioNet net;
+};
+
+struct QVirtioNetDevice {
+ QOSGraphObject obj;
+ QVirtioNet net;
+};