@@ -151,11 +151,19 @@ static bool chardev_is_connected(VMIntrospection *i, Error **errp)
return obj && object_property_get_bool(obj, "connected", errp);
}
+static bool introspection_can_be_deleted(UserCreatable *uc)
+{
+ VMIntrospection *i = VM_INTROSPECTION(uc);
+
+ return !chardev_is_connected(i, NULL);
+}
+
static void class_init(ObjectClass *oc, void *data)
{
UserCreatableClass *uc = USER_CREATABLE_CLASS(oc);
uc->complete = complete;
+ uc->can_be_deleted = introspection_can_be_deleted;
}
static void instance_init(Object *obj)
The introspection tool can modify the VM while it is running (e.g. it can set breakpoints), and when the VM is no longer introspected these changes need to be removed. Until then, we block the destruction of the introspection object that would lead to the unexpected shutdown of the introspection channel. Signed-off-by: Adalbert Lazăr <alazar@bitdefender.com> --- accel/kvm/vmi.c | 8 ++++++++ 1 file changed, 8 insertions(+)