From patchwork Fri Mar 8 02:21:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 2234371 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6E777DF5B1 for ; Fri, 8 Mar 2013 02:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760219Ab3CHCWj (ORCPT ); Thu, 7 Mar 2013 21:22:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41331 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933069Ab3CHCWi (ORCPT ); Thu, 7 Mar 2013 21:22:38 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r282MZF4005507 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Mar 2013 21:22:35 -0500 Received: from hj.localdomain.com (vpn1-113-139.nay.redhat.com [10.66.113.139]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r282M1HN032390; Thu, 7 Mar 2013 21:22:30 -0500 From: Asias He To: Nicholas Bellinger Cc: Paolo Bonzini , Stefan Hajnoczi , "Michael S. Tsirkin" , Rusty Russell , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, target-devel@vger.kernel.org, Asias He Subject: [PATCH V2 6/6] tcm_vhost: Flush vhost_work in vhost_scsi_flush() Date: Fri, 8 Mar 2013 10:21:47 +0800 Message-Id: <1362709307-12554-7-git-send-email-asias@redhat.com> In-Reply-To: <1362709307-12554-1-git-send-email-asias@redhat.com> References: <1362709307-12554-1-git-send-email-asias@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We also need to flush the vhost_works. One is the completion vhost_work, the other is event vhost_work. Signed-off-by: Asias He --- drivers/vhost/tcm_vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index af80c7f..f80a545 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -1127,6 +1127,8 @@ static void vhost_scsi_flush(struct vhost_scsi *vs) for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) vhost_scsi_flush_vq(vs, i); + vhost_work_flush(&vs->dev, &vs->vs_completion_work); + vhost_work_flush(&vs->dev, &vs->vs_event_work); } static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features)