From: Alex Williamson <alex.williamson@redhat.com>
To: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Cc: izumi.taku@jp.fujitsu.com, qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <1423586371.22865.812.camel@redhat.com> (raw)
In-Reply-To: <d5318d00525c9347ca49b7922a35381d6a84afb5.1423551266.git.chen.fan.fnst@cn.fujitsu.com>
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 <chen.fan.fnst@cn.fujitsu.com>
> ---
> 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;
next prev parent reply other threads:[~2015-02-10 16:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 7:03 [Qemu-devel] [RFC v3 00/10] pass aer error to guest for vfio device Chen Fan
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 01/10] pcie_aer: fix typos in pcie_aer_inject_error comment Chen Fan
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 02/10] aer: fix a wrong init PCI_ERR_COR_STATUS w1cmask type register Chen Fan
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 03/10] aer: introduce pcie_aer_setup to setup aer related bits Chen Fan
2015-02-10 16:39 ` Alex Williamson
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 04/10] vfio: add pcie extanded capability support Chen Fan
2015-02-10 16:39 ` Alex Williamson
2015-02-26 9:37 ` Chen Fan
2015-02-26 22:28 ` Alex Williamson
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 05/10] pcie_aer: expose pcie_aer_msg() interface Chen Fan
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 06/10] piix: disable all vfio device aercap property Chen Fan
2015-02-10 16:39 ` Alex Williamson
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 07/10] vfio_pci: change vfio device features bit macro to enum definition Chen Fan
2015-02-10 16:39 ` Alex Williamson [this message]
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 08/10] vfio-pci: add VFIO_FEATURE_ENABLE_AER_CAP feature Chen Fan
2015-02-10 16:39 ` Alex Williamson
2015-02-26 6:46 ` Chen Fan
2015-02-26 22:18 ` Alex Williamson
2015-03-02 7:23 ` Chen Fan
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 09/10] vfio-pci: pass the aer error to guest Chen Fan
2015-02-10 7:03 ` [Qemu-devel] [RFC v3 10/10] pcie_aer: fix a trivial typo in PCIEAERMsg comments Chen Fan
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=1423586371.22865.812.camel@redhat.com \
--to=alex.williamson@redhat.com \
--cc=chen.fan.fnst@cn.fujitsu.com \
--cc=izumi.taku@jp.fujitsu.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).