aboutsummaryrefslogtreecommitdiff
path: root/scripts/xml-preprocess.py
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2025-01-14 18:07:32 -0500
committerFabiano Rosas <farosas@suse.de>2025-01-29 11:56:40 -0300
commita55090db2ac16aa2ee9d25940e11ca5467af661b (patch)
tree09212835604b4cfd701803a8953029e5b17fec30 /scripts/xml-preprocess.py
parent013c6e1f423c8c3b25e244eaabfbd38d865c6841 (diff)
downloadqemu-a55090db2ac16aa2ee9d25940e11ca5467af661b.zip
qemu-a55090db2ac16aa2ee9d25940e11ca5467af661b.tar.gz
qemu-a55090db2ac16aa2ee9d25940e11ca5467af661b.tar.bz2
migration: Do not construct JSON description if suppressed
QEMU machine has a property "suppress-vmdesc". When it is enabled, QEMU will stop attaching JSON VM description at the end of the precopy migration stream (postcopy is never affected because postcopy never attach that). However even if it's suppressed by the user, the source QEMU will still construct the JSON descriptions, which is a complete waste of CPU and memory resources. To avoid it, only create the JSON writer object if suppress-vmdesc is not specified. Luckily, vmstate_save() already supports vmdesc==NULL, so only a few spots that are left to be prepared that vmdesc can be NULL now. When at it, move the init / destroy of the JSON writer object to start / end of the migration - the JSON writer object is a sub-struct of migration state, and that looks like the only object that was dynamically allocated / destroyed within migration process. Make it the same as the rest objects that migration uses. Signed-off-by: Peter Xu <peterx@redhat.com> Tested-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Juraj Marcin <jmarcin@redhat.com> Link: https://lore.kernel.org/r/20250114230746.3268797-3-peterx@redhat.com Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'scripts/xml-preprocess.py')
0 files changed, 0 insertions, 0 deletions