From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOzZp-0003CG-Sy for qemu-devel@nongnu.org; Thu, 09 Jul 2009 15:46:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOzZl-0003BA-BT for qemu-devel@nongnu.org; Thu, 09 Jul 2009 15:46:41 -0400 Received: from [199.232.76.173] (port=58311 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOzZl-0003Aw-66 for qemu-devel@nongnu.org; Thu, 09 Jul 2009 15:46:37 -0400 Received: from mx2.redhat.com ([66.187.237.31]:56671) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOzZk-00045d-Il for qemu-devel@nongnu.org; Thu, 09 Jul 2009 15:46:36 -0400 Date: Thu, 9 Jul 2009 22:45:51 +0300 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] [PATCH 3/5] qdev/compat: virtio-blk-pci 0.10 compatibility. Message-ID: <20090709194551.GE4351@redhat.com> References: <1247144553-8951-1-git-send-email-kraxel@redhat.com> <1247144553-8951-4-git-send-email-kraxel@redhat.com> <20090709145215.GC26895@redhat.com> <4A560835.3050108@redhat.com> <20090709182032.GA4351@redhat.com> <5b31733c0907091242yff2e16ao52add3295a69bf3e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <5b31733c0907091242yff2e16ao52add3295a69bf3e@mail.gmail.com> Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Filip Navara Cc: Gerd Hoffmann , qemu-devel@nongnu.org On Thu, Jul 09, 2009 at 09:42:47PM +0200, Filip Navara wrote: > On Thu, Jul 9, 2009 at 8:20 PM, Michael S. Tsirkin wrot= e: > > On Thu, Jul 09, 2009 at 05:09:41PM +0200, Gerd Hoffmann wrote: > >> On 07/09/09 16:52, Michael S. Tsirkin wrote: > >>>> =A0 =A0 =A0 .compat_props =3D (CompatProperty[]) { > >>>> + =A0 =A0 =A0 =A0{ > >>>> + =A0 =A0 =A0 =A0 =A0 =A0.driver =A0 =3D "virtio-blk-pci", > >>>> + =A0 =A0 =A0 =A0 =A0 =A0.property =3D "class", > >>>> + =A0 =A0 =A0 =A0 =A0 =A0.value =A0 =A0=3D "0x0180", /* PCI_CLASS_= STORAGE_OTHER */ > >>> > >>> it seems annoying that we can't use the symbolic name. Ideas how to= fix this? > >> > >> We could add a special property type instead of using hex32. =A0Then= we > >> can have a string <-> int mapping and use something like > >> > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0.value =3D "storage-other", > >> > >> Not sure it is worth the trouble though. > >> > >>>> - > >>>> - =A0 =A0uint16_t vendor; > >>>> - =A0 =A0uint16_t device; > >>>> - =A0 =A0uint16_t subvendor; > >>>> - =A0 =A0uint16_t class_code; > >>>> - =A0 =A0uint8_t pif; > >>> > >>> Are the other fields unused? If yes can be a separate patch ... > >> > >> Yes, they are all unused to date. =A0This patch puts class_code into= use. > >> > >>>> + =A0 =A0if (proxy->class_code !=3D PCI_CLASS_STORAGE_SCSI&& > >>>> + =A0 =A0 =A0 =A0proxy->class_code !=3D PCI_CLASS_STORAGE_OTHER) > >>>> + =A0 =A0 =A0 =A0proxy->class_code =3D PCI_CLASS_STORAGE_SCSI; > >>>> + > >>> > >>> what does this do? > >> > >> Make sure proxy->class_code has one of the two allowed values. > >> > >>>> =A0 =A0 =A0 vdev =3D virtio_blk_init(&pci_dev->qdev); > >>>> =A0 =A0 =A0 virtio_init_pci(proxy, vdev, > >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PCI_VENDOR_ID_REDHAT_Q= UMRANET, > >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PCI_DEVICE_ID_VIRTIO_B= LOCK, > >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PCI_CLASS_STORAGE_OTHER, > >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A00x00); > >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0proxy->class_code, 0x00); > >>>> =A0 } > >>>> > >>>> =A0 static void virtio_console_init_pci(PCIDevice *pci_dev) > >>> > >>> does this mean that virtio block was broken by some previous > >>> patch? It's not a good way to split changes: bisecting won't work. > >> > >> Huh? =A0virtio block wasn't broken. =A0What makes you think it was? > >> > >> cheers, > >> =A0 Gerd > > > > This is adding a parameter to a function. Before this patch it was mi= ssing > > this parameter so was broken? > > > It is not! Two parameters removed, two added. >=20 Looks like my eyes need to be checked. Sorry about the noise. --=20 MST