[libvirt] [PATCH v2 06/42] libxl: handle missing switch enum cases

Daniel P. Berrangé posted 42 patches 7 years, 11 months ago
[libvirt] [PATCH v2 06/42] libxl: handle missing switch enum cases
Posted by Daniel P. Berrangé 7 years, 11 months ago
Cast away enum type for libxl schedular constants since we don't want to
cover all of them and don't want build to break when new ones are added.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/libxl/libxl_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index be11134fb2..4b52de36f5 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -4497,7 +4497,7 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
 
     if (nparams)
         *nparams = 0;
-    switch (sched_id) {
+    switch ((int)sched_id) {
     case LIBXL_SCHEDULER_SEDF:
         name = "sedf";
         break;
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 06/42] libxl: handle missing switch enum cases
Posted by John Ferlan 7 years, 11 months ago

On 02/15/2018 11:43 AM, Daniel P. Berrangé wrote:
> Cast away enum type for libxl schedular constants since we don't want to
> cover all of them and don't want build to break when new ones are added.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/libxl/libxl_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

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