[libhbalinux: 1/2] Set SerialNumber to "Unknown" if not found (47d8dca41)

Petr Šabata psabata at fedoraproject.org
Tue Jan 31 15:07:50 UTC 2012


commit 4e886e0fbb06fbbc76bb248afde472736cdafc80
Author: Petr Šabata <contyk at redhat.com>
Date:   Tue Jan 31 16:02:48 2012 +0100

    Set SerialNumber to "Unknown" if not found (47d8dca41)

 ...-Set-SerialNumber-to-Unknown-if-not-found.patch |   40 ++++++++++++++++++++
 libhbalinux.spec                                   |    7 +++-
 2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/libhbalinux-1.0.13-Set-SerialNumber-to-Unknown-if-not-found.patch b/libhbalinux-1.0.13-Set-SerialNumber-to-Unknown-if-not-found.patch
new file mode 100644
index 0000000..8b1922c
--- /dev/null
+++ b/libhbalinux-1.0.13-Set-SerialNumber-to-Unknown-if-not-found.patch
@@ -0,0 +1,40 @@
+From 47d8dca418b54847eac9d791e0895b31a7b41089 Mon Sep 17 00:00:00 2001
+From: Neerav Parikh <neerav.parikh at intel.com>
+Date: Wed, 11 Jan 2012 06:18:10 +0000
+Subject: [PATCH] libhbalinux: Set SerialNumber to "Unknown" if not found
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch initializes SerialNumber field to a default
+value "Unknown". In case of any error or if the PCI device
+doesn't have the PCIe Device Serial Number Capability the
+default value will be returned for this field.
+
+Signed-off-by: Neerav Parikh <neerav.parikh at intel.com>
+Tested-by: Ross Brattain <ross.b.brattain at intel.com>
+Reviewed-by: Yi Zou <yi.zou at intel.com>
+Signed-off-by: Robert Love <robert.w.love at intel.com>
+Signed-off-by: Petr Šabata <contyk at redhat.com>
+---
+ pci.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/pci.c b/pci.c
+index 70b9d6a..642e33b 100644
+--- a/pci.c
++++ b/pci.c
+@@ -34,6 +34,10 @@ get_device_serial_number(struct pci_device *dev, struct hba_info *hba_info)
+ 	u_int32_t dword_high = 0;
+ 	int rc;
+ 
++	/* Default */
++	snprintf(hba_info->SerialNumber,
++		 sizeof(hba_info->SerialNumber),
++		 "Unknown");
+ 	/*
+ 	 * Read the Status Register in the PCIe configuration
+ 	 * header space to see if the PCI Capability List is
+-- 
+1.7.7.6
+
diff --git a/libhbalinux.spec b/libhbalinux.spec
index 6b4f908..fe41931 100644
--- a/libhbalinux.spec
+++ b/libhbalinux.spec
@@ -1,12 +1,13 @@
 Name:           libhbalinux
 Version:        1.0.13
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        FC-HBAAPI implementation using scsi_transport_fc interfaces
 Group:          System Environment/Libraries
 License:        LGPLv2
 URL:            http://www.open-fcoe.org
 Source0:        %{name}-%{version}.tar.gz
 Patch0:         libhbalinux-1.0.13-conf.patch
+Patch1:         libhbalinux-1.0.13-Set-SerialNumber-to-Unknown-if-not-found.patch
 BuildRequires:  libhbaapi-devel libpciaccess-devel libtool automake
 Requires:       libhbaapi
 
@@ -25,6 +26,7 @@ The libhbalinux-devel package contains the library pkgconfig file.
 %prep
 %setup -q
 %patch0 -p1 -b .conf
+%patch1 -p1 -b .sn-unknown
 
 %build
 ./bootstrap.sh
@@ -66,6 +68,9 @@ fi
 %{_libdir}/pkgconfig/%{name}.pc
 
 %changelog
+* Tue Jan 31 2012 Petr Šabata <contyk at redhat.com> - 1.0.13-2
+- Set SerialNumber to "Unknown" if not found (47d8dca41)
+
 * Thu Nov 24 2011 Petr Šabata <contyk at redhat.com> - 1.0.13-1
 - 1.0.13 bump
 - Creating the devel subpackage with a pkgconfig file


More information about the scm-commits mailing list