From: Konrad Rzeszutek Wilk Subject: Re: [Xen-devel] [PATCH V11 3/8] Introduce XenHostPCIDevice to access a pci device on the host. Date: Wed, 16 May 2012 07:24:45 -0400 Message-ID: <20120516112445.GB21609@andromeda.dapyr.net> References: <1333467163-25795-1-git-send-email-anthony.perard@citrix.com> <1333467163-25795-4-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1333467163-25795-4-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Anthony PERARD Cc: Xen Devel , QEMU-devel , Stefano Stabellini , "Michael S . Tsirkin" List-Id: xen-devel@lists.xenproject.org On Tue, Apr 03, 2012 at 04:32:38PM +0100, Anthony PERARD wrote: > Signed-off-by: Anthony PERARD Looks good, thought I've just couple of tiny comments: > +#define XEN_HOST_PCI_RESSOURCE_BUFFER_SIZE 512 You might want a comment explaining why 512, and not a more precise number like 741. > +{ .. snip.. > + do { > + rc = read(fd, &buf, sizeof (buf) - 1); > + if (rc < 0 && errno != EINTR) { > + rc = -errno; > + goto out; > + } > + } while (rc < 0); Ok, you read it in. Maybe my 'wc' magic is gone, but this is what I get: [root@localhost 0000:00:02.0]# cat resource | wc -c 741 .. snip.. > +#define XEN_HOST_PCI_GET_VALUE_BUFFER_SIZE 42 The answer to the life? Can you provide a comment explaining the reason why it is 42, please? > +static int xen_host_pci_get_value(XenHostPCIDevice *d, const char *name, > + unsigned int *pvalue, int base) > +{