[libvirt] [PATCH 01/12] Introduce new public API virNodeDeviceFindByWWN

Daniel P. Berrange berrange at redhat.com
Mon Jan 7 17:27:13 UTC 2013


On Tue, Jan 08, 2013 at 01:05:23AM +0800, Osier Yang wrote:
> Since the name (like scsi_host10) is not stable for vHBA, (it can
> be changed either after recreating or system rebooting), current
> API virNodeDeviceFindByName is not nice to use for management app
> in this case. (E.g. one wants to destroy the vHBA whose name has
> been changed after system rebooting, he has to find out current
> name first).
> 
> Later patches will support the persistent vHBA via storage pool,
> with which one can identify the vHBA stably by the wwnn && wwpn
> pair.
> 
> So this new API comes.
> ---
>  include/libvirt/libvirt.h.in |    5 ++++
>  src/driver.h                 |    6 +++++
>  src/libvirt.c                |   45 ++++++++++++++++++++++++++++++++++++++++++
>  src/libvirt_public.syms      |    1 +
>  4 files changed, 57 insertions(+), 0 deletions(-)
> 
> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> index 09c89c5..b4e1ead 100644
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -3156,6 +3156,11 @@ int                     virConnectListAllNodeDevices (virConnectPtr conn,
>  virNodeDevicePtr        virNodeDeviceLookupByName (virConnectPtr conn,
>                                                     const char *name);
>  
> +virNodeDevicePtr        virNodeDeviceLookupByWWN (virConnectPtr conn,
> +                                                  const char *wwnn,
> +                                                  const char *wwpn,
> +                                                  unsigned int flags);

Since this API doesn't work for all types of node dev, its name
should really reflect that. eg

  virNodeDeviceLookupSCSIHostByWWN()


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list