qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] vhost_net: initialize acked_features to a safe


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH] vhost_net: initialize acked_features to a safe value during ack
Date: Wed, 3 Sep 2014 11:30:52 +0300

On Wed, Sep 03, 2014 at 02:25:30PM +0800, Jason Wang wrote:
> commit 2e6d46d77ed328d34a94688da8371bcbe243479b (vhost: add
> vhost_get_features and vhost_ack_features) removes the step that
> initializes the acked_features to backend_features.


But acked features are set in vhost_ack_features.
why would we need to initialize to backend_features?
0 is a better default.

> This will result an
> unexpected value of acked_features which may fail the features setting of
> vhost. This patch fixes it by recover this step.
> 
> Cc: Nikolay Nikolaev <address@hidden>
> Cc: Andrey Korolyov <address@hidden>
> Cc: Michael S. Tsirkin <address@hidden>
> Cc: Michael Roth <address@hidden>
> Cc: address@hidden
> Signed-off-by: Jason Wang <address@hidden>
> ---
>  hw/net/vhost_net.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index f87c798..b1d4b1f 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -115,6 +115,7 @@ unsigned vhost_net_get_features(struct vhost_net *net, 
> unsigned features)
>  
>  void vhost_net_ack_features(struct vhost_net *net, unsigned features)
>  {
> +    net->dev.acked_features = net->dev.backend_features;

I think it's wrong: you don't want to set all features.

>      vhost_ack_features(&net->dev, vhost_net_get_feature_bits(net), features);
>  }
>  
> -- 
> 1.8.3.1



reply via email to

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