[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v1 18/26] kvm: vmi: store/restore 'vm_start_time' on migrate/
From: |
Adalbert Lazăr |
Subject: |
[RFC PATCH v1 18/26] kvm: vmi: store/restore 'vm_start_time' on migrate/snapshot |
Date: |
Wed, 15 Apr 2020 03:59:30 +0300 |
The VM start time sent during handshake can be used by the introspection
tool as a session id.
We save this 'VM start time' with the snapshot in order to be sent again
to the introspection tool when the VM is restored from snapshot and the
introspection connection is reestablished.
Signed-off-by: Adalbert Lazăr <address@hidden>
---
accel/kvm/vmi.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/accel/kvm/vmi.c b/accel/kvm/vmi.c
index 1f3aff3bfe..e511558f3d 100644
--- a/accel/kvm/vmi.c
+++ b/accel/kvm/vmi.c
@@ -20,6 +20,7 @@
#include "crypto/hash.h"
#include "chardev/char.h"
#include "chardev/char-fe.h"
+#include "migration/vmstate.h"
#include "sysemu/vmi-intercept.h"
#include "sysemu/vmi-handshake.h"
@@ -203,6 +204,16 @@ static void class_init(ObjectClass *oc, void *data)
uc->can_be_deleted = introspection_can_be_deleted;
}
+static const VMStateDescription vmstate_introspection = {
+ .name = "vm_introspection",
+ .minimum_version_id = 1,
+ .version_id = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_INT64(vm_start_time, VMIntrospection),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static void instance_init(Object *obj)
{
VMIntrospectionClass *ic = VM_INTROSPECTION_CLASS(obj->class);
@@ -227,6 +238,8 @@ static void instance_init(Object *obj)
object_property_add(obj, "unhook_timeout", "uint32",
prop_set_uint32, prop_get_uint32,
NULL, &i->unhook_timeout, NULL);
+
+ vmstate_register(NULL, 0, &vmstate_introspection, i);
}
static void disconnect_chardev(VMIntrospection *i)
- [RFC PATCH v1 01/26] chardev: tcp: allow to change the reconnect timer, (continued)
- [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
- [RFC PATCH v1 17/26] kvm: vmi: add 'unhook_timeout' property, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 24/26] kvm: vmi: add 'unhook_on_shutdown' property, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 12/26] kvm: vmi: add 'key' property, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 21/26] kvm: vmi: postpone the OK response from qmp_stop(), Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 18/26] kvm: vmi: store/restore 'vm_start_time' on migrate/snapshot,
Adalbert Lazăr <=
- [RFC PATCH v1 23/26] kvm: vmi: intercept shutdown, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 16/26] kvm: vmi: intercept pause/resume, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 25/26] kvm: vmi: extend handshake to include the e820 table, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 26/26] kvm: vmi: add 'command' and 'event' properties, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 10/26] kvm: vmi: add the handshake with the introspection tool, Adalbert Lazăr, 2020/04/14
- [RFC PATCH v1 20/26] kvm: vmi: intercept live migration, Adalbert Lazăr, 2020/04/14