From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: Configuration vs. compat hints [was Re: [Qemu-devel] [PATCHv3 03/13] qemu: add routines to manage PCI capabilities] Date: Fri, 12 Jun 2009 09:43:29 +0100 Message-ID: <1244796209.16425.20.camel@blaa> References: <20090610145540.GI19375@poweredge.glommer> <20090610150129.GC28601@redhat.com> <200906101624.30659.paul@codesourcery.com> <20090610174301.GC7416@shareable.org> <20090610182227.GN28601@redhat.com> <20090610192702.GH7416@shareable.org> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , Carsten Otte , kvm@vger.kernel.org, Glauber Costa , Rusty Russell , qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, Blue Swirl , Christian Borntraeger , Paul Brook , Avi Kivity To: Jamie Lokier Return-path: Received: from mx2.redhat.com ([66.187.237.31]:40434 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753561AbZFLIpo (ORCPT ); Fri, 12 Jun 2009 04:45:44 -0400 In-Reply-To: <20090610192702.GH7416@shareable.org> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2009-06-10 at 20:27 +0100, Jamie Lokier wrote: > Michael S. Tsirkin wrote: > > > I think the right long term answer to all this is a way to get QEMU to > > > dump it's current machine configuration in glorious detail as a file > > > which can be reloaded as a machine configuration. > > > > And then we'll have the same set of problems there. > > We will, and the solution will be the same: options to create devices > as they were in older versions of QEMU. It only needs to cover device > features which matter to guests, not every bug fix. > > However with a machine configuration which is generated by QEMU, > there's less worry about proliferation of obscure options, compared > with the command line. You don't necessarily have to document every > backward-compatibility option in any detail, you just have to make > sure it's written and read properly, which is much the same thing as > the snapshot code does. This is a sensible plan, but I don't think we should mix these compat options in with the VM manager supplied configuration. There are two problems with that approach. = Problem 1 - VM manager needs to parse qemu config = Your proposal implies: - VM manager supplies a basic configuration to qemu - It then immediately asks qemu for a dump of the machine configuration in all its glorious detail and retains that config - If the VM manager wishes to add a new device it needs to parse the qemu config and add it, rather than just generate an entirely new config = Problem 2 - We can't predict the future = If a VM manager supplies a configuration which is missing any given option, qemu cannot tell the difference between: - This is a basic config, the VM manager wants whatever the default of the current qemu version - This is a complete config dumped using an old version of qemu, the VM manager wants the old default = Solution - Separate configuration from compat hints = As I suggested before: - Allow the VM manager to dump compat hints; this would be an opaque file format, more like the savevm format than a config file - Use defaults where compat hints are not available; e.g. if the VM manager specifies a device config, but no compat hints are supplied for it, then just use default values - Make the config override compat hints; e.g. if there are compat hints specified for a device not included in the machine config, just ignore those hints Cheers, Mark.