]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage_file_probe: Refactor qcowXGetBackingStore into specific callbacks for qcow...
authorPeter Krempa <pkrempa@redhat.com>
Wed, 28 May 2025 15:18:36 +0000 (17:18 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Jun 2025 11:11:03 +0000 (13:11 +0200)
commit7758ddc107735fe62e75100f44e78ed8936fa25d
treeba5f003ef3999ef578bb0dbe2492eecabf57c5a7
parent7ae9141a123efd124b9133661515ae3a10ab7578
storage_file_probe: Refactor qcowXGetBackingStore into specific callbacks for qcow and qcow2

Change qcowXGetBackingStore to use the new function prototype which
fills virStorageSource directly. Convert the copying of the backing file
string from 'g_new0' + 'memcpy' to 'g_strndup' as we treat it as a
string.

Introduce qcowGetImageSpecific (as a wrapper for qcowXGetBackingStore)
and qcow2GetImageSpecific. The latter of the two will be used to collect
all the qcow2-specific code later on, but for now it just parses the
backing store and the format.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/storage_file/storage_file_probe.c