On 02/20/2018 12:08 PM, Daniel P. Berrangé wrote:
Ensure all enum cases are listed in switch statements, or cast away
enum type in places where we don't wish to cover all cases.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_command.c | 26 ++++++++++++++++++--------
src/qemu/qemu_domain.c | 21 +++++++++++++++++++++
src/qemu/qemu_driver.c | 25 +++++++++++++++++--------
src/qemu/qemu_hotplug.c | 33 ++++++++++++++++++++++++++++-----
src/qemu/qemu_migration.c | 11 ++++++++++-
src/qemu/qemu_process.c | 2 ++
6 files changed, 96 insertions(+), 22 deletions(-)
[...]
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 99d58325cb..2d92d38936 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1468,11 +1468,20 @@ qemuMigrationJobName(virDomainObjPtr vm)
switch (priv->job.asyncJob) {
case QEMU_ASYNC_JOB_MIGRATION_OUT:
- return _("migration job");
+ return _("migration out job");
case QEMU_ASYNC_JOB_SAVE:
return _("domain save job");
case QEMU_ASYNC_JOB_DUMP:
return _("domain core dump job");
+ case QEMU_ASYNC_JOB_NONE:
+ return _("no job");
Note from previous review applies...
Can this be "undefined" instead of "no"? Looking at the caller you
could get output such as "operation failed: no job: %s" where %s could
be "is not active", "unexpectedly failed", "canceled by
client", or
"failed due to I/O error"
Could also just lump it in with LAST and default.
+ case QEMU_ASYNC_JOB_MIGRATION_IN:
+ return _("migration in job");
+ case QEMU_ASYNC_JOB_SNAPSHOT:
+ return _("snapshot job");
+ case QEMU_ASYNC_JOB_START:
+ return _("start job");
+ case QEMU_ASYNC_JOB_LAST:
default:
return _("job");
}
[...]
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
John