|
|
c401cc |
From abe590777bed20bca15d9cb07891cf863859a3c8 Mon Sep 17 00:00:00 2001
|
|
|
c401cc |
Message-Id: <abe590777bed20bca15d9cb07891cf863859a3c8.1385135432.git.jdenemar@redhat.com>
|
|
|
c401cc |
From: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
|
|
|
c401cc |
Date: Fri, 15 Nov 2013 16:05:45 +0100
|
|
|
c401cc |
Subject: [PATCH] virscsi: hostdev SCSI AdapterId retrieval fix
|
|
|
c401cc |
|
|
|
c401cc |
https://bugzilla.redhat.com/show_bug.cgi?id=1031079
|
|
|
c401cc |
|
|
|
c401cc |
Fixed the retrieval of the AdapterId from the AdapterName of the
|
|
|
c401cc |
hostdev source so it does return an error instead of leaving the
|
|
|
c401cc |
adapter_id uninitialized.
|
|
|
c401cc |
|
|
|
c401cc |
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
|
|
|
c401cc |
Reviewed-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
|
|
|
c401cc |
(cherry picked from commit 11d9dd7ba099c59bc3cb785ab574a84bdb255168)
|
|
|
c401cc |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
c401cc |
---
|
|
|
c401cc |
src/util/virscsi.c | 17 +++++++----------
|
|
|
c401cc |
1 file changed, 7 insertions(+), 10 deletions(-)
|
|
|
c401cc |
|
|
|
c401cc |
diff --git a/src/util/virscsi.c b/src/util/virscsi.c
|
|
|
c401cc |
index 32e438b..3950c62 100644
|
|
|
c401cc |
--- a/src/util/virscsi.c
|
|
|
c401cc |
+++ b/src/util/virscsi.c
|
|
|
c401cc |
@@ -88,16 +88,13 @@ static int
|
|
|
c401cc |
virSCSIDeviceGetAdapterId(const char *adapter,
|
|
|
c401cc |
unsigned int *adapter_id)
|
|
|
c401cc |
{
|
|
|
c401cc |
- if (STRPREFIX(adapter, "scsi_host")) {
|
|
|
c401cc |
- if (virStrToLong_ui(adapter + strlen("scsi_host"),
|
|
|
c401cc |
- NULL, 0, adapter_id) < 0) {
|
|
|
c401cc |
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
|
c401cc |
- _("Cannot parse adapter '%s'"), adapter);
|
|
|
c401cc |
- return -1;
|
|
|
c401cc |
- }
|
|
|
c401cc |
- }
|
|
|
c401cc |
-
|
|
|
c401cc |
- return 0;
|
|
|
c401cc |
+ if (STRPREFIX(adapter, "scsi_host") &&
|
|
|
c401cc |
+ virStrToLong_ui(adapter + strlen("scsi_host"),
|
|
|
c401cc |
+ NULL, 0, adapter_id) == 0)
|
|
|
c401cc |
+ return 0;
|
|
|
c401cc |
+ virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
|
c401cc |
+ _("Cannot parse adapter '%s'"), adapter);
|
|
|
c401cc |
+ return -1;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
char *
|
|
|
c401cc |
--
|
|
|
c401cc |
1.8.4.4
|
|
|
c401cc |
|