From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP6gB-0001SG-9H for qemu-devel@nongnu.org; Wed, 03 Sep 2014 05:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP6g7-00018D-1I for qemu-devel@nongnu.org; Wed, 03 Sep 2014 05:16:39 -0400 Message-ID: <5406DC62.9070209@redhat.com> Date: Wed, 03 Sep 2014 17:16:18 +0800 From: Jason Wang MIME-Version: 1.0 References: <1409734590-6826-1-git-send-email-mst@redhat.com> In-Reply-To: <1409734590-6826-1-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vhost_net: init acked_features to backend_features List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Andrey Korolyov , qemu-stable@nongnu.org, Nikolay Nikolaev On 09/03/2014 04:57 PM, Michael S. Tsirkin wrote: > commit 2e6d46d77ed328d34a94688da8371bcbe243479b (vhost: add > vhost_get_features and vhost_ack_features) removes the step that > initializes the acked_features to backend_features. > > As this field is now uninitialized, vhost initialization will sometimes > fail. > > To fix, initialize field in core vhost code. > > As the next step, cleanup vhost scsi code as well. > > Reported-by: Jason Wang > Reported-by: Andrey Korolyov > Cc: Nikolay Nikolaev > Cc: qemu-stable@nongnu.org > Signed-off-by: Jason Wang > Reviewed-by: Michael S. Tsirkin > Signed-off-by: Michael S. Tsirkin > --- > hw/virtio/vhost.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index 5d7c40a..e42e51f 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@ -873,6 +873,9 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque, > hdev->memory_changed = false; > memory_listener_register(&hdev->memory_listener, &address_space_memory); > hdev->force = force; > + /* Set minimal required set of features. */ > + hdev->acked_features = hdev->backend_features; > + > return 0; > fail_vq: > while (--i >= 0) { Since vhost_ack_features() never clear a bit, if rebooting from a guest w/ mrg rx buffer to a guest w/o it, network is broken?