[libvirt] [PATCH v5 01/12] conf: Assign explicit value to VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE

Andrea Bolognani posted 12 patches 7 years, 2 months ago
There is a newer version of this series
[libvirt] [PATCH v5 01/12] conf: Assign explicit value to VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
Posted by Andrea Bolognani 7 years, 2 months ago
Pretty much any reasonable compiler would do this automatically,
but there's no harm in being explicit about it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/conf/domain_conf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 368f16f3fb..a04f96169c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -700,7 +700,7 @@ typedef enum {
 } virDomainControllerModelPCI;
 
 typedef enum {
-    VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE,
+    VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE = 0,
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCI_BRIDGE,
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I82801B11_BRIDGE,
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420,
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v5 01/12] conf: Assign explicit value to VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
Posted by Laine Stump 7 years, 2 months ago
On 03/02/2018 10:13 AM, Andrea Bolognani wrote:
> Pretty much any reasonable compiler would do this automatically,
> but there's no harm in being explicit about it.
>
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  src/conf/domain_conf.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index 368f16f3fb..a04f96169c 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -700,7 +700,7 @@ typedef enum {
>  } virDomainControllerModelPCI;
>  
>  typedef enum {
> -    VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE,
> +    VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE = 0,
>      VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCI_BRIDGE,
>      VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I82801B11_BRIDGE,
>      VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420,

I'm not sure why you want it, but don't see any harm (if it's for
consistency, there are many other enums that don't explicitly list the
first item as 0).

Reviewed-by: Laine Stump <laine@laine.org>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list