|
@@ -20,8 +20,6 @@
|
|
#include "hw/virtio/virtio-access.h"
|
|
#include "hw/virtio/virtio-access.h"
|
|
#include "qemu/iov.h"
|
|
#include "qemu/iov.h"
|
|
|
|
|
|
-static const struct V9fsTransport virtio_9p_transport;
|
|
|
|
-
|
|
|
|
static void virtio_9p_push_and_notify(V9fsPDU *pdu)
|
|
static void virtio_9p_push_and_notify(V9fsPDU *pdu)
|
|
{
|
|
{
|
|
V9fsState *s = pdu->s;
|
|
V9fsState *s = pdu->s;
|
|
@@ -104,35 +102,6 @@ static void virtio_9p_get_config(VirtIODevice *vdev, uint8_t *config)
|
|
g_free(cfg);
|
|
g_free(cfg);
|
|
}
|
|
}
|
|
|
|
|
|
-static void virtio_9p_device_realize(DeviceState *dev, Error **errp)
|
|
|
|
-{
|
|
|
|
- VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
|
|
|
- V9fsVirtioState *v = VIRTIO_9P(dev);
|
|
|
|
- V9fsState *s = &v->state;
|
|
|
|
-
|
|
|
|
- if (v9fs_device_realize_common(s, errp)) {
|
|
|
|
- goto out;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- v->config_size = sizeof(struct virtio_9p_config) + strlen(s->fsconf.tag);
|
|
|
|
- virtio_init(vdev, "virtio-9p", VIRTIO_ID_9P, v->config_size);
|
|
|
|
- v->vq = virtio_add_queue(vdev, MAX_REQ, handle_9p_output);
|
|
|
|
- v9fs_register_transport(s, &virtio_9p_transport);
|
|
|
|
-
|
|
|
|
-out:
|
|
|
|
- return;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void virtio_9p_device_unrealize(DeviceState *dev, Error **errp)
|
|
|
|
-{
|
|
|
|
- VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
|
|
|
- V9fsVirtioState *v = VIRTIO_9P(dev);
|
|
|
|
- V9fsState *s = &v->state;
|
|
|
|
-
|
|
|
|
- virtio_cleanup(vdev);
|
|
|
|
- v9fs_device_unrealize_common(s, errp);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void virtio_9p_reset(VirtIODevice *vdev)
|
|
static void virtio_9p_reset(VirtIODevice *vdev)
|
|
{
|
|
{
|
|
V9fsVirtioState *v = (V9fsVirtioState *)vdev;
|
|
V9fsVirtioState *v = (V9fsVirtioState *)vdev;
|
|
@@ -223,6 +192,35 @@ static const struct V9fsTransport virtio_9p_transport = {
|
|
.push_and_notify = virtio_9p_push_and_notify,
|
|
.push_and_notify = virtio_9p_push_and_notify,
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+static void virtio_9p_device_realize(DeviceState *dev, Error **errp)
|
|
|
|
+{
|
|
|
|
+ VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
|
|
|
+ V9fsVirtioState *v = VIRTIO_9P(dev);
|
|
|
|
+ V9fsState *s = &v->state;
|
|
|
|
+
|
|
|
|
+ if (v9fs_device_realize_common(s, errp)) {
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ v->config_size = sizeof(struct virtio_9p_config) + strlen(s->fsconf.tag);
|
|
|
|
+ virtio_init(vdev, "virtio-9p", VIRTIO_ID_9P, v->config_size);
|
|
|
|
+ v->vq = virtio_add_queue(vdev, MAX_REQ, handle_9p_output);
|
|
|
|
+ v9fs_register_transport(s, &virtio_9p_transport);
|
|
|
|
+
|
|
|
|
+out:
|
|
|
|
+ return;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void virtio_9p_device_unrealize(DeviceState *dev, Error **errp)
|
|
|
|
+{
|
|
|
|
+ VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
|
|
|
+ V9fsVirtioState *v = VIRTIO_9P(dev);
|
|
|
|
+ V9fsState *s = &v->state;
|
|
|
|
+
|
|
|
|
+ virtio_cleanup(vdev);
|
|
|
|
+ v9fs_device_unrealize_common(s, errp);
|
|
|
|
+}
|
|
|
|
+
|
|
/* virtio-9p device */
|
|
/* virtio-9p device */
|
|
|
|
|
|
static const VMStateDescription vmstate_virtio_9p = {
|
|
static const VMStateDescription vmstate_virtio_9p = {
|