]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: adjust handling of libxl_device_disk objects
authorOlaf Hering <olaf@aepfle.de>
Thu, 20 May 2021 10:17:20 +0000 (12:17 +0200)
committerJim Fehlig <jfehlig@suse.com>
Fri, 21 May 2021 16:57:36 +0000 (10:57 -0600)
commit2d0decccba7b78462dec51d229aaf9b637abc120
treee053425a65a9f6dec4b106b6d7708934a9d853d3
parent7ab1ba112f75792c87412234681057ac9be677a8
libxl: adjust handling of libxl_device_disk objects

libxl objects are supposed to be initialized and disposed.
Correct the usage of libxl_device_disk objects which are allocated on
the stack. Initialize each one prior usage, and dispose them once done.

Adjust libxlMakeDisk to use an already initialized object, it is owned
by the caller.

Adjust libxlMakeDiskList to initialize the list of objects, before they
are filled by libxlMakeDisk. In case of error, the objects are disposed
by libxl_domain_config_dispose.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
src/libxl/libxl_conf.c
src/libxl/libxl_driver.c