[PATCH] conf: report enum errors in virDomainInputDefValidate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit deb057f added a switch without a default case.
Add it and call virReportEnumRangeError for _LAST too.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index bde9fef914..8cb28a0880 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5760,7 +5760,6 @@ virDomainInputDefValidate(const virDomainInputDef *input)
         case VIR_DOMAIN_INPUT_TYPE_MOUSE:
         case VIR_DOMAIN_INPUT_TYPE_TABLET:
         case VIR_DOMAIN_INPUT_TYPE_KBD:
-        case VIR_DOMAIN_INPUT_TYPE_LAST:
             if (input->source.evdev) {
                  virReportError(VIR_ERR_XML_ERROR, "%s",
                                 _("setting source evdev path only supported for "
@@ -5771,6 +5770,11 @@ virDomainInputDefValidate(const virDomainInputDef *input)
 
         case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH:
             break;
+
+        case VIR_DOMAIN_INPUT_TYPE_LAST:
+        default:
+            virReportEnumRangeError(virDomainInputType, input->type);
+            return -1;
     }
 
     return 0;
-- 
2.16.4

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux