]> xenbits.xensource.com Git - libvirt.git/commit
util: Add one helper virReadFCHost to read the value of fc_host entry
authorOsier Yang <jyang@redhat.com>
Mon, 7 Jan 2013 17:05:29 +0000 (01:05 +0800)
committerOsier Yang <jyang@redhat.com>
Mon, 25 Mar 2013 12:46:05 +0000 (20:46 +0800)
commit244ce462e29f6414a357b2aaff686e8b8c98ae24
tree71ec903a8c7cc02b8c7d24da45b7d8ecab5d6c0c
parent652a2ec63051f1c4570f49858db445b686abbb0e
util: Add one helper virReadFCHost to read the value of fc_host entry

"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
src/node_device/node_device_driver.h
src/node_device/node_device_linux_sysfs.c
src/util/virutil.c
src/util/virutil.h