summaryrefslogtreecommitdiffstats
path: root/tests/libqos/virtio-9p.h
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito2018-07-20 15:41:46 +0200
committerPaolo Bonzini2019-03-07 17:28:27 +0100
commit9d44725793700112b5a0ff71f64f7059f0a4b6c9 (patch)
tree03e34803dc1cdbc96a6b7fdf09bc8a04c1d3618f /tests/libqos/virtio-9p.h
parentqos-test: virtio-console and virtio-serial test node (diff)
downloadqemu-9d44725793700112b5a0ff71f64f7059f0a4b6c9.tar.gz
qemu-9d44725793700112b5a0ff71f64f7059f0a4b6c9.tar.xz
qemu-9d44725793700112b5a0ff71f64f7059f0a4b6c9.zip
tests/libqos: virtio-9p driver and interface nodes
Add qgraph nodes for virtio-9p-pci and virtio-9p-device. Both nodes produce virtio-9p, but virtio-9p-pci receives a pci-bus and overrides virtio-pci QOSGraphObject and its functions, while virtio-9p-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-9p.h')
-rw-r--r--tests/libqos/virtio-9p.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/libqos/virtio-9p.h b/tests/libqos/virtio-9p.h
new file mode 100644
index 0000000000..dba22772b5
--- /dev/null
+++ b/tests/libqos/virtio-9p.h
@@ -0,0 +1,42 @@
+/*
+ * 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 QVirtio9P QVirtio9P;
+typedef struct QVirtio9PPCI QVirtio9PPCI;
+typedef struct QVirtio9PDevice QVirtio9PDevice;
+
+#define MOUNT_TAG "qtest"
+
+struct QVirtio9P {
+ QVirtioDevice *vdev;
+ QVirtQueue *vq;
+};
+
+struct QVirtio9PPCI {
+ QVirtioPCIDevice pci_vdev;
+ QVirtio9P v9p;
+};
+
+struct QVirtio9PDevice {
+ QOSGraphObject obj;
+ QVirtio9P v9p;
+};