Message ID | 20211029230147.2465055-2-philmd@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | hw/core: Remove uses of obsolete QERR_ definitions | expand |
Philippe Mathieu-Daudé <philmd@redhat.com> writes: > QERR_UNSUPPORTED definition is obsolete since 2015 (commit > 4629ed1e989, "qerror: Finally unused, clean up"). Replace it. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/core/nmi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/core/nmi.c b/hw/core/nmi.c > index 481c4b3c7e5..b4b4a1ed286 100644 > --- a/hw/core/nmi.c > +++ b/hw/core/nmi.c > @@ -70,7 +70,7 @@ void nmi_monitor_handle(int cpu_index, Error **errp) > if (ns.handled) { > error_propagate(errp, ns.err); > } else { > - error_setg(errp, QERR_UNSUPPORTED); > + error_setg(errp, "This command is not currently supported"); > } > } I think this error message doesn't quite fit here. We error out when the QOM composition tree does not contain an object providing interface "nmi". We don't tell the user, though. This isn't terrible, because the suitable objects are generally created by board code, so whether the command works generally depends only on the machine type. Still, a bit more detail in the error message wouldn't hurt, would it? Say "machine does not support NMIs".
diff --git a/hw/core/nmi.c b/hw/core/nmi.c index 481c4b3c7e5..b4b4a1ed286 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -70,7 +70,7 @@ void nmi_monitor_handle(int cpu_index, Error **errp) if (ns.handled) { error_propagate(errp, ns.err); } else { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "This command is not currently supported"); } }
QERR_UNSUPPORTED definition is obsolete since 2015 (commit 4629ed1e989, "qerror: Finally unused, clean up"). Replace it. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/core/nmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)