tools/xenstore: add reading global state for live update
authorJuergen Gross <jgross@suse.com>
Wed, 13 Jan 2021 13:00:20 +0000 (14:00 +0100)
committerJuergen Gross <jgross@suse.com>
Thu, 21 Jan 2021 16:31:45 +0000 (17:31 +0100)
Add reading the global state for live update.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Acked-by: Wei Liu <wl@xen.org>
tools/xenstore/xenstored_control.c
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_core.h

index 3bced9e39ecdcad0317a71ee1524247effd54281..d94b558e993c9f5b02ffe0c84cb98b42f2748195 100644 (file)
@@ -536,6 +536,7 @@ void lu_read_state(void)
             head = (void *)head + sizeof(*head) + head->length) {
                switch (head->type) {
                case XS_STATE_TYPE_GLOBAL:
+                       read_state_global(ctx, head + 1);
                        break;
                case XS_STATE_TYPE_CONN:
                        break;
index 4d88aeba3dde21a41997d3a7e908d08738040142..60e98104ad4a2daec524ca94b9d99a83e8cc4049 100644 (file)
@@ -2512,6 +2512,15 @@ const char *dump_state_nodes(FILE *fp, const void *ctx)
        return dump_state_node_tree(fp, path);
 }
 
+void read_state_global(const void *ctx, const void *state)
+{
+       const struct xs_state_global *glb = state;
+
+       sock = glb->socket_fd;
+
+       domain_init(glb->evtchn_fd);
+}
+
 /*
  * Local variables:
  *  mode: C
index c7567eaf0b6e1af88a082077856c8173409dcd96..ac9fe1559eb7c5e60caf0502f7ebf175fba84c87 100644 (file)
@@ -265,6 +265,8 @@ const char *dump_state_node_perms(FILE *fp, struct xs_state_node *sn,
                                  const struct xs_permissions *perms,
                                  unsigned int n_perms);
 
+void read_state_global(const void *ctx, const void *state);
+
 #endif /* _XENSTORED_CORE_H */
 
 /*