Commit 21df5e4f authored by Greg Kurz's avatar Greg Kurz Committed by David Gibson
Browse files

spapr: Forbid setting ic-mode for old machine types



Machine types 3.0 and older only know about the legacy XICS backend.
Make it clear by erroring out if the user tries to set ic-mode on
such machines.

Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
Tested-by: default avatarCédric Le Goater <clg@kaod.org>
Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 1ac24c91
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3127,6 +3127,11 @@ static void spapr_set_ic_mode(Object *obj, const char *value, Error **errp)
{
    sPAPRMachineState *spapr = SPAPR_MACHINE(obj);

    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
        error_setg(errp, "This machine only uses the legacy XICS backend, don't pass ic-mode");
        return;
    }

    /* The legacy IRQ backend can not be set */
    if (strcmp(value, "xics") == 0) {
        spapr->irq = &spapr_irq_xics;