diff options
author | Markus Armbruster <armbru@redhat.com> | 2022-12-01 13:11:33 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2022-12-19 16:21:56 +0100 |
commit | e221cfac5935b0fea0989da9ef4ee5024777f23e (patch) | |
tree | d851fe548e6c4a8787d333bbd4d0210e1d90c074 /hw/pci | |
parent | ba235d33e8b5512b75e306899dcb06d0f6660688 (diff) | |
download | qemu-e221cfac5935b0fea0989da9ef4ee5024777f23e.zip qemu-e221cfac5935b0fea0989da9ef4ee5024777f23e.tar.gz qemu-e221cfac5935b0fea0989da9ef4ee5024777f23e.tar.bz2 |
pci: Reject pcie_aer_inject_error -c with symbolic error status
When argument @error_status is symbolic, flag -c is ignored. Reject
it instead.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221201121133.3813857-14-armbru@redhat.com>
Diffstat (limited to 'hw/pci')
-rw-r--r-- | hw/pci/pci-hmp-cmds.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/pci/pci-hmp-cmds.c b/hw/pci/pci-hmp-cmds.c index a292d06..fb7591d 100644 --- a/hw/pci/pci-hmp-cmds.c +++ b/hw/pci/pci-hmp-cmds.c @@ -189,6 +189,11 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict) } error_status = num; correctable = qdict_get_try_bool(qdict, "correctable", false); + } else { + if (qdict_haskey(qdict, "correctable")) { + error_setg(&err, "-c is only valid with numeric error status"); + goto out; + } } aer_err.status = error_status; aer_err.source_id = pci_requester_id(dev); |