From patchwork Fri Jun 14 09:31:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongji Xie X-Patchwork-Id: 10994821 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B17671515 for ; Fri, 14 Jun 2019 09:43:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A39AA205F6 for ; Fri, 14 Jun 2019 09:43:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 982282838F; Fri, 14 Jun 2019 09:43:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1B928205F6 for ; Fri, 14 Jun 2019 09:43:50 +0000 (UTC) Received: from localhost ([::1]:49634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbikP-0002F5-BD for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Jun 2019 05:43:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40605) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbieK-0004gq-77 for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:37:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbiZD-0000pL-DA for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:32:16 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:46461) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbiZD-0000pF-78 for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:32:15 -0400 Received: by mail-pg1-x544.google.com with SMTP id v9so1204125pgr.13 for ; Fri, 14 Jun 2019 02:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dzTNWL7QYHXYrYeoVVUd6Gcm/t/F3nzsiE9MlJaHKkY=; b=inzXWINMXCpAmFDZiV2imzYQs4R/vtHlNH/9ByH5fhb52IIVP5nOP+LS0BkfA9TJ5G 9/0taxQX0YXPqs0nyBbWO3GJVadE+eujzv1918Oh7atkisbezqrK7P4LKONn5e+WIcNI VtcT82HHmcbbMl9WvGnK/Xhr90r4x2PZ8wBIyANzE9s/zwjNznTnEp5pLbl+75hBJIT/ z+oFxGPqRdbgfXtzxAsW2vQxeEagV54E9+xH2UL1LPoPqXGnxCCarV4QLdBnd12c0Qy4 NLgSoA68HYDHjs3fVVUwf2k9zTpTpGwMp3tNIDtUXku7TiJzNlbs9CS1vaGuh1PQZ6vx Bwow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dzTNWL7QYHXYrYeoVVUd6Gcm/t/F3nzsiE9MlJaHKkY=; b=Uk3GoZbY715dNf72TN/T0JbezJzrj1q64QP1b1MgDNlxqbXuUIoeT8NdW9xgCU0g5x vhzkOsxmqHVf+W0zNZqc7R5sWKC8dU0xVp0E+R0rGBfByZxnI3bmTnIb5fMA6EOs1kWX KLIJyF8RKSqLZb+jsdjTBt+8FWCkcr7JQ6Gw3U1aSuoeHK9D0S1cbR/IKyGsNuYWuDjq yY7lYrQFv+7MWY8uKKKuCf7O21aEa2ATMwexkOV6c7RyKl0jVmByOog2ZYfUGgtjofJw pO2N3Yp82cEHSS2xSbY1mAcN5y5qZu0fSGZWoidZptqCe4mVIcvrsQ9gE8SgY6UxPa91 S5Pg== X-Gm-Message-State: APjAAAUTJTKlHh71Ur7rYdeKSWM2ldocdL158fXSCvDwl0aZoc+peBqS UJ0STSztiUyRL/kfrscKJRc= X-Google-Smtp-Source: APXvYqyQwF9C1bku9mPv3UA6kcin3IDwL9/gMImtinrEIL9CwSLIaUpU3ADaKu4X5kQ617Jh7PTj9g== X-Received: by 2002:a17:90a:2244:: with SMTP id c62mr10336832pje.29.1560504734518; Fri, 14 Jun 2019 02:32:14 -0700 (PDT) Received: from localhost ([116.247.112.152]) by smtp.gmail.com with ESMTPSA id f11sm8113834pjg.1.2019.06.14.02.32.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 02:32:14 -0700 (PDT) From: elohimes@gmail.com X-Google-Original-From: xieyongji@baidu.com To: mst@redhat.com, groug@kaod.org Date: Fri, 14 Jun 2019 17:31:20 +0800 Message-Id: <20190614093121.5580-5-xieyongji@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190614093121.5580-1-xieyongji@baidu.com> References: <20190614093121.5580-1-xieyongji@baidu.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 Subject: [Qemu-devel] [PATCH v3 4/5] virtio: Make sure we get correct state of device on handle_aio_output() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Xie Yongji , dgilbert@redhat.com, ehabkost@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Xie Yongji We should set the flags: "start_on_kick" and "started" after we call the kick functions (handle_aio_output() and handle_output()). Signed-off-by: Xie Yongji --- hw/virtio/virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 034320d277..b4301f9e02 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1571,10 +1571,10 @@ void virtio_queue_notify(VirtIODevice *vdev, int n) event_notifier_set(&vq->host_notifier); } else if (vq->handle_output) { vq->handle_output(vdev, vq); - } - if (unlikely(vdev->start_on_kick)) { - virtio_set_started(vdev, true); + if (unlikely(vdev->start_on_kick)) { + virtio_set_started(vdev, true); + } } }