[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v3 07/10] vfio_pci: change vfio device features bi
From: |
Alex Williamson |
Subject: |
Re: [Qemu-devel] [RFC v3 07/10] vfio_pci: change vfio device features bit macro to enum definition |
Date: |
Tue, 10 Feb 2015 09:39:31 -0700 |
On Tue, 2015-02-10 at 15:03 +0800, Chen Fan wrote:
> Introduce an independent enum structure to define the features bitmap,
> it would be good for adding new features definition.
>
> Signed-off-by: Chen Fan <address@hidden>
> ---
> hw/vfio/pci.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 75c932b..bf314a1 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -134,6 +134,12 @@ typedef struct VFIOMSIXInfo {
> void *mmap;
> } VFIOMSIXInfo;
>
> +/* Bits in VFIOPCIDevice features field. */
> +enum {
> +#define VFIO_FEATURE_ENABLE_VGA_BIT 0
> + VFIO_FEATURE_ENABLE_VGA = (1 << VFIO_FEATURE_ENABLE_VGA_BIT),
> +};
> +
As commented last time, I don't see why making this an enum helps
anything. If anything, the bits could be an enum, but it makes no sense
to me to put the feature mask into an enum.
> typedef struct VFIOPCIDevice {
> PCIDevice pdev;
> VFIODevice vbasedev;
> @@ -154,8 +160,6 @@ typedef struct VFIOPCIDevice {
> PCIHostDeviceAddress host;
> EventNotifier err_notifier;
> uint32_t features;
> -#define VFIO_FEATURE_ENABLE_VGA_BIT 0
> -#define VFIO_FEATURE_ENABLE_VGA (1 << VFIO_FEATURE_ENABLE_VGA_BIT)
> int32_t bootindex;
> uint8_t pm_cap;
> bool has_vga;
- [Qemu-devel] [RFC v3 00/10] pass aer error to guest for vfio device, Chen Fan, 2015/02/10
- [Qemu-devel] [RFC v3 03/10] aer: introduce pcie_aer_setup to setup aer related bits, Chen Fan, 2015/02/10
- [Qemu-devel] [RFC v3 02/10] aer: fix a wrong init PCI_ERR_COR_STATUS w1cmask type register, Chen Fan, 2015/02/10
- [Qemu-devel] [RFC v3 06/10] piix: disable all vfio device aercap property, Chen Fan, 2015/02/10
- [Qemu-devel] [RFC v3 01/10] pcie_aer: fix typos in pcie_aer_inject_error comment, Chen Fan, 2015/02/10
- [Qemu-devel] [RFC v3 07/10] vfio_pci: change vfio device features bit macro to enum definition, Chen Fan, 2015/02/10
- Re: [Qemu-devel] [RFC v3 07/10] vfio_pci: change vfio device features bit macro to enum definition,
Alex Williamson <=
- [Qemu-devel] [RFC v3 08/10] vfio-pci: add VFIO_FEATURE_ENABLE_AER_CAP feature, Chen Fan, 2015/02/10
- [Qemu-devel] [RFC v3 04/10] vfio: add pcie extanded capability support, Chen Fan, 2015/02/10
[Qemu-devel] [RFC v3 05/10] pcie_aer: expose pcie_aer_msg() interface, Chen Fan, 2015/02/10
[Qemu-devel] [RFC v3 09/10] vfio-pci: pass the aer error to guest, Chen Fan, 2015/02/10