The sPAPR XIVE device is created by the machine in spapr_irq_init().
The latter overrides any value provided by the user with -global for
the "nr-irqs" and "nr-ends" properties with strictly positive values.
It seems reasonable to assume these properties should never be 0,
which wouldn't make much sense by the way.
Signed-off-by: Greg Kurz <[email protected]>
Message-Id: <
20201120174646[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Signed-off-by: David Gibson <[email protected]>
XiveENDSource *end_xsrc = &xive->end_source;
Error *local_err = NULL;
+ /* Set by spapr_irq_init() */
+ g_assert(xive->nr_irqs);
+ g_assert(xive->nr_ends);
+
sxc->parent_realize(dev, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
- if (!xive->nr_irqs) {
- error_setg(errp, "Number of interrupt needs to be greater 0");
- return;
- }
-
- if (!xive->nr_ends) {
- error_setg(errp, "Number of interrupt needs to be greater 0");
- return;
- }
-
/*
* Initialize the internal sources, for IPIs and virtual devices.
*/