Re: [libvirt] [PATCH v4 04/25] [NEW] conf: add typedef for anonymous enum used for memballoon device model

2016-10-18 Thread Andrea Bolognani
On Fri, 2016-10-14 at 15:54 -0400, Laine Stump wrote:
> For some reason the values of memballoon model are set using an
> anonymous enum, making it impossible to perform nice tricks like
> demanding there are cases for all possible values in a switch. This
> patch turns the anonymous enum into virDomainMemBalloonModel.
> ---
>  src/conf/domain_conf.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index 3e85ae4..d415d2e 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -1536,13 +1536,13 @@ struct _virDomainRedirFilterDef {
>  virDomainRedirFilterUSBDevDefPtr *usbdevs;
>  };
>  
> -enum {
> +typedef enum {
>  VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO,
>  VIR_DOMAIN_MEMBALLOON_MODEL_XEN,
>  VIR_DOMAIN_MEMBALLOON_MODEL_NONE,
>  
>  VIR_DOMAIN_MEMBALLOON_MODEL_LAST
> -};
> +} virDomainMemBalloonModel;
>  
>  struct _virDomainMemballoonDef {
>  int model;

Great catch!

However, you'll want to

  s/MemBalloon/Memballoon/

because further down the file you can find

  VIR_ENUM_DECL(virDomainMemballoonModel)

I like your name better, by the way, so if you feel like
renameing every instance in a separate patch I'll gladly
review and ACK it :)

ACK with the above taken care of.

-- 
Andrea Bolognani / Red Hat / Virtualization

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

[libvirt] [PATCH v4 04/25] [NEW] conf: add typedef for anonymous enum used for memballoon device model

2016-10-14 Thread Laine Stump
For some reason the values of memballoon model are set using an
anonymous enum, making it impossible to perform nice tricks like
demanding there are cases for all possible values in a switch. This
patch turns the anonymous enum into virDomainMemBalloonModel.
---
 src/conf/domain_conf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3e85ae4..d415d2e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1536,13 +1536,13 @@ struct _virDomainRedirFilterDef {
 virDomainRedirFilterUSBDevDefPtr *usbdevs;
 };
 
-enum {
+typedef enum {
 VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO,
 VIR_DOMAIN_MEMBALLOON_MODEL_XEN,
 VIR_DOMAIN_MEMBALLOON_MODEL_NONE,
 
 VIR_DOMAIN_MEMBALLOON_MODEL_LAST
-};
+} virDomainMemBalloonModel;
 
 struct _virDomainMemballoonDef {
 int model;
-- 
2.7.4

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