[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V9 5/8] Introduce Xen PCI Passthrough, qdevice (
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH V9 5/8] Introduce Xen PCI Passthrough, qdevice (1/3) |
Date: |
Wed, 21 Mar 2012 22:46:34 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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
- Re: [Qemu-devel] [PATCH V9 3/8] Introduce HostPCIDevice to access a pci device on the host., (continued)
- [Qemu-devel] [PATCH V9 4/8] pci.c: Add opaque argument to pci_for_each_device., Anthony PERARD, 2012/03/21
- [Qemu-devel] [PATCH V9 1/8] pci_ids: Add INTEL_82599_SFP_VF id., Anthony PERARD, 2012/03/21
- [Qemu-devel] [PATCH V9 2/8] configure: Introduce --enable-xen-pci-passthrough., Anthony PERARD, 2012/03/21
- [Qemu-devel] [PATCH V9 6/8] Introduce Xen PCI Passthrough, PCI config space helpers (2/3), Anthony PERARD, 2012/03/21
- [Qemu-devel] [PATCH V9 5/8] Introduce Xen PCI Passthrough, qdevice (1/3), Anthony PERARD, 2012/03/21
- Re: [Qemu-devel] [PATCH V9 5/8] Introduce Xen PCI Passthrough, qdevice (1/3),
Michael S. Tsirkin <=
- [Qemu-devel] [PATCH V9 8/8] Introduce Xen PCI Passthrough, MSI (3/3), Anthony PERARD, 2012/03/21