Received: from [140.186.70.92] (port=57682 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEM4V-0005Yf-Su for qemu-devel@nongnu.org; Tue, 18 May 2010 08:38:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEM4T-0005Jc-FA for qemu-devel@nongnu.org; Tue, 18 May 2010 08:38:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59531) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEM4T-0005JS-7O for qemu-devel@nongnu.org; Tue, 18 May 2010 08:38:53 -0400 From: Juan Quintela In-Reply-To: <4BF288BC.40409@redhat.com> (Gerd Hoffmann's message of "Tue, 18 May 2010 14:31:56 +0200") References: <913f4f6a67305a72ed3d994bd12d5b34de9b9bb9.1273843151.git.jan.kiszka@siemens.com> <4BF288BC.40409@redhat.com> Date: Tue, 18 May 2010 14:38:49 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 1/8] qdev: Allow device addressing via 'driver.instance' List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Anthony Liguori , qemu-devel@nongnu.org, Jan Kiszka , Markus Armbruster , Luiz Capitulino , Avi Kivity Gerd Hoffmann wrote: > On 05/18/10 14:15, Markus Armbruster wrote: >> Jan Kiszka writes: >> >>> Extend qbus_find_dev to allow addressing of devices without an unique id >>> via an optional instance number. The new formats are 'driver.instance' >>> and 'alias.instance'. >>> >>> Signed-off-by: Jan Kiszka >> >> How's the instance number defined? Should be documented. > > savevm instance id, used to identify multiple instances of some device > on loadvm. By default is just incrementing (0,1,2,...) for each new > device instance I think. Drivers can also specify one. Most don't do > that. IIRC some ISA drivers use the base ioport as instance id, which > sort-of makes sense as it makes sure the id identifies the correct > device no matter what the initialization order is. > > It probably makes sense to replace the instance id with the device > path once all devices are converted over to qdev+vmstate, so we avoid > the nasty ordering issues altogether. Agreed. The problem here is that we sent the instance_id on the wire, so for "legacy" devices that used an instance_id != -1, we are stuck with it :( Guess why a friend calls "backwards compatibility": A Curse of Bible proportions :( Later, Juan.