From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2LeE-0002MO-Ez for qemu-devel@nongnu.org; Thu, 03 Nov 2016 13:17:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2LeA-0001W7-Fo for qemu-devel@nongnu.org; Thu, 03 Nov 2016 13:17:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53246 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2LeA-0001W2-As for qemu-devel@nongnu.org; Thu, 03 Nov 2016 13:17:50 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA3HE1rP058806 for ; Thu, 3 Nov 2016 13:17:49 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 26g6c1m84r-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 03 Nov 2016 13:17:49 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Nov 2016 17:17:47 -0000 References: <1477943636-21024-1-git-send-email-duanj@linux.vnet.ibm.com> <1477943636-21024-4-git-send-email-duanj@linux.vnet.ibm.com> <87funa88fz.fsf@emacs.mitica> <1c541e96-55c6-cd43-f598-afd5f0ecae9e@linux.vnet.ibm.com> From: Halil Pasic Date: Thu, 3 Nov 2016 18:17:42 +0100 MIME-Version: 1.0 In-Reply-To: <1c541e96-55c6-cd43-f598-afd5f0ecae9e@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Message-Id: <38ec5832-3566-3cee-a12a-5dbcdfb13ea3@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [QEMU PATCH v10 3/3] tests/migration: Add test for QTAILQ migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jianjun Duan , quintela@redhat.com Cc: veroniabahaa@gmail.com, peter.maydell@linaro.org, dgilbert@redhat.com, mdroth@linux.vnet.ibm.com, mst@redhat.com, mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, mreitz@redhat.com, blauwirbel@gmail.com, amit.shah@redhat.com, qemu-ppc@nongnu.org, kraxel@redhat.com, kwolf@redhat.com, dmitry@daynix.com, pbonzini@redhat.com, rth@twiddle.net, leon.alrae@imgtec.com, aurelien@aurel32.net, david@gibson.dropbear.id.au On 11/03/2016 05:47 PM, Jianjun Duan wrote: > > On 11/03/2016 05:22 AM, Halil Pasic wrote: >> > >> > >> > On 11/02/2016 11:47 AM, Juan Quintela wrote: >>> >> Jianjun Duan wrote: >>>> >>> Add a test for QTAILQ migration to tests/test-vmstate.c. >>>> >>> >>>> >>> Signed-off-by: Jianjun Duan >>> >> >>> >> Reviewed-by: Juan Quintela >>> >> >> > >> > Empty QTAILQ seems to be broken. Have written a small >> > test to prove my point. It May even make sense to have such >> > a test in the test-suite (some prettyfication might be >> > necessary though). >> > > It is working as intended. > My train of thought was that the object holding the queue might be dynamically allocated by the migration code or otherwise uninitialized. I was unaware these scenarios are prohibited. > The current design is to append the qtailq from source to the > corresponding one on target. I do not see this documented. I'm used to vmstate_load overwriting values and following pointers, so IMHO it is not obvious that qtailq load does append. > It works well for the task in hard > such as migrating ccs_list and pending_events for DRC objects. > Because target head is always properly initialized to empty queue? > I suspect in most cases the qtailqs on target are empty. If I think about migration having no queues populated with elements on a target site sounds very reasonable since IFAIU the target should not do any work which would populate these data structures. > If not, > appending to them is a good choice. Clearing them is tricky since > each queue probably require a specialized routine to clean. If they > are not empty there are must be good reasons for that. Have you some code or a scenario in mind where this is legit? I mean creating a mix of the state(?) we found at the target and the state captured at the source does not sound right. I would argue that the target should not have any state which is subject to migration. You are right a non-empty queue is trouble, and frankly I never considered it as a valid scenario. Sorry if I'm bothering you with nonsense. Greetings, Halil > > Thanks, > Jianjun >