monitor: reject attempts to delete the current monitor
If an 'object_del' command for a QMP monitor arrives targetting the current monitor, reject this request. If the current monitor is deleted, it will be impossible to send any reply and the client won't be able to remove the corresponding chardev backend. Note, it is not possible to rely on checking monitor_cur() because if 'object_del' is called via human-monitor-command, monitor_cur() will reflect the temporary HMP, not the QMP target that needs to be checked. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org> [DB: extracted monitor tracking from larger commit; added logic to monitor_qmp_prepare_delete to reject request] Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20260706135824.2623960-26-berrange@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>