git: 50aef9f62c1b - main - bhyve: rename 'structs' snapshot key with 'kern_structs'
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 19 Jun 2023 05:57:56 UTC
The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=50aef9f62c1be9e723169ef57920c3fca07bd2fb commit 50aef9f62c1be9e723169ef57920c3fca07bd2fb Author: Vitaliy Gusev <gusev.vitaliy@gmail.com> AuthorDate: 2023-05-15 14:25:15 +0000 Commit: Corvin Köhne <corvink@FreeBSD.org> CommitDate: 2023-06-19 05:50:36 +0000 bhyve: rename 'structs' snapshot key with 'kern_structs' Using key 'structs' is ambiguous. This section contains data related to the kernel. It should use a more informative naming. Reviewed by: corvink, rew MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D40104 --- usr.sbin/bhyve/snapshot.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c index a9e172588870..7e635c13ef31 100644 --- a/usr.sbin/bhyve/snapshot.c +++ b/usr.sbin/bhyve/snapshot.c @@ -119,10 +119,10 @@ static sig_t old_winch_handler; #define SNAPSHOT_BUFFER_SIZE (20 * MB) -#define JSON_STRUCT_ARR_KEY "structs" +#define JSON_KERNEL_ARR_KEY "kern_structs" #define JSON_DEV_ARR_KEY "devices" #define JSON_BASIC_METADATA_KEY "basic metadata" -#define JSON_SNAPSHOT_REQ_KEY "snapshot_req" +#define JSON_SNAPSHOT_REQ_KEY "device" #define JSON_SIZE_KEY "size" #define JSON_FILE_OFFSET_KEY "file_offset" @@ -423,16 +423,16 @@ lookup_struct(enum snapshot_req struct_id, struct restore_state *rstate, ucl_object_iter_t it = NULL; int64_t snapshot_req, size, file_offset; - structs = ucl_object_lookup(rstate->meta_root_obj, JSON_STRUCT_ARR_KEY); + structs = ucl_object_lookup(rstate->meta_root_obj, JSON_KERNEL_ARR_KEY); if (structs == NULL) { fprintf(stderr, "Failed to find '%s' object.\n", - JSON_STRUCT_ARR_KEY); + JSON_KERNEL_ARR_KEY); return (NULL); } if (ucl_object_type(structs) != UCL_ARRAY) { fprintf(stderr, "Object '%s' is not an array.\n", - JSON_STRUCT_ARR_KEY); + JSON_KERNEL_ARR_KEY); return (NULL); } @@ -1059,7 +1059,7 @@ vm_snapshot_kern_struct(struct vmctx *ctx, int data_fd, xo_handle_t *xop, meta->dev_req); xo_emit_h(xop, "{:" JSON_SIZE_KEY "/%lu}\n", data_size); xo_emit_h(xop, "{:" JSON_FILE_OFFSET_KEY "/%lu}\n", *offset); - xo_close_instance_h(xop, JSON_STRUCT_ARR_KEY); + xo_close_instance_h(xop, JSON_KERNEL_ARR_KEY); *offset += data_size; @@ -1093,7 +1093,7 @@ vm_snapshot_kern_structs(struct vmctx *ctx, int data_fd, xo_handle_t *xop) .op = VM_SNAPSHOT_SAVE, }; - xo_open_list_h(xop, JSON_STRUCT_ARR_KEY); + xo_open_list_h(xop, JSON_KERNEL_ARR_KEY); for (i = 0; i < nitems(snapshot_kern_structs); i++) { meta->dev_name = snapshot_kern_structs[i].struct_name; meta->dev_req = snapshot_kern_structs[i].req; @@ -1109,7 +1109,7 @@ vm_snapshot_kern_structs(struct vmctx *ctx, int data_fd, xo_handle_t *xop) goto err_vm_snapshot_kern_data; } } - xo_close_list_h(xop, JSON_STRUCT_ARR_KEY); + xo_close_list_h(xop, JSON_KERNEL_ARR_KEY); err_vm_snapshot_kern_data: if (buffer != NULL)