Lines Matching full:fs

24 #include "hw/virtio/vhost-user-fs.h"
43 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_get_config() local
46 memcpy((char *)fscfg.tag, fs->conf.tag, in vuf_get_config()
47 MIN(strlen(fs->conf.tag) + 1, sizeof(fscfg.tag))); in vuf_get_config()
49 virtio_stl_p(vdev, &fscfg.num_request_queues, fs->conf.num_request_queues); in vuf_get_config()
56 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_start() local
67 ret = vhost_dev_enable_notifiers(&fs->vhost_dev, vdev); in vuf_start()
73 ret = k->set_guest_notifiers(qbus->parent, fs->vhost_dev.nvqs, true); in vuf_start()
79 fs->vhost_dev.acked_features = vdev->guest_features; in vuf_start()
80 ret = vhost_dev_start(&fs->vhost_dev, vdev, true); in vuf_start()
91 for (i = 0; i < fs->vhost_dev.nvqs; i++) { in vuf_start()
92 vhost_virtqueue_mask(&fs->vhost_dev, vdev, i, false); in vuf_start()
98 k->set_guest_notifiers(qbus->parent, fs->vhost_dev.nvqs, false); in vuf_start()
100 vhost_dev_disable_notifiers(&fs->vhost_dev, vdev); in vuf_start()
105 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_stop() local
114 vhost_dev_stop(&fs->vhost_dev, vdev, true); in vuf_stop()
116 ret = k->set_guest_notifiers(qbus->parent, fs->vhost_dev.nvqs, false); in vuf_stop()
122 vhost_dev_disable_notifiers(&fs->vhost_dev, vdev); in vuf_stop()
127 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_set_status() local
130 if (vhost_dev_is_started(&fs->vhost_dev) == should_start) { in vuf_set_status()
145 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_get_features() local
147 return vhost_get_features(&fs->vhost_dev, user_feature_bits, features); in vuf_get_features()
161 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_guest_notifier_mask() local
172 vhost_virtqueue_mask(&fs->vhost_dev, vdev, idx, mask); in vuf_guest_notifier_mask()
177 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_guest_notifier_pending() local
188 return vhost_virtqueue_pending(&fs->vhost_dev, idx); in vuf_guest_notifier_pending()
194 VHostUserFS *fs = VHOST_USER_FS(dev); in vuf_device_realize() local
199 if (!fs->conf.chardev.chr) { in vuf_device_realize()
204 if (!fs->conf.tag) { in vuf_device_realize()
208 len = strlen(fs->conf.tag); in vuf_device_realize()
219 if (fs->conf.num_request_queues == 0) { in vuf_device_realize()
224 if (!is_power_of_2(fs->conf.queue_size)) { in vuf_device_realize()
229 if (fs->conf.queue_size > VIRTQUEUE_MAX_SIZE) { in vuf_device_realize()
235 if (!vhost_user_init(&fs->vhost_user, &fs->conf.chardev, errp)) { in vuf_device_realize()
242 fs->hiprio_vq = virtio_add_queue(vdev, fs->conf.queue_size, vuf_handle_output); in vuf_device_realize()
245 fs->req_vqs = g_new(VirtQueue *, fs->conf.num_request_queues); in vuf_device_realize()
246 for (i = 0; i < fs->conf.num_request_queues; i++) { in vuf_device_realize()
247 fs->req_vqs[i] = virtio_add_queue(vdev, fs->conf.queue_size, vuf_handle_output); in vuf_device_realize()
251 fs->vhost_dev.nvqs = 1 + fs->conf.num_request_queues; in vuf_device_realize()
252 fs->vhost_dev.vqs = g_new0(struct vhost_virtqueue, fs->vhost_dev.nvqs); in vuf_device_realize()
253 ret = vhost_dev_init(&fs->vhost_dev, &fs->vhost_user, in vuf_device_realize()
262 vhost_user_cleanup(&fs->vhost_user); in vuf_device_realize()
263 virtio_delete_queue(fs->hiprio_vq); in vuf_device_realize()
264 for (i = 0; i < fs->conf.num_request_queues; i++) { in vuf_device_realize()
265 virtio_delete_queue(fs->req_vqs[i]); in vuf_device_realize()
267 g_free(fs->req_vqs); in vuf_device_realize()
269 g_free(fs->vhost_dev.vqs); in vuf_device_realize()
276 VHostUserFS *fs = VHOST_USER_FS(dev); in vuf_device_unrealize() local
277 struct vhost_virtqueue *vhost_vqs = fs->vhost_dev.vqs; in vuf_device_unrealize()
283 vhost_dev_cleanup(&fs->vhost_dev); in vuf_device_unrealize()
285 vhost_user_cleanup(&fs->vhost_user); in vuf_device_unrealize()
287 virtio_delete_queue(fs->hiprio_vq); in vuf_device_unrealize()
288 for (i = 0; i < fs->conf.num_request_queues; i++) { in vuf_device_unrealize()
289 virtio_delete_queue(fs->req_vqs[i]); in vuf_device_unrealize()
291 g_free(fs->req_vqs); in vuf_device_unrealize()
298 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_get_vhost() local
299 return &fs->vhost_dev; in vuf_get_vhost()
309 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_save_state() local
313 ret = vhost_save_backend_state(&fs->vhost_dev, f, &local_error); in vuf_save_state()
319 fs->conf.tag ?: "<none>"); in vuf_save_state()
333 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_load_state() local
337 ret = vhost_load_backend_state(&fs->vhost_dev, f, &local_error); in vuf_load_state()
343 fs->conf.tag ?: "<none>"); in vuf_load_state()
359 VHostUserFS *fs = VHOST_USER_FS(vdev); in vuf_check_migration_support() local
361 if (!vhost_supports_device_state(&fs->vhost_dev)) { in vuf_check_migration_support()
365 fs->conf.tag ?: "<none>"); in vuf_check_migration_support()
375 .name = "vhost-user-fs",
388 .name = "vhost-user-fs-backend",
397 .name = "virtio-fs back-end state",
417 VHostUserFS *fs = VHOST_USER_FS(obj); in vuf_instance_init() local
419 device_add_bootindex_property(obj, &fs->bootindex, "bootindex", in vuf_instance_init()