From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7DA2C31E40 for ; Fri, 9 Aug 2019 13:51:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90B092086D for ; Fri, 9 Aug 2019 13:51:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90B092086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5JF-0002hY-J5 for qemu-devel@archiver.kernel.org; Fri, 09 Aug 2019 09:51:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34560) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5Ie-0001jd-T9 for qemu-devel@nongnu.org; Fri, 09 Aug 2019 09:51:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hw5Id-0001RL-En for qemu-devel@nongnu.org; Fri, 09 Aug 2019 09:51:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5009) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hw5IY-0001NE-VR; Fri, 09 Aug 2019 09:51:15 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9E4E308A958; Fri, 9 Aug 2019 13:51:12 +0000 (UTC) Received: from work-vm (ovpn-117-184.ams2.redhat.com [10.36.117.184]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6798B65EB4; Fri, 9 Aug 2019 13:50:49 +0000 (UTC) Date: Fri, 9 Aug 2019 14:50:46 +0100 From: "Dr. David Alan Gilbert" To: Peter Maydell Message-ID: <20190809135046.GE2840@work-vm> References: <20190729145654.14644-1-damien.hedde@greensocs.com> <20190729145654.14644-8-damien.hedde@greensocs.com> <20190808154219.GK2852@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 09 Aug 2019 13:51:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH v3 07/33] automatically add vmstate for reset support in 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: Fam Zheng , Collin Walling , Dmitry Fleytman , "Michael S. Tsirkin" , Mark Cave-Ayland , QEMU Developers , Gerd Hoffmann , Edgar Iglesias , Hannes Reinecke , Qemu-block , Juan Quintela , David Hildenbrand , Halil Pasic , Christian Borntraeger , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Richard Henderson , Thomas Huth , Eduardo Habkost , Alistair Francis , qemu-s390x , qemu-arm , =?iso-8859-1?Q?C=E9dric?= Le Goater , John Snow , David Gibson , Damien Hedde , "Daniel P. Berrange" , Cornelia Huck , Mark Burton , qemu-ppc , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" * Peter Maydell (peter.maydell@linaro.org) wrote: > On Thu, 8 Aug 2019 at 16:42, Dr. David Alan Gilbert wrote: > > > > * Peter Maydell (peter.maydell@linaro.org) wrote: > > > On Mon, 29 Jul 2019 at 15:59, Damien Hedde wrote: > > > > > > > > This add the reset related sections for every QOM > > > > device. > > > > > > A bit more detail in the commit message would help, I think -- > > > this is adding extra machinery which has to copy and modify > > > the VMStateDescription passed in by the device in order to > > > add the subsection that handles reset. > > > > > > I've added Dave Gilbert to the already long cc list since this > > > is migration related. > > > > I don't like dynamically modifying all the vmsds. > > Yeah, I'm not a huge fan of it either, but it does mean that > the state gets migrated and we don't have a pile of really > easy to miss bugs where we forgot to say "this device needs to > migrate the reset state" and it means we don't have every > device we ever write in the future needing to say "this device > needs to migrate reset state"... > > > Aren't you going to have to understand each devices reset behaviour > > and make sure it does something sane? e.g. it might have a postload > > that registers a timer or something that you wouldn't want to do if it's > > in reset. > > > > The easiest way is to write a macro that you can easily add to devices > > you've checked subsection list (like the way we have a > > VMSTATE_USB_DEVICE). > > One problem is that as soon as somebody writes a USB controller > or PCI controller model that can be held in reset, every > device that could sat behind it automatically now could find > that it's migrated while it's in reset. I'm not convinced though that they'll all be fixed by adding this subsection; I think some of those devices you're going to have to look at and see what they do. Dave > thanks > -- PMM -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK