[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v1 13/26] kvm: vmi: block the object destruction if the chard
From: |
Adalbert Lazăr |
Subject: |
[RFC PATCH v1 13/26] kvm: vmi: block the object destruction if the chardev is connected |
Date: |
Wed, 15 Apr 2020 03:59:25 +0300 |
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 <address@hidden>
---
accel/kvm/vmi.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/accel/kvm/vmi.c b/accel/kvm/vmi.c
index f456ca56ef..2ce8a60565 100644
--- a/accel/kvm/vmi.c
+++ b/accel/kvm/vmi.c
@@ -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)
- Re: [RFC PATCH v1 03/26] char-socket: fix the client mode when created through QMP, (continued)
- [RFC PATCH v1 08/26] kvm: add VM introspection usage documentation, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 04/26] char-socket: add 'reconnecting' property, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 06/26] E820: extend the table access interface, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 07/26] linux-headers: update with VM introspection interface, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 05/26] char-socket: add 'fd' property, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 13/26] kvm: vmi: block the object destruction if the chardev is connected,
Adalbert Lazăr <=
- [RFC PATCH v1 09/26] kvm: introduce the VM introspection object, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 02/26] char-socket: allow vsock parameters (cid, port), Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 01/26] chardev: tcp: allow to change the reconnect timer, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 14/26] kvm: vmi: allow only one instance of the introspection object, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 11/26] kvm: vmi: add 'handshake_timeout' property, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 15/26] kvm: vmi: reconnect the socket on reset, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 19/26] kvm: vmi: intercept force-reset, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 22/26] kvm: vmi: add 'async_unhook' property, Adalbert Lazăr, 2020/04/14