Lines Matching +full:a +full:- +full:9

12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * You should have received a copy of the GNU Lesser General Public
20 * Not so fast! You might want to read the 9p developer docs first:
21 * https://wiki.qemu.org/Documentation/9p
27 #include "standard-headers/linux/virtio_ids.h"
28 #include "virtio-9p.h"
35 static char *concat_path(const char* a, const char* b) in concat_path() argument
37 return g_build_filename(a, b, NULL); in concat_path()
49 char *template = concat_path(pwd, "qtest-9p-local-XXXXXX"); in virtio_9p_create_local_test_dir()
60 /* ... and is actually a directory */ in virtio_9p_create_local_test_dir()
67 g_autofree char *cmd = g_strdup_printf("rm -fr '%s'\n", local_test_path); in virtio_9p_remove_local_test_dir()
84 qvirtqueue_cleanup(interface->vdev->bus, interface->vq, alloc); in virtio_9p_cleanup()
91 features = qvirtio_get_features(interface->vdev); in virtio_9p_setup()
93 qvirtio_set_features(interface->vdev, features); in virtio_9p_setup()
95 interface->vq = qvirtqueue_setup(interface->vdev, alloc, 0); in virtio_9p_setup()
96 qvirtio_set_driver_ok(interface->vdev); in virtio_9p_setup()
99 /* virtio-9p-device */
103 QVirtio9P *v9p = &v_9p->v9p; in virtio_9p_device_destructor()
111 QVirtio9P *v9p = &v_9p->v9p; in virtio_9p_device_start_hw()
119 if (!g_strcmp0(interface, "virtio-9p")) { in virtio_9p_get_driver()
123 return v_9p->vdev; in virtio_9p_get_driver()
126 fprintf(stderr, "%s not present in virtio-9p-device\n", interface); in virtio_9p_get_driver()
133 return virtio_9p_get_driver(&v_9p->v9p, interface); in virtio_9p_device_get_driver()
141 QVirtio9P *interface = &virtio_device->v9p; in virtio_9p_device_create()
143 interface->vdev = virtio_dev; in virtio_9p_device_create()
146 virtio_device->obj.destructor = virtio_9p_device_destructor; in virtio_9p_device_create()
147 virtio_device->obj.get_driver = virtio_9p_device_get_driver; in virtio_9p_device_create()
148 virtio_device->obj.start_hw = virtio_9p_device_start_hw; in virtio_9p_device_create()
150 return &virtio_device->obj; in virtio_9p_device_create()
153 /* virtio-9p-pci */
157 QVirtio9P *interface = &v9_pci->v9p; in virtio_9p_pci_destructor()
158 QOSGraphObject *pci_vobj = &v9_pci->pci_vdev.obj; in virtio_9p_pci_destructor()
167 QVirtio9P *interface = &v9_pci->v9p; in virtio_9p_pci_start_hw()
168 QOSGraphObject *pci_vobj = &v9_pci->pci_vdev.obj; in virtio_9p_pci_start_hw()
177 if (!g_strcmp0(interface, "pci-device")) { in virtio_9p_pci_get_driver()
178 return v_9p->pci_vdev.pdev; in virtio_9p_pci_get_driver()
180 return virtio_9p_get_driver(&v_9p->v9p, interface); in virtio_9p_pci_get_driver()
187 QVirtio9P *interface = &v9_pci->v9p; in virtio_9p_pci_create()
188 QOSGraphObject *obj = &v9_pci->pci_vdev.obj; in virtio_9p_pci_create()
190 virtio_pci_init(&v9_pci->pci_vdev, pci_bus, addr); in virtio_9p_pci_create()
191 interface->vdev = &v9_pci->pci_vdev.vdev; in virtio_9p_pci_create()
194 g_assert_cmphex(interface->vdev->device_type, ==, VIRTIO_ID_9P); in virtio_9p_pci_create()
196 obj->destructor = virtio_9p_pci_destructor; in virtio_9p_pci_create()
197 obj->start_hw = virtio_9p_pci_start_hw; in virtio_9p_pci_create()
198 obj->get_driver = virtio_9p_pci_get_driver; in virtio_9p_pci_create()
204 * Performs regular expression based search and replace on @a haystack.
206 * @param haystack - input string to be parsed, result of replacement is
207 * stored back to @a haystack
208 * @param pattern - the regular expression pattern for scanning @a haystack
209 * @param replace_fmt - matches of supplied @a pattern are replaced by this,
227 s = g_regex_replace(regex, haystack->str, -1, 0, replace, 0, NULL); in regex_replace()
236 regex_replace(cmd_line, "-fsdev synth,", "-fsdev local,"); in virtio_9p_assign_local_driver()
238 /* append 'path=...' to '-fsdev ...' group */ in virtio_9p_assign_local_driver()
239 regex_replace(cmd_line, "(-fsdev \\w[^ ]*)", "\\1,path='%s'", in virtio_9p_assign_local_driver()
246 /* append passed args to '-fsdev ...' group */ in virtio_9p_assign_local_driver()
247 regex_replace(cmd_line, "(-fsdev \\w[^ ]*)", "\\1,%s", args); in virtio_9p_assign_local_driver()
260 .before_cmd_line = "-fsdev synth,id=fsdev0", in virtio_9p_register_nodes()
263 /* virtio-9p-device */ in virtio_9p_register_nodes()
265 qos_node_create_driver("virtio-9p-device", virtio_9p_device_create); in virtio_9p_register_nodes()
266 qos_node_consumes("virtio-9p-device", "virtio-bus", &opts); in virtio_9p_register_nodes()
267 qos_node_produces("virtio-9p-device", "virtio"); in virtio_9p_register_nodes()
268 qos_node_produces("virtio-9p-device", "virtio-9p"); in virtio_9p_register_nodes()
270 /* virtio-9p-pci */ in virtio_9p_register_nodes()
273 qos_node_create_driver("virtio-9p-pci", virtio_9p_pci_create); in virtio_9p_register_nodes()
274 qos_node_consumes("virtio-9p-pci", "pci-bus", &opts); in virtio_9p_register_nodes()
275 qos_node_produces("virtio-9p-pci", "pci-device"); in virtio_9p_register_nodes()
276 qos_node_produces("virtio-9p-pci", "virtio"); in virtio_9p_register_nodes()
277 qos_node_produces("virtio-9p-pci", "virtio-9p"); in virtio_9p_register_nodes()