From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:906:cf90:b0:9bd:85f7:2662 with SMTP id um16csp792218ejb; Thu, 19 Oct 2023 14:04:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYTYzpCg+IXxu/+t22x94l9h9BSpb3+TaskpU4A8YnWI/Qc4aut1Ig8iKVehoALTymDYu2 X-Received: by 2002:a0c:b405:0:b0:65d:afc:3a69 with SMTP id u5-20020a0cb405000000b0065d0afc3a69mr57085qve.6.1697749453751; Thu, 19 Oct 2023 14:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697749453; cv=none; d=google.com; s=arc-20160816; b=CcGnX0hWvjQVaYIzAVsQ32INtNE24oXn+CTyMBkLfOzQnz4IGeGG+kx8xMTY6dE7MS mHAVMtzoyExSyuyAm7KwNoyq9f7VvAvnA3wTaWS09lvh6YK3C/PG3lWuKi3DyWcgXYsO esjX8/xP0XVCKiyOdvq/qnglyjf/m7spWh1UuAl8q3gEcait+Awis7Su400ZlJ17C3Aq 11LbOlNlaNmVHiv4pHsyRMcKPsfB1JVZmsL3pNVGGQK2qjNH+TpF2Ukq97aHuVifPkRp QWVrpJ4Npnhp259IqVMCOCF3DgNbgf8hzb7cEzdfvne5iG3lFvjrlY+Jd7u2Oq9KNxMn SGVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=R/3h87s0xeLqmjIb7mURZ4HmMkSUJrD+xg+924aPtlM=; fh=nDcgOyJ5wI4ec5cBWrHogeHeYCn4pzALdxpM3FX1gnA=; b=EkpftlU4hV6TO4F5RsbD3QNfXqG4ZKld2y/M3xL06D31Kb7FRJY5bpCQXpsg1BNw0E h2bTGUR5VBxryTNlvI4bdIGXe5WTT4+qHzFVNyGbs0s8HQlLmaXGjqMNQOaYFMCsaJYr BL9oz1sXgjxIiKsmV8RqtXLNjjzY3EoFHpYIdbIJxT+7+7tOxhN5SglRnS+mSJUgVdKG vC7LpBLFvUGyxquoIdSFEIult2hk4xeOJTO/WqqCHJ80I6WjiIduNDy877uJGUi2I7IZ VsQ6yzDEepd5lr4mZ+mq50SmuR9qp6hFsgdM6AG/qmHUI8CtxuPq7kleFoTwIUtK1NQo zJNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=orkHFEMn; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fe7-20020a0562140b8700b0066d197c81e5si323239qvb.374.2023.10.19.14.04.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 14:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=orkHFEMn; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtaBW-0002rV-BO; Thu, 19 Oct 2023 17:04:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtaBL-0002p4-PN; Thu, 19 Oct 2023 17:03:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtaBJ-0001QS-Oc; Thu, 19 Oct 2023 17:03:51 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39JL0WLv029786; Thu, 19 Oct 2023 21:03:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=R/3h87s0xeLqmjIb7mURZ4HmMkSUJrD+xg+924aPtlM=; b=orkHFEMnVgZ96qNwvJ+KDBNZixIFKRUwqoXIFMJ5V7R6KqQcMNDs4R6rLi97lN/s9gOp 2X6mKv/DSV/esk6xeOrOdw2CF+5AELdz75FJjkc3zKn6gbORJ69evZkCsP192nKYrSh7 zig0MeH0DDQaUlMhiAQozG0KmJDaEby4DT6+BO5BHxacVW2vbKtgkQZVxLD+TxtArz+C 4KnAimIA/eTgI58gMtRJjx/R1dOGSXrrvY/jWNWBEbvonSKjLvZ8jo9+CzkHblXd5HNj ON11BeyAH6jFOqyRMtdbce266npln3SQh32Eljz38sj2eTVSKmNRQgnW6fFzqMdA38q2 jA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuc058ab7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 21:03:32 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39JL0fRE030363; Thu, 19 Oct 2023 21:03:20 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuc0589aa-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 21:03:20 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39JJhi2D027130; Thu, 19 Oct 2023 20:38:20 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tr6tku8k9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 20:38:20 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39JKcJQK48496988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Oct 2023 20:38:19 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88E9358059; Thu, 19 Oct 2023 20:38:19 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7EFF058057; Thu, 19 Oct 2023 20:38:16 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTPS; Thu, 19 Oct 2023 20:38:16 +0000 (GMT) Message-ID: <8b7a67bf-6d45-374c-13ee-fbb85b4b21bc@linux.ibm.com> Date: Thu, 19 Oct 2023 16:38:15 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 10/13] migration: Improve example and documentation of vmstate_register() Content-Language: en-US To: Juan Quintela , qemu-devel@nongnu.org Cc: Stefan Berger , Marcel Apfelbaum , qemu-ppc@nongnu.org, Nicholas Piggin , qemu-s390x@nongnu.org, Gerd Hoffmann , Corey Minyard , Samuel Thibault , Richard Henderson , David Hildenbrand , Ilya Leoshkevich , Fabiano Rosas , Eric Farman , Peter Xu , Harsh Prateek Bora , John Snow , qemu-block@nongnu.org, Mark Cave-Ayland , Christian Borntraeger , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Stefan Weil , qemu-arm@nongnu.org, Jason Wang , Corey Minyard , Leonardo Bras , Thomas Huth , Peter Maydell , "Michael S. Tsirkin" , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , David Gibson , Halil Pasic , Daniel Henrique Barboza References: <20231019190831.20363-1-quintela@redhat.com> <20231019190831.20363-11-quintela@redhat.com> From: Stefan Berger In-Reply-To: <20231019190831.20363-11-quintela@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: AFRDLxnl0cnlKe5z7up_F34GBaDdsUSv X-Proofpoint-ORIG-GUID: 37p4IB-0PDqTaExATMDl8XywRTb2HTuY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-19_21,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 mlxlogscore=994 lowpriorityscore=0 adultscore=0 clxscore=1015 phishscore=0 impostorscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310190177 Received-SPF: pass client-ip=148.163.158.5; envelope-from=stefanb@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -52 X-Spam_score: -5.3 X-Spam_bar: ----- X-Spam_report: (-5.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-3.339, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: SZA2Yt+aaMYF On 10/19/23 15:08, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > docs/devel/migration.rst | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst > index c3e1400c0c..a9fde75862 100644 > --- a/docs/devel/migration.rst > +++ b/docs/devel/migration.rst > @@ -165,13 +165,17 @@ An example (from hw/input/pckbd.c) > } > }; > > -We are declaring the state with name "pckbd". > -The ``version_id`` is 3, and the fields are 4 uint8_t in a KBDState structure. > -We registered this with: > +We are declaring the state with name "pckbd". The ``version_id`` is > +3, and the fields are 4 uint8_t in a KBDState structure. We and there are 4  uint8_t fields in the KBDState structure. > +registered this with one of those. The first one will generate a I am not sure what this means 'We registered this with one of those'. What is 'one of those'? Maybe you mean: We register the KBDState with one of the following functions. > +device ``instance_id`` different for each registration. Use the > +second one if you already have an id different for each instance of > +the device: ... have an id that is is different for each ... > > .. code:: c > > - vmstate_register(NULL, 0, &vmstate_kbd, s); > + vmstate_register_any(NULL, &vmstate_kbd, s); > + vmstate_register(NULL, instance_id, &vmstate_kbd, s); > > For devices that are ``qdev`` based, we can register the device in the class > init function: