]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Add private data pointer to virStoragePool and virStorageVol
authorAta E Husain Bohra <ata.husain@hotmail.com>
Sat, 10 Nov 2012 07:18:07 +0000 (23:18 -0800)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Mon, 26 Nov 2012 13:39:39 +0000 (14:39 +0100)
commit2b121dbc10bf39b611335a7e5b1864f455fbaf75
treefaff67fe075d0a48751fadedd13bbc26db879f68
parentbb2704e7b5e027fb325f71128cccee777fd6b080
Add private data pointer to virStoragePool and virStorageVol

This will simplify the refactoring of the ESX storage driver to support
a VMFS and an iSCSI backend.

One of the tasks the storage driver needs to do is to decide which backend
driver needs to be invoked for a given request. This approach extends
virStoragePool and virStorageVol to store extra parameters:

1. privateData: stores pointer to respective backend storage driver.
2. privateDataFreeFunc: stores cleanup function pointer.

virGetStoragePool and virGetStorageVol are modfied to accept these extra
parameters as user params. virStoragePoolDispose and virStorageVolDispose
checks for cleanup operation if available.

The private data pointer allows the ESX storage driver to store a pointer
to the used backend with each storage pool and volume. This avoids the need
to detect the correct backend in each storage driver function call.
daemon/remote.c
src/conf/storage_conf.c
src/datatypes.c
src/datatypes.h
src/esx/esx_storage_driver.c
src/parallels/parallels_storage.c
src/phyp/phyp_driver.c
src/remote/remote_driver.c
src/storage/storage_driver.c
src/test/test_driver.c
src/vbox/vbox_tmpl.c