19d447257SEmanuele Giuseppe Esposito /* 29d447257SEmanuele Giuseppe Esposito * libqos driver framework 39d447257SEmanuele Giuseppe Esposito * 49d447257SEmanuele Giuseppe Esposito * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> 59d447257SEmanuele Giuseppe Esposito * 69d447257SEmanuele Giuseppe Esposito * This library is free software; you can redistribute it and/or 79d447257SEmanuele Giuseppe Esposito * modify it under the terms of the GNU Lesser General Public 8dc0ad02dSThomas Huth * License version 2.1 as published by the Free Software Foundation. 99d447257SEmanuele Giuseppe Esposito * 109d447257SEmanuele Giuseppe Esposito * This library is distributed in the hope that it will be useful, 119d447257SEmanuele Giuseppe Esposito * but WITHOUT ANY WARRANTY; without even the implied warranty of 129d447257SEmanuele Giuseppe Esposito * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 139d447257SEmanuele Giuseppe Esposito * Lesser General Public License for more details. 149d447257SEmanuele Giuseppe Esposito * 159d447257SEmanuele Giuseppe Esposito * You should have received a copy of the GNU Lesser General Public 169d447257SEmanuele Giuseppe Esposito * License along with this library; if not, see <http://www.gnu.org/licenses/> 179d447257SEmanuele Giuseppe Esposito */ 189d447257SEmanuele Giuseppe Esposito 19f91005e1SMarkus Armbruster #ifndef TESTS_LIBQOS_VIRTIO_9P_H 20f91005e1SMarkus Armbruster #define TESTS_LIBQOS_VIRTIO_9P_H 21f91005e1SMarkus Armbruster 22a2ce7dbdSPaolo Bonzini #include "qgraph.h" 23a2ce7dbdSPaolo Bonzini #include "virtio.h" 24a2ce7dbdSPaolo Bonzini #include "virtio-pci.h" 259d447257SEmanuele Giuseppe Esposito 269d447257SEmanuele Giuseppe Esposito typedef struct QVirtio9P QVirtio9P; 279d447257SEmanuele Giuseppe Esposito typedef struct QVirtio9PPCI QVirtio9PPCI; 289d447257SEmanuele Giuseppe Esposito typedef struct QVirtio9PDevice QVirtio9PDevice; 299d447257SEmanuele Giuseppe Esposito 309d447257SEmanuele Giuseppe Esposito #define MOUNT_TAG "qtest" 319d447257SEmanuele Giuseppe Esposito 329d447257SEmanuele Giuseppe Esposito struct QVirtio9P { 339d447257SEmanuele Giuseppe Esposito QVirtioDevice *vdev; 349d447257SEmanuele Giuseppe Esposito QVirtQueue *vq; 359d447257SEmanuele Giuseppe Esposito }; 369d447257SEmanuele Giuseppe Esposito 379d447257SEmanuele Giuseppe Esposito struct QVirtio9PPCI { 389d447257SEmanuele Giuseppe Esposito QVirtioPCIDevice pci_vdev; 399d447257SEmanuele Giuseppe Esposito QVirtio9P v9p; 409d447257SEmanuele Giuseppe Esposito }; 419d447257SEmanuele Giuseppe Esposito 429d447257SEmanuele Giuseppe Esposito struct QVirtio9PDevice { 439d447257SEmanuele Giuseppe Esposito QOSGraphObject obj; 449d447257SEmanuele Giuseppe Esposito QVirtio9P v9p; 459d447257SEmanuele Giuseppe Esposito }; 46f91005e1SMarkus Armbruster 473a565c64SChristian Schoenebeck /** 48*8db193c4SChristian Schoenebeck * Creates the directory for the 9pfs 'local' filesystem driver to access. 49*8db193c4SChristian Schoenebeck */ 50*8db193c4SChristian Schoenebeck void virtio_9p_create_local_test_dir(void); 51*8db193c4SChristian Schoenebeck 52*8db193c4SChristian Schoenebeck /** 53*8db193c4SChristian Schoenebeck * Deletes directory previously created by virtio_9p_create_local_test_dir(). 54*8db193c4SChristian Schoenebeck */ 55*8db193c4SChristian Schoenebeck void virtio_9p_remove_local_test_dir(void); 56*8db193c4SChristian Schoenebeck 57*8db193c4SChristian Schoenebeck /** 583a565c64SChristian Schoenebeck * Prepares QEMU command line for 9pfs tests using the 'local' fs driver. 593a565c64SChristian Schoenebeck */ 603a565c64SChristian Schoenebeck void virtio_9p_assign_local_driver(GString *cmd_line, const char *args); 613a565c64SChristian Schoenebeck 62e55b178bSChristian Schoenebeck /** 63e55b178bSChristian Schoenebeck * Returns path on host to the passed guest path. Result must be freed. 64e55b178bSChristian Schoenebeck */ 65e55b178bSChristian Schoenebeck char *virtio_9p_test_path(const char *path); 66e55b178bSChristian Schoenebeck 67f91005e1SMarkus Armbruster #endif 68