[PATCH v1 03/11] qemu: command: Add virReportEnumRangeError to BuildHostdevCommandline

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

 



Adding the 'default' case to our enum-typecasted switches is the current
safety trend, so add it here for mdevs too.

Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 78c18440e5..1e5d7f9ccf 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5397,10 +5397,10 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
                 }
                 break;
             case VIR_MDEV_MODEL_TYPE_LAST:
-                virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("unexpected vfio type '%d'"), subsys->u.mdev.model);
+            default:
+                virReportEnumRangeError(virMediatedDeviceModelType,
+                                        subsys->u.mdev.model);
                 return -1;
-                break;
             }
 
             virCommandAddArg(cmd, "-device");
-- 
2.14.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