]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Refactor ESX storage driver to implement facade pattern
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 21:46:13 +0000 (22:46 +0100)
commit067e83ebee8ba98a019b1f8bd677c5fb13e25f78
tree28eb15acd78ea6c875426964afce33e83113d8d4
parent99a388e612d82a6bcd3462e4b98463fb32931520
Refactor ESX storage driver to implement facade pattern

The patch refactors the current ESX storage driver due to following reasons:

1. Given most of the public APIs exposed by the storage driver in Libvirt
remains same, ESX storage driver should not implement logic specific
for only one supported format (current implementation only supports VMFS).
2. Decoupling interface from specific storage implementation gives us an
extensible design to hook implementation for other supported storage
formats.

This patch refactors the current driver to implement it as a facade pattern i.e.
the driver exposes all the public libvirt APIs, but uses backend drivers to get
the required task done. The backend drivers provide implementation specific to
the type of storage device.

File changes:
------------------
esx_storage_driver.c ----> esx_storage_driver.c (base storage driver)
                     |
                     |---> esx_storage_backend_vmfs.c (VMFS backend)
po/POTFILES.in
src/Makefile.am
src/esx/esx_driver.c
src/esx/esx_storage_backend_vmfs.c [new file with mode: 0644]
src/esx/esx_storage_backend_vmfs.h [new file with mode: 0644]
src/esx/esx_storage_driver.c
src/esx/esx_vi.c
src/esx/esx_vi.h