From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [patch 1/2] kvm tools: Gather Virtio-PCI constants into one place Date: Fri, 06 May 2011 00:09:33 +0400 Message-ID: <4DC303FD.3080103@gmail.com> References: <20110505190639.741709609@gmail.com> <20110505190733.367888565@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: mingo@elte.hu, asias.hejun@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org, levinsasha928@gmail.com To: penberg@kernel.org Return-path: Received: from mail-ew0-f46.google.com ([209.85.215.46]:55432 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753310Ab1EEUJi (ORCPT ); Thu, 5 May 2011 16:09:38 -0400 Received: by ewy4 with SMTP id 4so779828ewy.19 for ; Thu, 05 May 2011 13:09:36 -0700 (PDT) In-Reply-To: <20110505190733.367888565@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/05/2011 11:06 PM, Cyrill Gorcunov wrote: > It's better than have them sprinkled in.c files. Note > that pin for ring device is changed so it no longer shared > with block device (it is done in a sake of simplicity). > > Also comment style if a bit tuned up in virtio-pci.h > just to be consistent. > > Reported-by: Ingo Molnar > Signed-off-by: Cyrill Gorcunov > --- ... > + > +enum { > + VIRTIO_BLK_PIN = 1, > + VIRTIO_CONSOLE_PIN = 2, > + VIRTIO_NET_PIN = 3, > + VIRTIO_RNG_PIN = 4, > +}; > + Btw, probably the better way would be to make it like that enum { PCI_INTA = 1, PCI_INTB = 2, PCI_INTC = 3, PCI_INTD = 4, }; enum { VIRTIO_BLK_PIN = PCI_INTA, VIRTIO_CONSOLE_PIN = PCI_INTB, VIRTIO_NET_PIN = PCI_INTC, VIRTIO_RNG_PIN = PCI_INTD, }; So we would know the connection way and pin shares if needed. -- Thanks, Cyrill