From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Np1P3-000237-RQ for qemu-devel@nongnu.org; Tue, 09 Mar 2010 10:31:25 -0500 Received: from [199.232.76.173] (port=55953 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Np1P2-00022B-PU for qemu-devel@nongnu.org; Tue, 09 Mar 2010 10:31:24 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Np1P1-0003PV-71 for qemu-devel@nongnu.org; Tue, 09 Mar 2010 10:31:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53031) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Np1P0-0003PP-RD for qemu-devel@nongnu.org; Tue, 09 Mar 2010 10:31:23 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o29FVLkM001922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Mar 2010 10:31:21 -0500 Date: Tue, 9 Mar 2010 20:59:58 +0530 From: Amit Shah Message-ID: <20100309152958.GC21684@amit-x200.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: virtio-serial NULL deference List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel On (Tue) Mar 09 2010 [14:15:45], Juan Quintela wrote: > > Hi Amit Hey Juan, > Checking migration, I just found this problem: > > I don't know what to put there. a return -EINVAL or continue? > Looking more at the code, I am not sure what checks: > > a- that bus->max_nr_ports is the same in both sides (or at least bigger > on migration destination) Yes, we should check for this. > b- We sent the value of config.nr_ports, but ... we assign it back on > destination, instead of checking that they are the same. This is done to accomodate for hot-plug/unplug. nr_ports will go up / down after those operations. (Current implementation only increases this value, on hotplug operations. On hot-unplug, this value is not decremented.) > c- port->id is taken from nr_ports again, and nothing checks that ports > appear in the same order in source and destination. Actually, this has me thinking about how would this work: - start vm with 3 ports - hotplug 2 more ports - migrate Would the destination have 5 ports, or would it have 3? I thought qdev would take care of this scenario (hotplug). I don't think I've tested this, so I'll do this soon, but in case anyone knows the answer, please let me know. [snipped patch that's necessary in case qdev doesn't handle this kind of hotplug] Amit -- http://log.amitshah.net/