mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
[virtio-9p] Add infrastructure to support glib threads and coroutines.
This patch is originally made by Arun Bharadwaj for glib support. Later Harsh Prateek Bora added coroutines support. This version implemented with suggestions from Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>. Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com> Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
parent
4b76a481ee
commit
39c0564e00
4 changed files with 167 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "virtio-9p.h"
|
||||
#include "fsdev/qemu-fsdev.h"
|
||||
#include "virtio-9p-xattr.h"
|
||||
#include "virtio-9p-coth.h"
|
||||
|
||||
static uint32_t virtio_9p_get_features(VirtIODevice *vdev, uint32_t features)
|
||||
{
|
||||
|
@ -50,13 +51,11 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf)
|
|||
struct stat stat;
|
||||
FsTypeEntry *fse;
|
||||
|
||||
|
||||
s = (V9fsState *)virtio_common_init("virtio-9p",
|
||||
VIRTIO_ID_9P,
|
||||
sizeof(struct virtio_9p_config)+
|
||||
MAX_TAG_LEN,
|
||||
sizeof(V9fsState));
|
||||
|
||||
/* initialize pdu allocator */
|
||||
QLIST_INIT(&s->free_list);
|
||||
for (i = 0; i < (MAX_REQ - 1); i++) {
|
||||
|
@ -132,6 +131,10 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf)
|
|||
s->tag_len;
|
||||
s->vdev.get_config = virtio_9p_get_config;
|
||||
|
||||
if (v9fs_init_worker_threads() < 0) {
|
||||
fprintf(stderr, "worker thread initialization failed\n");
|
||||
exit(1);
|
||||
}
|
||||
return &s->vdev;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue