From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOtjf-0002FN-2l for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:32:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOtjZ-0002E6-BP for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:32:26 -0400 Received: from [199.232.76.173] (port=39289 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOtjX-0002Dw-HV for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:32:20 -0400 Received: from mx2.redhat.com ([66.187.237.31]:56916) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOtjX-0006zo-56 for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:32:19 -0400 Subject: Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x From: Mark McLoughlin In-Reply-To: <4A55BFE7.4070402@redhat.com> References: <1244821292.30522.56.camel@blaa> <4A3636FA.1040609@redhat.com> <20090615124101.GH6351@redhat.com> <4A364381.401@redhat.com> <4A364401.6010500@codemonkey.ws> <4A3647FB.9010808@redhat.com> <4A364B53.9080007@codemonkey.ws> <4A364FE0.40204@redhat.com> <4A3651EB.3070204@codemonkey.ws> <4A36555A.4090303@redhat.com> <4A3659A0.3050108@codemonkey.ws> <4A366348.1030202@redhat.com> <1245083229.3222.103.camel@blaa> <4A368F12.2090504@codemonkey.ws> <1246964898.2836.38.camel@blaa> <1246964950.2836.39.camel@blaa> <1246964998.2836.40.camel@blaa> <1246965054.2836.41.camel@blaa> <4A5338FC.9030301@redhat.com> <1247049984.3270.52.camel@blaa> <1247050083.3270.54.camel@blaa> <4A54986D.301@redhat.com> <4A54A2B0.6050605@codemonk! ey.ws> <4A54A895.5090501@redhat.com> <1247065728.3270.65.camel@blaa> <4A54EE87.2000508@redhat.com> <4A55136E.6050508@codemonkey.ws> <4A55A29A.9020202@redhat.com> <1247128775.22231.15.camel@blaa> <4A55B2E8.4060109@redhat.com> <4A55BFE7.4070402@redhat.com> Content-Type: text/plain Date: Thu, 09 Jul 2009 14:31:55 +0100 Message-Id: <1247146315.22231.128.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Avi Kivity , qemu-devel@nongnu.org On Thu, 2009-07-09 at 12:01 +0200, Gerd Hoffmann wrote: > I'd prefer to not introduce those virtio-$type-pci-$version devices in > the first place. Ah, I see why ... with your -device stuff, these new devices types would become part of the public interface. If they were to be public, we'd probably want them to become virtio-$type-pci-$feature instead. As pointed out before, that becomes cumbersome. > diff --git a/hw/pc.c b/hw/pc.c > index 38678da..cd64ccf 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -1460,6 +1460,21 @@ static QEMUMachine pc_machine = { > .is_default = 1, > }; > > +static QEMUMachine pc_machine_v0_10 = { > + .name = "pc-0.10", > + .desc = "Standard PC, qemu 0.10", > + .init = pc_init_pci, > + .max_cpus = 255, > + .compat_props = (CompatProperty[]) { > + { > + .driver = "virtio-blk-pci", > + .property = "class", > + .value = "0x0180", /* PCI_CLASS_STORAGE_OTHER */ > + }, > + { /* end of list */ } > + }, > +}; I did actually experiment with something similar to this, but backed off because I didn't like putting such details (i.e. the class value) in hw/pc.c rather than keeping them self contained in the driver code. Especially since it'll have to be replicated for every machine which can use the device. Hmm, if this was a machine config file, would be do something like "include compat-props-0.10.conf"? Maybe something similar is in order here? Cheers, Mark.