summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/about/deprecated.rst10
-rw-r--r--qapi/machine.json7
-rw-r--r--qapi/qdev.json27
-rw-r--r--stubs/qdev.c7
4 files changed, 49 insertions, 2 deletions
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 3c2be84d80..2f7db9a98d 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -238,6 +238,16 @@ The ``I7200`` guest CPU relies on the nanoMIPS ISA, which is deprecated
(the ISA has never been upstreamed to a compiler toolchain). Therefore
this CPU is also deprecated.
+
+QEMU API (QAPI) events
+----------------------
+
+``MEM_UNPLUG_ERROR`` (since 6.2)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead.
+
+
System emulator machines
------------------------
diff --git a/qapi/machine.json b/qapi/machine.json
index 32d47f4e35..66bc34ed8b 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -1305,6 +1305,10 @@
#
# @msg: Informative message
#
+# Features:
+# @deprecated: This event is deprecated. Use @DEVICE_UNPLUG_GUEST_ERROR
+# instead.
+#
# Since: 2.4
#
# Example:
@@ -1317,7 +1321,8 @@
#
##
{ 'event': 'MEM_UNPLUG_ERROR',
- 'data': { 'device': 'str', 'msg': 'str' } }
+ 'data': { 'device': 'str', 'msg': 'str' },
+ 'features': ['deprecated'] }
##
# @SMPConfiguration:
diff --git a/qapi/qdev.json b/qapi/qdev.json
index 0e9cb2ae88..d75e68908b 100644
--- a/qapi/qdev.json
+++ b/qapi/qdev.json
@@ -84,7 +84,9 @@
# This command merely requests that the guest begin the hot removal
# process. Completion of the device removal process is signaled with a
# DEVICE_DELETED event. Guest reset will automatically complete removal
-# for all devices.
+# for all devices. If a guest-side error in the hot removal process is
+# detected, the device will not be removed and a DEVICE_UNPLUG_GUEST_ERROR
+# event is sent. Some errors cannot be detected.
#
# Since: 0.14
#
@@ -124,3 +126,26 @@
##
{ 'event': 'DEVICE_DELETED',
'data': { '*device': 'str', 'path': 'str' } }
+
+##
+# @DEVICE_UNPLUG_GUEST_ERROR:
+#
+# Emitted when a device hot unplug fails due to a guest reported error.
+#
+# @device: the device's ID if it has one
+#
+# @path: the device's QOM path
+#
+# Since: 6.2
+#
+# Example:
+#
+# <- { "event": "DEVICE_UNPLUG_GUEST_ERROR"
+# "data": { "device": "core1",
+# "path": "/machine/peripheral/core1" },
+# },
+# "timestamp": { "seconds": 1615570772, "microseconds": 202844 } }
+#
+##
+{ 'event': 'DEVICE_UNPLUG_GUEST_ERROR',
+ 'data': { '*device': 'str', 'path': 'str' } }
diff --git a/stubs/qdev.c b/stubs/qdev.c
index 92e6143134..187659f707 100644
--- a/stubs/qdev.c
+++ b/stubs/qdev.c
@@ -21,3 +21,10 @@ void qapi_event_send_device_deleted(bool has_device,
{
/* Nothing to do. */
}
+
+void qapi_event_send_device_unplug_guest_error(bool has_device,
+ const char *device,
+ const char *path)
+{
+ /* Nothing to do. */
+}