From: "Michael S. Tsirkin" <mst@redhat.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Guy Zana <guy@neocleus.com>,
Xen Devel <xen-devel@lists.xensource.com>,
Allen Kay <allen.m.kay@intel.com>,
QEMU-devel <qemu-devel@nongnu.org>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Qemu-devel] [PATCH V9 5/8] Introduce Xen PCI Passthrough, qdevice (1/3)
Date: Wed, 21 Mar 2012 22:46:34 +0200 [thread overview]
Message-ID: <20120321204634.GA26460@redhat.com> (raw)
In-Reply-To: <1332354545-17044-6-git-send-email-anthony.perard@citrix.com>
On Wed, Mar 21, 2012 at 06:29:02PM +0000, Anthony PERARD wrote:
> diff --git a/hw/xen_pci_passthrough.h b/hw/xen_pci_passthrough.h
> new file mode 100644
> index 0000000..2c5e83d
> --- /dev/null
> +++ b/hw/xen_pci_passthrough.h
> @@ -0,0 +1,250 @@
> +#ifndef QEMU_HW_XEN_PCI_PASSTHROUGH_H
> +# define QEMU_HW_XEN_PCI_PASSTHROUGH_H
Way overboard. QEMU_HW_ is not needed.
> +
> +#include "qemu-common.h"
> +#include "xen_common.h"
> +#include "pci.h"
> +#include "host-pci-device.h"
> +
> +/* #define PT_LOGGING_ENABLED */
> +/* #define PT_DEBUG_PCI_CONFIG_ACCESS */
Don't keep dead code around esp not in headers.
> +
> +void pt_log(const PCIDevice *d, const char *f, ...) GCC_FMT_ATTR(2, 3);
> +
> +#define PT_ERR(d, _f, _a...) pt_log(d, "%s: Error: " _f, __func__, ##_a)
> +
> +#ifdef PT_LOGGING_ENABLED
> +# define PT_LOG(d, _f, _a...) pt_log(d, "%s: " _f, __func__, ##_a)
> +# define PT_WARN(d, _f, _a...) pt_log(d, "%s: Warning: " _f, __func__, ##_a)
> +#else
> +# define PT_LOG(d, _f, _a...)
> +# define PT_WARN(d, _f, _a...)
> +#endif
> +
> +#ifdef PT_DEBUG_PCI_CONFIG_ACCESS
> +# define PT_LOG_CONFIG(d, addr, val, len) \
> + pt_log(d, "%s: address=0x%04x val=0x%08x len=%d\n", \
> + __func__, addr, val, len)
> +#else
> +# define PT_LOG_CONFIG(d, addr, val, len)
> +#endif
There's no reason not to prefix xen things with XEN_PT_
xen_pt_ etc.
And if you make names consistens with file names
naming files xen_pt_xxxx.x, people will know where to look for them.
--
MST
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Guy Zana <guy@neocleus.com>,
Xen Devel <xen-devel@lists.xensource.com>,
Allen Kay <allen.m.kay@intel.com>,
QEMU-devel <qemu-devel@nongnu.org>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH V9 5/8] Introduce Xen PCI Passthrough, qdevice (1/3)
Date: Wed, 21 Mar 2012 22:46:34 +0200 [thread overview]
Message-ID: <20120321204634.GA26460@redhat.com> (raw)
In-Reply-To: <1332354545-17044-6-git-send-email-anthony.perard@citrix.com>
On Wed, Mar 21, 2012 at 06:29:02PM +0000, Anthony PERARD wrote:
> diff --git a/hw/xen_pci_passthrough.h b/hw/xen_pci_passthrough.h
> new file mode 100644
> index 0000000..2c5e83d
> --- /dev/null
> +++ b/hw/xen_pci_passthrough.h
> @@ -0,0 +1,250 @@
> +#ifndef QEMU_HW_XEN_PCI_PASSTHROUGH_H
> +# define QEMU_HW_XEN_PCI_PASSTHROUGH_H
Way overboard. QEMU_HW_ is not needed.
> +
> +#include "qemu-common.h"
> +#include "xen_common.h"
> +#include "pci.h"
> +#include "host-pci-device.h"
> +
> +/* #define PT_LOGGING_ENABLED */
> +/* #define PT_DEBUG_PCI_CONFIG_ACCESS */
Don't keep dead code around esp not in headers.
> +
> +void pt_log(const PCIDevice *d, const char *f, ...) GCC_FMT_ATTR(2, 3);
> +
> +#define PT_ERR(d, _f, _a...) pt_log(d, "%s: Error: " _f, __func__, ##_a)
> +
> +#ifdef PT_LOGGING_ENABLED
> +# define PT_LOG(d, _f, _a...) pt_log(d, "%s: " _f, __func__, ##_a)
> +# define PT_WARN(d, _f, _a...) pt_log(d, "%s: Warning: " _f, __func__, ##_a)
> +#else
> +# define PT_LOG(d, _f, _a...)
> +# define PT_WARN(d, _f, _a...)
> +#endif
> +
> +#ifdef PT_DEBUG_PCI_CONFIG_ACCESS
> +# define PT_LOG_CONFIG(d, addr, val, len) \
> + pt_log(d, "%s: address=0x%04x val=0x%08x len=%d\n", \
> + __func__, addr, val, len)
> +#else
> +# define PT_LOG_CONFIG(d, addr, val, len)
> +#endif
There's no reason not to prefix xen things with XEN_PT_
xen_pt_ etc.
And if you make names consistens with file names
naming files xen_pt_xxxx.x, people will know where to look for them.
--
MST
next prev parent reply other threads:[~2012-03-21 20:46 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-21 18:28 [Qemu-devel] [PATCH V9 0/8] Xen PCI Passthrough Anthony PERARD
2012-03-21 18:28 ` Anthony PERARD
2012-03-21 18:28 ` [Qemu-devel] [PATCH V9 1/8] pci_ids: Add INTEL_82599_SFP_VF id Anthony PERARD
2012-03-21 18:28 ` Anthony PERARD
2012-03-22 10:46 ` [Qemu-devel] " Stefano Stabellini
2012-03-22 10:46 ` Stefano Stabellini
2012-03-21 18:28 ` [Qemu-devel] [PATCH V9 2/8] configure: Introduce --enable-xen-pci-passthrough Anthony PERARD
2012-03-21 18:28 ` Anthony PERARD
2012-03-21 18:29 ` [Qemu-devel] [PATCH V9 3/8] Introduce HostPCIDevice to access a pci device on the host Anthony PERARD
2012-03-21 18:29 ` Anthony PERARD
2012-03-21 18:32 ` [Qemu-devel] " Michael S. Tsirkin
2012-03-21 18:32 ` Michael S. Tsirkin
2012-03-21 18:48 ` [Qemu-devel] " Anthony PERARD
2012-03-21 18:48 ` Anthony PERARD
2012-03-21 20:30 ` [Qemu-devel] " Michael S. Tsirkin
2012-03-21 20:30 ` Michael S. Tsirkin
2012-03-23 13:56 ` [Qemu-devel] " Anthony PERARD
2012-03-23 13:56 ` Anthony PERARD
2012-03-21 18:29 ` [Qemu-devel] [PATCH V9 4/8] pci.c: Add opaque argument to pci_for_each_device Anthony PERARD
2012-03-21 18:29 ` Anthony PERARD
2012-03-22 10:50 ` [Qemu-devel] " Stefano Stabellini
2012-03-22 10:50 ` Stefano Stabellini
2012-03-21 18:29 ` [Qemu-devel] [PATCH V9 5/8] Introduce Xen PCI Passthrough, qdevice (1/3) Anthony PERARD
2012-03-21 18:29 ` Anthony PERARD
2012-03-21 20:46 ` Michael S. Tsirkin [this message]
2012-03-21 20:46 ` Michael S. Tsirkin
2012-03-22 12:23 ` [Qemu-devel] " Anthony PERARD
2012-03-22 12:23 ` Anthony PERARD
2012-03-21 18:29 ` [Qemu-devel] [PATCH V9 6/8] Introduce Xen PCI Passthrough, PCI config space helpers (2/3) Anthony PERARD
2012-03-21 18:29 ` Anthony PERARD
2012-03-21 18:29 ` [Qemu-devel] [PATCH V9 7/8] Introduce apic-msidef.h Anthony PERARD
2012-03-21 18:29 ` Anthony PERARD
2012-03-21 18:29 ` [Qemu-devel] [PATCH V9 8/8] Introduce Xen PCI Passthrough, MSI (3/3) Anthony PERARD
2012-03-21 18:29 ` Anthony PERARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120321204634.GA26460@redhat.com \
--to=mst@redhat.com \
--cc=allen.m.kay@intel.com \
--cc=anthony.perard@citrix.com \
--cc=guy@neocleus.com \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.