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=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 C0C65C432C0 for ; Mon, 18 Nov 2019 14:23:23 +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 8AF1820727 for ; Mon, 18 Nov 2019 14:23:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EP6ovBvC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AF1820727 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWhw1-0002ga-RY for qemu-devel@archiver.kernel.org; Mon, 18 Nov 2019 09:23:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54804) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWhuj-0001g2-VK for qemu-devel@nongnu.org; Mon, 18 Nov 2019 09:22:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWhui-00035A-Rn for qemu-devel@nongnu.org; Mon, 18 Nov 2019 09:22:01 -0500 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:33083) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iWhui-00034a-My for qemu-devel@nongnu.org; Mon, 18 Nov 2019 09:22:00 -0500 Received: by mail-ot1-x342.google.com with SMTP id u13so14640691ote.0 for ; Mon, 18 Nov 2019 06:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=l93epJzFpah5Lo/MulLniiewH8jSfpIFwFL/5sKh+Kc=; b=EP6ovBvCAAIrd3+bgy0sclgtvgfeFLigivyh+FkhqifJO6vm6XSBd3Vx89pL/KqR90 u3GUboNWo80GsCYA8G5p1hUsXGiYjBKSIVk+n4r6M/DIE3Zv+Vcd+9IN35GHNnoPMhJN F2bo/f4M3D1r72/aShlpHDQ5/+Q7dYk2GxCsF+0PdRTETJ9YzM3EfpxdnTwrm/qY53J1 cDUxv1js+UCrGb2vuPPEzoHoz9u8j0xSYsqkJMuMQ8PclohBX1VERtthUHkhS8T3abRT +9McBNPjpMJiy0TZp2rlfkqcMw2iEVHWcHdOLa5sjPAo+uNr8FWDdDKT17JZyJ6rHXMh xZ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=l93epJzFpah5Lo/MulLniiewH8jSfpIFwFL/5sKh+Kc=; b=EM4TVyHsnPJsherjARHHty9oyK1j36PBHkXfER6luNf5S4ZVC99S2+xewVE8YHuCXX 4xwbJ3wpmsK1IfabBxx7ZdghKQALKVbr6mFGOWEM8MDQnYCxzRiVnEg5anhLQmhFnbba gdsR76GfU1VQ3rSfJvx897s+vn7QwSpN9ihnC8jMLgTRrWS64BdFLigXVCMtQkXmLwrg eyTS5hLcd0II0N/ZP4nX/WjiELWAPWj9o4SAQrIgYLREYZNPTZpcTbzrlFUoKeCI956H St/n7Mehf8t3BbA1lSniANgGvusCWWAzo8CsUVH0F/sFCUMcLiiEpKyB4xJLWyUtI3a0 AImg== X-Gm-Message-State: APjAAAU6IS9XVWGdk4KyyDvC6T7g1KheY1pvzcSLCUquv0Gj+iRvBI0X dzWlk8cLOpBw1JJmJk91uFJAG06oPDqOeZeAYs9MFQ== X-Google-Smtp-Source: APXvYqzSJUlWw8j92+iLmDis7pb4boyFSTn9iNxZrm/dZ+/4/nT6wPiFjyzFIxTrTAPUdYmtfFaNc+fXW3AJgROtsBg= X-Received: by 2002:a9d:68cc:: with SMTP id i12mr8746oto.97.1574086919611; Mon, 18 Nov 2019 06:21:59 -0800 (PST) MIME-Version: 1.0 References: <20191023173154.30051-1-marcandre.lureau@redhat.com> <20191023173154.30051-8-marcandre.lureau@redhat.com> In-Reply-To: <20191023173154.30051-8-marcandre.lureau@redhat.com> From: Peter Maydell Date: Mon, 18 Nov 2019 14:21:48 +0000 Message-ID: Subject: Re: [PATCH v3 07/33] serial: register vmsd with DeviceClass To: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::342 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: Corey Minyard , "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , QEMU Developers , KONRAD Frederic , "Edgar E. Iglesias" , Paul Burton , Aleksandar Rikalo , Magnus Damm , =?UTF-8?Q?Herv=C3=A9_Poussineau?= , Artyom Tarasenko , Eduardo Habkost , Fabien Chouteau , qemu-arm , Richard Henderson , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , qemu-ppc , Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, 23 Oct 2019 at 18:33, Marc-Andr=C3=A9 Lureau wrote: > > QOM-ify further. > > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > hw/char/serial.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/hw/char/serial.c b/hw/char/serial.c > index c839035fdd..4af8b0ce4c 100644 > --- a/hw/char/serial.c > +++ b/hw/char/serial.c > @@ -990,8 +990,7 @@ SerialState *serial_init(int base, qemu_irq irq, int = baudbase, > s->baudbase =3D baudbase; > qemu_chr_fe_init(&s->chr, chr, &error_abort); > serial_realize_core(s, &error_fatal); > - > - vmstate_register(NULL, base, &vmstate_serial, s); > + qdev_set_legacy_instance_id(dev, base, 2); > qdev_init_nofail(dev); Did you test whether migration still works from a QEMU version without this patch to one with it? (The migration vmstate code is too complicated for me to be able to figure out whether passing the 'dev' pointer makes a difference to whot it names the state sections and whether the 'qdev_set_legacy_instance_id' suffices to avoid problems.) thanks -- PMM