qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] vhost-user: add reply for set_mem_table


From: Gonglei
Subject: Re: [Qemu-devel] [PATCH 2/2] vhost-user: add reply for set_mem_table
Date: Tue, 10 Feb 2015 11:57:07 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2015/2/10 11:24, linhaifeng wrote:
> From: Linhaifeng <address@hidden>
> 
> If u64 is not 0 we should return -1 to tell qemu not going on.
> 
> Signed-off-by: Linhaifeng <address@hidden>
> ---
>  hw/virtio/vhost-user.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index aefe0bb..a68ce36 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -243,7 +243,7 @@ static int vhost_user_call(struct vhost_dev *dev, 
> unsigned long int request,
>          msg.size = sizeof(m.memory.nregions);
>          msg.size += sizeof(m.memory.padding);
>          msg.size += fd_num * sizeof(VhostUserMemoryRegion);
> -
> +        need_reply = 1;
>          break;
>  
>      case VHOST_SET_LOG_FD:
> @@ -315,6 +315,17 @@ static int vhost_user_call(struct vhost_dev *dev, 
> unsigned long int request,
>              }
>              memcpy(arg, &msg.state, sizeof(struct vhost_vring_state));
>              break;
> +        case VHOST_SET_MEM_TABLE:
> +            if (msg.size != sizeof(m.u64)) {
> +                error_report("Received bad msg size.\n");
A superfluous "\n" character.
> +                return -1;
> +            } else {
> +                if (m.u64) {
> +                    error_report("Failed to set memory table.\n");
A superfluous "\n" character.

Regards,
-Gonglei
> +                    return -1;
> +                }
> +            }
> +            break;
>          default:
>              error_report("Received unexpected msg type.\n");
>              return -1;
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]