From patchwork Fri Jun 14 09:31:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongji Xie X-Patchwork-Id: 10994827 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 E8D1A1398 for ; Fri, 14 Jun 2019 09:45:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA9B626224 for ; Fri, 14 Jun 2019 09:45:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEA8D283A2; Fri, 14 Jun 2019 09:45:35 +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 7AEE626224 for ; Fri, 14 Jun 2019 09:45:35 +0000 (UTC) Received: from localhost ([::1]:49670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbim6-0005c6-Hx for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Jun 2019 05:45:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40783) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbieM-0004oG-Qq for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:37:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbiYr-0000j2-JC for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:31:54 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:46004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbiYr-0000iS-DR for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:31:53 -0400 Received: by mail-pg1-x544.google.com with SMTP id s21so1205554pga.12 for ; Fri, 14 Jun 2019 02:31:53 -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; bh=IA28pcpBdiEvMh8kWXD6ZCj/yjRms4/rSndJ9xOTZr8=; b=acz5XkZFze7EQ/b7r8mvQTmConW6V9FekK8fdM1YYXi0pd0FngGM0d04xElUu5sYmQ MDhMUXtKyPOwPETSdOAC6eOgHVXA7j3egaTXEvE7skL3TzapqGi3ysfZwtVcQaMWoJqj Daly6Jc736jcC/vqBYmWZVfYr//FbTe8j/NAIx4K29Xpr+50dNKeqL+A/X5fU18rWFtU W5luN7MVgetjRF996O11GM3yjFuIkoktME5xL6k382Dw9gxHwHAXp+xT30+9hVjXrQNo YSpKtBahBtK3dN+oNkEpAhL5HyYAeAu7r3NLrkp87SY0dZvEBQMWrl6PazHBpnuJ+kzp 2vbw== 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; bh=IA28pcpBdiEvMh8kWXD6ZCj/yjRms4/rSndJ9xOTZr8=; b=Ih/jNMOpZ2DPb4HgbHvCdvlL+zJI1Mgg/7XvmVyxGTw/84XMkASgr6Nb2rv0oe9Hk4 XsbnpQ5xeQsmZ1dg8/BqkmCQk4ONTUhpj6/0JC9JWQDJBM7xXMzbHVsAZJ+TvWS+2a+1 qT5BRVFVdsT3znD6QhwxPVuQZrrPbN5TiGTqef6RtbHTJanxsip+37JOXsVyhAE/1DIk JZtpNHvTHp/FxjoOWBiZo9+FKJCfB7qjppz8ROAySKmnz+biT7uJhAJdN6XTXmWKiTBn uoD47g65viMzeg6Y86A+X/P2bWOVSrXIYg2oSX+uDZX0py5Ooc7V2g3FlZ0KfYa7sgI6 2jvw== X-Gm-Message-State: APjAAAVoKy7WrviC2z6kPPr8MOQOpocJKYO1EVUujtzN7SVNhCfSRCMS L7hmmpb2jlTEGmJ8GO1jEAY= X-Google-Smtp-Source: APXvYqz2rTsGZORv4eP+8ZW7SWE7OKxreSEcfYZ8+DBBhGHmT5qAxcR13JhbVTYsX9CNJHUGZfs2JQ== X-Received: by 2002:aa7:9190:: with SMTP id x16mr84966532pfa.86.1560504711913; Fri, 14 Jun 2019 02:31:51 -0700 (PDT) Received: from localhost ([116.247.112.152]) by smtp.gmail.com with ESMTPSA id o2sm3735655pgp.74.2019.06.14.02.31.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 02:31:51 -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:16 +0800 Message-Id: <20190614093121.5580-1-xieyongji@baidu.com> X-Mailer: git-send-email 2.17.1 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 0/5] virtio: fix some issues of "started" and "start_on_kick" flag 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 introduced two flags "started" and "start_on_kick" to indicate virtio device's state before. But there still are some problems with them. So we try to fixup them in this patchset. The patch 1 introduces a "use-started" property to avoid a migration issue under Greg Kurz's suggestion [1]. The patch 2 set "start_on_kick" flag for legacy devices. The patch 3 fixes a regression bug that old guest is not able to boot with vhost-user-blk device. The patch 4,5 fix some problems with "started" and "start_on_kick" flag. [1] https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg06247.html v3: - change the order of patches - Also disable "use-started" property by hw_compat_4_0 v2: - Recalculate "start_on_kick" flag after migration instead of migrating it - Set "start_on_kick" flag for legacy devices - Avoid setting "started" flag when "use_started" property is true - Set "use_started" to false by hw_compat_4_0_1 instead of hw_compat_4_0 Xie Yongji (5): virtio: add "use-started" property virtio: Set "start_on_kick" for legacy devices virtio: Set "start_on_kick" on virtio_set_features() virtio: Make sure we get correct state of device on handle_aio_output() virtio: Don't change "started" flag on virtio_vmstate_change() hw/block/vhost-user-blk.c | 4 +-- hw/core/machine.c | 8 ++++-- hw/virtio/virtio.c | 53 ++++++++++++++++++++++---------------- include/hw/virtio/virtio.h | 23 ++++++++++++++++- 4 files changed, 61 insertions(+), 27 deletions(-)