master
h 73 lines 1.91 KB
Raw
1 /*
2 * libqos driver framework
3 *
4 * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1 as published by the Free Software Foundation.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>
17 */
18
19 #ifndef TESTS_LIBQOS_VIRTIO_9P_H
20 #define TESTS_LIBQOS_VIRTIO_9P_H
21
22 #include "qgraph.h"
23 #include "virtio.h"
24 #include "virtio-pci.h"
25
26 typedef struct QVirtio9P QVirtio9P;
27 typedef struct QVirtio9PPCI QVirtio9PPCI;
28 typedef struct QVirtio9PDevice QVirtio9PDevice;
29
30 #define MOUNT_TAG "qtest"
31
32 struct QVirtio9P {
33 QVirtioDevice *vdev;
34 QVirtQueue *vq;
35 };
36
37 struct QVirtio9PPCI {
38 QVirtioPCIDevice pci_vdev;
39 QVirtio9P v9p;
40 };
41
42 struct QVirtio9PDevice {
43 QOSGraphObject obj;
44 QVirtio9P v9p;
45 };
46
47 /**
48 * Add required test specific args to the QEMU command line for the 9pfs
49 * 'synth' fs driver.
50 */
51 void virtio_9p_add_synth_driver_args(GString *cmd_line, const char *args);
52
53 /**
54 * Creates the directory for the 9pfs 'local' filesystem driver to access.
55 */
56 void virtio_9p_create_local_test_dir(void);
57
58 /**
59 * Deletes directory previously created by virtio_9p_create_local_test_dir().
60 */
61 void virtio_9p_remove_local_test_dir(void);
62
63 /**
64 * Prepares QEMU command line for 9pfs tests using the 'local' fs driver.
65 */
66 void virtio_9p_assign_local_driver(GString *cmd_line, const char *args);
67
68 /**
69 * Returns path on host to the passed guest path. Result must be freed.
70 */
71 char *virtio_9p_test_path(const char *path);
72
73 #endif