From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsYtj-0001eE-KU for qemu-devel@nongnu.org; Fri, 07 Oct 2016 13:25:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsYtg-00025e-DU for qemu-devel@nongnu.org; Fri, 07 Oct 2016 13:25:27 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60772 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsYtg-00025F-6W for qemu-devel@nongnu.org; Fri, 07 Oct 2016 13:25:24 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u97HNecV060523 for ; Fri, 7 Oct 2016 13:25:23 -0400 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0a-001b2d01.pphosted.com with ESMTP id 25xashdt6y-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 07 Oct 2016 13:25:23 -0400 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Oct 2016 11:25:22 -0600 References: <1475519097-27611-1-git-send-email-duanj@linux.vnet.ibm.com> <1475519097-27611-5-git-send-email-duanj@linux.vnet.ibm.com> <20161005165638.GC11921@work-vm> <20161006190156.GE3087@work-vm> <6420ae77-c205-6e24-d06e-2bbb28447b23@redhat.com> <20161007143445.GA25928@work-vm> <72a0ee2a-297c-02cd-1af5-215ad463b474@linux.vnet.ibm.com> <7e2948b3-0e29-b87c-78bd-d5070efb3342@redhat.com> From: Jianjun Duan Date: Fri, 7 Oct 2016 10:25:09 -0700 MIME-Version: 1.0 In-Reply-To: <7e2948b3-0e29-b87c-78bd-d5070efb3342@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Message-Id: <32187d3f-d1c1-b14a-ebf6-f01526359bdb@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [QEMU PATCH v5 4/6] migration: migrate QTAILQ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Dr. David Alan Gilbert" Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, dmitry@daynix.com, peter.maydell@linaro.org, kraxel@redhat.com, mst@redhat.com, david@gibson.dropbear.id.au, veroniabahaa@gmail.com, quintela@redhat.com, amit.shah@redhat.com, mreitz@redhat.com, kwolf@redhat.com, rth@twiddle.net, aurelien@aurel32.net, leon.alrae@imgtec.com, blauwirbel@gmail.com, mark.cave-ayland@ilande.co.uk, mdroth@linux.vnet.ibm.com On 10/07/2016 09:32 AM, Paolo Bonzini wrote: > > > On 07/10/2016 18:31, Jianjun Duan wrote: >> >> >> On 10/07/2016 07:34 AM, Dr. David Alan Gilbert wrote: >>> * Paolo Bonzini (pbonzini@redhat.com) wrote: >>>> >>>> >>>> On 06/10/2016 21:01, Dr. David Alan Gilbert wrote: >>>>>>>> + } else if (field->flags & VMS_LINKED) { >>>>>>>> + ret = field->info->get(f, addr, size, field); >>>>>>>> } else { >>>>>>>> ret = field->info->get(f, addr, size, NULL); >>>>>>>> >>>>>>>> @@ -193,6 +197,8 @@ static const char *vmfield_get_type_name(VMStateField *field) >>>>>>>> >>>>>>>> if (field->flags & VMS_STRUCT) { >>>>>>>> type = "struct"; >>>>>>>> + } else if (field->flags & VMS_LINKED) { >>>>>>>> + type = "linked"; >>>>>>>> } else if (field->info->name) { >>>>>>>> type = field->info->name; >>>>>>>> } >>>>>>>> @@ -327,6 +333,8 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, >>>>>>>> } >>>>>>>> if (field->flags & VMS_STRUCT) { >>>>>>>> vmstate_save_state(f, field->vmsd, addr, vmdesc_loop); >>>>>>>> + } else if (field->flags & VMS_LINKED) { >>>>>>>> + field->info->put(f, addr, size, field, vmdesc_loop); >>>>>>>> } else { >>>>>>>> field->info->put(f, addr, size, NULL, NULL); >>>>>>>> } >>>> >>>> Is VMS_LINKED needed at all, since the fields are unused for every >>>> VMStateInfo except qtailq? >>> >>> No, I think you could easily drop the VMS_LINKED and just always pass them in. >> >> It is needed if we want to use vmdesc_loop. > > Just always pass it in, can't you? > Could that lead to repetition of array elements? I know it depends on individual put details. Thanks, Jianjun > Paolo >