[libvirt] [PATCH 3/9] util: Add one helper virReadFCHost to read the value of fc_host entry
Michal Privoznik
mprivozn at redhat.com
Mon Jan 14 19:41:51 UTC 2013
On 14.01.2013 15:34, Osier Yang wrote:
> "open_wwn_file" in node_device_linux_sysfs.c is redundant, on one
> hand it duplicates work of virFileReadAll, on the other hand, it's
> waste to use a function for it, as there is no other users of it.
> So I don't see why the file opening work cannot be done in
> "read_wwn_linux".
>
> "read_wwn_linux" can be abstracted as an util function. As what all
> it does is to read the sysfs entry.
>
> So this patch removes "open_wwn_file", and abstract "read_wwn_linux"
> as an util function "virReadFCHost" (a more general name, because
> after changes, it can read each of the fc_host entry now).
>
> * src/util/virutil.h: (Declare virReadFCHost)
> * src/util/virutil.c: (Implement virReadFCHost)
> * src/node_device/node_device_linux_sysfs.c: (Remove open_wwn_file,
> and read_wwn_linux)
> src/node_device/node_device_driver.h: (Remove the declaration of
> read_wwn_linux, and the related macros)
> src/libvirt_private.syms: (Export virReadFCHost)
> ---
> src/libvirt_private.syms | 1 +
> src/node_device/node_device_driver.h | 4 -
> src/node_device/node_device_linux_sysfs.c | 92 ++++-------------------------
> src/util/virutil.c | 67 +++++++++++++++++++++
> src/util/virutil.h | 5 ++
> 5 files changed, 85 insertions(+), 84 deletions(-)
ACK
Michal
More information about the libvir-list
mailing list