On 02/15/2018 11:43 AM, 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 | 28 ++++++++++++++++++++--------
src/qemu/qemu_domain.c | 21 +++++++++++++++++++++
src/qemu/qemu_driver.c | 27 +++++++++++++++++++--------
src/qemu/qemu_hotplug.c | 36 +++++++++++++++++++++++++++++++-----
src/qemu/qemu_migration.c | 11 ++++++++++-
src/qemu/qemu_process.c | 2 ++
6 files changed, 103 insertions(+), 22 deletions(-)
[...]
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 3641b801f6..fe3342b38d 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1437,11 +1437,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");
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 jus 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