From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: RFC qdev path semantics Date: Tue, 22 Jun 2010 09:27:18 -0500 Message-ID: <4C20C846.2050505@codemonkey.ws> References: <20100614054923.879.33717.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alex Williamson , qemu-devel@nongnu.org, chrisw@redhat.com, kvm@vger.kernel.org, paul@codesourcery.com, kraxel@redhat.com, avi@redhat.com To: Markus Armbruster Return-path: Received: from mail-gw0-f46.google.com ([74.125.83.46]:48373 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753129Ab0FVO1R (ORCPT ); Tue, 22 Jun 2010 10:27:17 -0400 Received: by gwaa12 with SMTP id a12so1021380gwa.19 for ; Tue, 22 Jun 2010 07:27:15 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 06/16/2010 04:46 AM, Markus Armbruster wrote: > A number of changes to qdev paths have been proposed in various threads. > It's becoming harder to keep track of them, so let me sum them up in one > place. Please correct me if I misrepresent your ideas. > Honestly, I think we've gone off the deep end here. Let's simplify. We need to uniquely identify ram allocations for the purposes of savevm. Let's do this: qdev has a vmsd property. When the qdev device is initialized, it invokes vmstate_register_with_alias_id. Let's have vmstate_register_with_alias_id return a unique identifier. Today, it should be derived from the section header. In the future, it should be a qdev path (as should the section header). We need have a qdev->vmsd_base. pci_add_option_rom() will pass qdev->vmsd_base + a unique suffix to qemu_ram_alloc() which should be in the form '/suffix'. This suffix only need to identify the ram area uniquely for for pci_add_option_rom, it should probably be '/PCI-ROM'. Today, this means that the ram allocations will be consistent with VMState which is a good thing on the wire. In the future, when we have full qdev conversion, we can easily switch to using qdev paths as the vmsd_base with almost no code change. Regards, Anthony Liguori