[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 1/3] vhost: rename VHOST_RESET_DEVICE back to
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH v3 1/3] vhost: rename VHOST_RESET_DEVICE back to VHOST_RESET_OWNER |
Date: |
Sun, 25 Oct 2015 14:42:08 +0200 |
On Fri, Oct 23, 2015 at 04:48:45PM +0800, Yuanhan Liu wrote:
> It turned out that it breaks stuff (VHOST_RESET_OWNER is not defined),
> so revert it:
>
> http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg00949.html
>
> CC: "Michael S. Tsirkin" <address@hidden>
> Reported-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Yuanhan Liu <address@hidden>
Yes but just renaming is kind of beside the point.
We need to move it and add enable/disable vq commands
in its place.
> ---
> docs/specs/vhost-user.txt | 4 ++--
> hw/virtio/vhost-backend.c | 2 +-
> hw/virtio/vhost-user.c | 6 +++---
> linux-headers/linux/vhost.h | 2 +-
> tests/vhost-user-test.c | 4 ++--
> 5 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt
> index e0d71e2..d319715 100644
> --- a/docs/specs/vhost-user.txt
> +++ b/docs/specs/vhost-user.txt
> @@ -255,10 +255,10 @@ Message types
> as an owner of the session. This can be used on the Slave as a
> "session start" flag.
>
> - * VHOST_USER_RESET_DEVICE
> + * VHOST_USER_RESET_OWNER
>
> Id: 4
> - Equivalent ioctl: VHOST_RESET_DEVICE
> + Equivalent ioctl: VHOST_RESET_OWNER
> Master payload: N/A
>
> Issued when a new connection is about to be closed. The Master will no
> diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
> index 1d5f684..b734a60 100644
> --- a/hw/virtio/vhost-backend.c
> +++ b/hw/virtio/vhost-backend.c
> @@ -156,7 +156,7 @@ static int vhost_kernel_set_owner(struct vhost_dev *dev)
>
> static int vhost_kernel_reset_device(struct vhost_dev *dev)
> {
> - return vhost_kernel_call(dev, VHOST_RESET_DEVICE, NULL);
> + return vhost_kernel_call(dev, VHOST_RESET_OWNER, NULL);
> }
>
> static int vhost_kernel_get_vq_index(struct vhost_dev *dev, int idx)
> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index 78442ba..7c532f4 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -43,7 +43,7 @@ typedef enum VhostUserRequest {
> VHOST_USER_GET_FEATURES = 1,
> VHOST_USER_SET_FEATURES = 2,
> VHOST_USER_SET_OWNER = 3,
> - VHOST_USER_RESET_DEVICE = 4,
> + VHOST_USER_RESET_OWNER = 4,
> VHOST_USER_SET_MEM_TABLE = 5,
> VHOST_USER_SET_LOG_BASE = 6,
> VHOST_USER_SET_LOG_FD = 7,
> @@ -157,7 +157,7 @@ static bool vhost_user_one_time_request(VhostUserRequest
> request)
> {
> switch (request) {
> case VHOST_USER_SET_OWNER:
> - case VHOST_USER_RESET_DEVICE:
> + case VHOST_USER_RESET_OWNER:
> case VHOST_USER_SET_MEM_TABLE:
> case VHOST_USER_GET_QUEUE_NUM:
> return true;
> @@ -486,7 +486,7 @@ static int vhost_user_set_owner(struct vhost_dev *dev)
> static int vhost_user_reset_device(struct vhost_dev *dev)
> {
> VhostUserMsg msg = {
> - .request = VHOST_USER_RESET_DEVICE,
> + .request = VHOST_USER_RESET_OWNER,
> .flags = VHOST_USER_VERSION,
> };
>
> diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h
> index 14a0160..ead86db 100644
> --- a/linux-headers/linux/vhost.h
> +++ b/linux-headers/linux/vhost.h
> @@ -78,7 +78,7 @@ struct vhost_memory {
> #define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
> /* Give up ownership, and reset the device to default values.
> * Allows subsequent call to VHOST_OWNER_SET to succeed. */
> -#define VHOST_RESET_DEVICE _IO(VHOST_VIRTIO, 0x02)
> +#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
>
> /* Set up/modify memory layout */
> #define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory)
> diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
> index a74c934..d2fc048 100644
> --- a/tests/vhost-user-test.c
> +++ b/tests/vhost-user-test.c
> @@ -57,7 +57,7 @@ typedef enum VhostUserRequest {
> VHOST_USER_GET_FEATURES = 1,
> VHOST_USER_SET_FEATURES = 2,
> VHOST_USER_SET_OWNER = 3,
> - VHOST_USER_RESET_DEVICE = 4,
> + VHOST_USER_RESET_OWNER = 4,
> VHOST_USER_SET_MEM_TABLE = 5,
> VHOST_USER_SET_LOG_BASE = 6,
> VHOST_USER_SET_LOG_FD = 7,
> @@ -307,7 +307,7 @@ static void chr_read(void *opaque, const uint8_t *buf,
> int size)
> g_cond_signal(&s->data_cond);
> break;
>
> - case VHOST_USER_RESET_DEVICE:
> + case VHOST_USER_RESET_OWNER:
> s->fds_num = 0;
> break;
>
> --
> 1.9.0