From nobody Wed Feb 11 05:11:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1560505940; cv=none; d=zoho.com; s=zohoarc; b=DstExhf/i+CgWJte6TR+phYiIHms6JdX/B8l6etI8kraWmfT5I/4i2T2CsU2Rv9mHI7pY7x9SfUQo2Z5G+IeEVYwgjNnVUlkklztZoZWZ4CFT+YK4aqV8NfDTmHakY0PoJHm0d/D49IwlH1VwLW7kGNj8Pf7eFLXQirjDm6Wevo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560505940; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=uXimO1fIrN/suCveCkDvGhUQ6cXgmIUR+zvZ/sjAqMA=; b=U6ZCD+fqF/BPWf1AzDnCkjaVuw/Zh+gsLZUpehy0NjrOC9B5yFuUageufFPAlA9Y0F8Pv/b68gwJ8WstHOwU2m8Gf+ZS69/FTPTQl+ZWx69FslKmKbJ/RW07DOw/dr8U89ksqtqAnSmsmYIl+IXZS0h6kiO+aT3/hxGunopcuI0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560505940299345.31641899748445; Fri, 14 Jun 2019 02:52:20 -0700 (PDT) Received: from localhost ([::1]:49698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbisd-0000oW-AZ for importer@patchew.org; Fri, 14 Jun 2019 05:52:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40698) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbieL-0004hV-GP for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:37:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbiZ7-0000nP-2R for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:32:09 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:44739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbiZ6-0000mw-TF for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:32:09 -0400 Received: by mail-pf1-x444.google.com with SMTP id t16so1084997pfe.11 for ; Fri, 14 Jun 2019 02:32:08 -0700 (PDT) Received: from localhost ([116.247.112.152]) by smtp.gmail.com with ESMTPSA id j8sm2134156pfi.148.2019.06.14.02.32.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 02:32:07 -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=uXimO1fIrN/suCveCkDvGhUQ6cXgmIUR+zvZ/sjAqMA=; b=JPZ2VhFsJRluFjtUxMi88kSfvo4YX+asIgRqnRZfntfVdBfPUonLJGXY8+2C6zaTj/ pu3EzrAoCZp1y/j2RkUMdpY9GYagH8UgRdLG0Nw6W/o0qELz8rTn+giJBxD4dmROZDVb maHECFWkeYHC/BzpaTD2cic/DuWnKufJlv3SGTRKJD7+Q9DDDmQG8SBo0b8wM09kK+xh FXIXUMU7FXV/tFcHCFKbqkKoPpsmLtLHUvFVAYVyHfGXrH21vdtvh9LLp93UDwLAQL+6 DkYnl6rxkbjfNCZ48SamO9i42zGAyfXoEuxvbvMb9ew58bK2WevIsmBsl2K0nfwySx1m rnAg== 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=uXimO1fIrN/suCveCkDvGhUQ6cXgmIUR+zvZ/sjAqMA=; b=JAdqxnx2EP8Wt8Hbq/7DSOQv/H7BuDdRkYzXo8MeSOJzlbaHkzSiEeKyYUXLYQxgMP I6ARETIEhXoMo1H8UwDoCBHkJzljAl2Tpx1p8QDpaPyiHfTUnOAnSs0boRLjYWvtcspG 3dAeEMIURVWfTcwbYqO4Ugy1bzt6M6xIqb9xBcqUoq+zNxgsZPi4Ea3j02N5dl8n/vmo I3yrcF4OAeK/0l0fNKYvWlzrwTz7WVOW2FOS5JXYhoXsD/cvqjS/pBLVckDLVA6T25dL PofYyyI+XFSEqbPb+RdiGnFjir4GFoCY4gGNRUwB61sh4ZLIhY0cOTtQ8JyE3kbS9z8P SWIg== X-Gm-Message-State: APjAAAW/du5q1Az/KpXEj6/P3m2A4S5pcTnSTi9eJXgokHNJD7oOPNYb 9Ntg/rMDK3s/1z+JX9tcJhY= X-Google-Smtp-Source: APXvYqw+VlBZU72y/mvqwSUeSEPehB3IAora8db+7KXnXe3oL8o2zJtQ5UsrWviP9ycV2/GXenJbtw== X-Received: by 2002:a65:510c:: with SMTP id f12mr33622507pgq.92.1560504727855; Fri, 14 Jun 2019 02:32:07 -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:18 +0800 Message-Id: <20190614093121.5580-3-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::444 Subject: [Qemu-devel] [PATCH v3 2/5] virtio: Set "start_on_kick" for legacy devices 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Xie Yongji Besides virtio 1.0 transitional devices, we should also set "start_on_kick" flag for legacy devices (virtio 0.9). Signed-off-by: Xie Yongji Reviewed-by: Greg Kurz --- hw/virtio/virtio.c | 6 ++---- include/hw/virtio/virtio.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 19062fbb96..473881e9ec 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1212,8 +1212,7 @@ void virtio_reset(void *opaque) k->reset(vdev); } =20 - vdev->start_on_kick =3D (virtio_host_has_feature(vdev, VIRTIO_F_VERSIO= N_1) && - !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_= 1)); + vdev->start_on_kick =3D !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSIO= N_1); vdev->started =3D false; vdev->broken =3D false; vdev->guest_features =3D 0; @@ -2325,8 +2324,7 @@ void virtio_init(VirtIODevice *vdev, const char *name, g_malloc0(sizeof(*vdev->vector_queues) * nvectors); } =20 - vdev->start_on_kick =3D (virtio_host_has_feature(vdev, VIRTIO_F_VERSIO= N_1) && - !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_= 1)); + vdev->start_on_kick =3D !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSIO= N_1); vdev->started =3D false; vdev->device_id =3D device_id; vdev->status =3D 0; diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 15d5366939..b189788cb2 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -107,7 +107,7 @@ struct VirtIODevice bool broken; /* device in invalid state, needs reset */ bool use_started; bool started; - bool start_on_kick; /* virtio 1.0 transitional devices support that */ + bool start_on_kick; /* when virtio 1.0 feature has not been negotiated= */ VMChangeStateEntry *vmstate; char *bus_name; uint8_t device_endian; --=20 2.17.1