g_free(s->tag);
}
+typedef struct VirtfsCoResetData {
+ V9fsPDU pdu;
+ bool done;
+} VirtfsCoResetData;
+
+static void coroutine_fn virtfs_co_reset(void *opaque)
+{
+ VirtfsCoResetData *data = opaque;
+
+ virtfs_reset(&data->pdu);
+ data->done = true;
+}
+
+void v9fs_reset(V9fsState *s)
+{
+ VirtfsCoResetData data = { .pdu = { .s = s }, .done = false };
+ Coroutine *co;
+
+ while (!QLIST_EMPTY(&s->active_list)) {
+ aio_poll(qemu_get_aio_context(), true);
+ }
+
+ co = qemu_coroutine_create(virtfs_co_reset, &data);
+ qemu_coroutine_enter(co);
+
+ while (!data.done) {
+ aio_poll(qemu_get_aio_context(), true);
+ }
+}
+
static void __attribute__((__constructor__)) v9fs_set_fd_limit(void)
{
struct rlimit rlim;
V9fsPDU *pdu_alloc(V9fsState *s);
void pdu_free(V9fsPDU *pdu);
void pdu_submit(V9fsPDU *pdu);
+void v9fs_reset(V9fsState *s);
#endif
v9fs_device_unrealize_common(s, errp);
}
+static void virtio_9p_reset(VirtIODevice *vdev)
+{
+ V9fsVirtioState *v = (V9fsVirtioState *)vdev;
+
+ v9fs_reset(&v->state);
+}
+
ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
const char *fmt, va_list ap)
{
vdc->unrealize = virtio_9p_device_unrealize;
vdc->get_features = virtio_9p_get_features;
vdc->get_config = virtio_9p_get_config;
+ vdc->reset = virtio_9p_reset;
}
static const TypeInfo virtio_device_info = {