Browse Source
When multi queue is enabled e.g. for a virtio-net device, each queue pair will have a vhost_dev, and the only thing shared between vhost devs currently is the chardev. This patch introduces a vhost-user state structure which will be shared by all vhost devs of the same virtio device. Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>pull/73/head
committed by
Michael S. Tsirkin
10 changed files with 152 additions and 21 deletions
@ -1,7 +1,17 @@ |
|||
#include "qemu/osdep.h" |
|||
#include "hw/virtio/vhost.h" |
|||
#include "hw/virtio/vhost-user.h" |
|||
|
|||
bool vhost_has_free_slot(void) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
VhostUserState *vhost_user_init(void) |
|||
{ |
|||
return NULL; |
|||
} |
|||
|
|||
void vhost_user_cleanup(VhostUserState *user) |
|||
{ |
|||
} |
|||
|
|||
@ -0,0 +1,20 @@ |
|||
/*
|
|||
* Copyright (c) 2017-2018 Intel Corporation |
|||
* |
|||
* This work is licensed under the terms of the GNU GPL, version 2. |
|||
* See the COPYING file in the top-level directory. |
|||
*/ |
|||
|
|||
#ifndef HW_VIRTIO_VHOST_USER_H |
|||
#define HW_VIRTIO_VHOST_USER_H |
|||
|
|||
#include "chardev/char-fe.h" |
|||
|
|||
typedef struct VhostUserState { |
|||
CharBackend *chr; |
|||
} VhostUserState; |
|||
|
|||
VhostUserState *vhost_user_init(void); |
|||
void vhost_user_cleanup(VhostUserState *user); |
|||
|
|||
#endif |
|||
Loading…
Reference in new issue