* [Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip
@ 2016-07-13 18:11 Greg Kurz
2016-07-13 18:49 ` Greg Kurz
2016-07-13 20:03 ` Eduardo Habkost
0 siblings, 2 replies; 3+ messages in thread
From: Greg Kurz @ 2016-07-13 18:11 UTC (permalink / raw)
To: marcel, ehabkost; +Cc: qemu-devel
We're not supposed to abort when the user passes a bogus value.
Since the ckecing 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>
---
hw/core/machine.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2fe6ff6f3007..e5a456f21dd9 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();
}
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip
2016-07-13 18:11 [Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip Greg Kurz
@ 2016-07-13 18:49 ` Greg Kurz
2016-07-13 20:03 ` Eduardo Habkost
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2016-07-13 18:49 UTC (permalink / raw)
To: marcel, ehabkost; +Cc: qemu-devel
On Wed, 13 Jul 2016 20:11:45 +0200
Greg Kurz <groug@kaod.org> wrote:
> We're not supposed to abort when the user passes a bogus value.
> Since the ckecing is done in visit_type_OnOffSplit(), the call to
s/ckecing/checking :)
> abort() is legitimate. Let's add a comment to make it explicit.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> hw/core/machine.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 2fe6ff6f3007..e5a456f21dd9 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();
> }
> }
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip
2016-07-13 18:11 [Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip Greg Kurz
2016-07-13 18:49 ` Greg Kurz
@ 2016-07-13 20:03 ` Eduardo Habkost
1 sibling, 0 replies; 3+ messages in thread
From: Eduardo Habkost @ 2016-07-13 20:03 UTC (permalink / raw)
To: Greg Kurz; +Cc: marcel, qemu-devel
On Wed, Jul 13, 2016 at 08:11:45PM +0200, Greg Kurz wrote:
> We're not supposed to abort when the user passes a bogus value.
> Since the ckecing 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>
Applied to machine-next, thanks. Although I believe the property
should be changed to use object_property_add_enum() instead.
--
Eduardo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-13 20:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-13 18:11 [Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip Greg Kurz
2016-07-13 18:49 ` Greg Kurz
2016-07-13 20:03 ` Eduardo Habkost
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).