diff mbox

[PULL,7/9] machine: Add comment to abort path in machine_set_kernel_irqchip

Message ID 1469629761-23274-8-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost July 27, 2016, 2:29 p.m. UTC
From: Greg Kurz <groug@kaod.org>

We're not supposed to abort when the user passes a bogus value.
Since the checking is done in visit_type_OnOffSplit(), the call
to abort() is legitimate. Let's add a comment to make it
explicit.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/core/machine.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2fe6ff6..e5a456f 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -65,6 +65,9 @@  static void machine_set_kernel_irqchip(Object *obj, Visitor *v,
             ms->kernel_irqchip_split = true;
             break;
         default:
+            /* The value was checked in visit_type_OnOffSplit() above. If
+             * we get here, then something is wrong in QEMU.
+             */
             abort();
         }
     }