Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
d823466b
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d823466b
编写于
7月 26, 2017
作者:
J
John Ferlan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage: Use virStoragePoolObjGetDef accessor for SCSI backend
In preparation for privatizing the object, use the accessor.
上级
4d95a14f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
12 deletion
+18
-12
src/storage/storage_backend_scsi.c
src/storage/storage_backend_scsi.c
+18
-12
未找到文件。
src/storage/storage_backend_scsi.c
浏览文件 @
d823466b
...
@@ -139,6 +139,7 @@ virStoragePoolFCRefreshThread(void *opaque)
...
@@ -139,6 +139,7 @@ virStoragePoolFCRefreshThread(void *opaque)
const
char
*
fchost_name
=
cbdata
->
fchost_name
;
const
char
*
fchost_name
=
cbdata
->
fchost_name
;
const
unsigned
char
*
pool_uuid
=
cbdata
->
pool_uuid
;
const
unsigned
char
*
pool_uuid
=
cbdata
->
pool_uuid
;
virStoragePoolObjPtr
pool
=
NULL
;
virStoragePoolObjPtr
pool
=
NULL
;
virStoragePoolDefPtr
def
;
unsigned
int
host
;
unsigned
int
host
;
int
found
=
0
;
int
found
=
0
;
int
tries
=
2
;
int
tries
=
2
;
...
@@ -149,14 +150,15 @@ virStoragePoolFCRefreshThread(void *opaque)
...
@@ -149,14 +150,15 @@ virStoragePoolFCRefreshThread(void *opaque)
/* Let's see if the pool still exists - */
/* Let's see if the pool still exists - */
if
(
!
(
pool
=
virStoragePoolObjFindPoolByUUID
(
pool_uuid
)))
if
(
!
(
pool
=
virStoragePoolObjFindPoolByUUID
(
pool_uuid
)))
break
;
break
;
def
=
virStoragePoolObjGetDef
(
pool
);
/* Return with pool lock, if active, we can get the host number,
/* Return with pool lock, if active, we can get the host number,
* successfully, rescan, and find LUN's, then we are happy
* successfully, rescan, and find LUN's, then we are happy
*/
*/
VIR_DEBUG
(
"Attempt FC Refresh for pool='%s' name='%s' tries='%d'"
,
VIR_DEBUG
(
"Attempt FC Refresh for pool='%s' name='%s' tries='%d'"
,
pool
->
def
->
name
,
fchost_name
,
tries
);
def
->
name
,
fchost_name
,
tries
);
pool
->
def
->
allocation
=
pool
->
def
->
capacity
=
pool
->
def
->
available
=
0
;
def
->
allocation
=
def
->
capacity
=
def
->
available
=
0
;
if
(
virStoragePoolObjIsActive
(
pool
)
&&
if
(
virStoragePoolObjIsActive
(
pool
)
&&
virSCSIHostGetNumber
(
fchost_name
,
&
host
)
==
0
&&
virSCSIHostGetNumber
(
fchost_name
,
&
host
)
==
0
&&
...
@@ -371,6 +373,7 @@ static int
...
@@ -371,6 +373,7 @@ static int
virStorageBackendSCSICheckPool
(
virStoragePoolObjPtr
pool
,
virStorageBackendSCSICheckPool
(
virStoragePoolObjPtr
pool
,
bool
*
isActive
)
bool
*
isActive
)
{
{
virStoragePoolDefPtr
def
=
virStoragePoolObjGetDef
(
pool
);
char
*
path
=
NULL
;
char
*
path
=
NULL
;
char
*
name
=
NULL
;
char
*
name
=
NULL
;
unsigned
int
host
;
unsigned
int
host
;
...
@@ -378,13 +381,12 @@ virStorageBackendSCSICheckPool(virStoragePoolObjPtr pool,
...
@@ -378,13 +381,12 @@ virStorageBackendSCSICheckPool(virStoragePoolObjPtr pool,
*
isActive
=
false
;
*
isActive
=
false
;
if
(
!
(
name
=
getAdapterName
(
&
pool
->
def
->
source
.
adapter
)))
{
if
(
!
(
name
=
getAdapterName
(
&
def
->
source
.
adapter
)))
{
/* It's normal for the pool with "fc_host" type source
/* It's normal for the pool with "fc_host" type source
* adapter fails to get the adapter name, since the vHBA
* adapter fails to get the adapter name, since the vHBA
* the adapter based on might be not created yet.
* the adapter based on might be not created yet.
*/
*/
if
(
pool
->
def
->
source
.
adapter
.
type
==
if
(
def
->
source
.
adapter
.
type
==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST
)
{
VIR_STORAGE_ADAPTER_TYPE_FC_HOST
)
{
virResetLastError
();
virResetLastError
();
return
0
;
return
0
;
}
else
{
}
else
{
...
@@ -412,13 +414,14 @@ static int
...
@@ -412,13 +414,14 @@ static int
virStorageBackendSCSIRefreshPool
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
,
virStorageBackendSCSIRefreshPool
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
,
virStoragePoolObjPtr
pool
)
virStoragePoolObjPtr
pool
)
{
{
virStoragePoolDefPtr
def
=
virStoragePoolObjGetDef
(
pool
);
char
*
name
=
NULL
;
char
*
name
=
NULL
;
unsigned
int
host
;
unsigned
int
host
;
int
ret
=
-
1
;
int
ret
=
-
1
;
pool
->
def
->
allocation
=
pool
->
def
->
capacity
=
pool
->
def
->
available
=
0
;
def
->
allocation
=
def
->
capacity
=
def
->
available
=
0
;
if
(
!
(
name
=
getAdapterName
(
&
pool
->
def
->
source
.
adapter
)))
if
(
!
(
name
=
getAdapterName
(
&
def
->
source
.
adapter
)))
return
-
1
;
return
-
1
;
if
(
virSCSIHostGetNumber
(
name
,
&
host
)
<
0
)
if
(
virSCSIHostGetNumber
(
name
,
&
host
)
<
0
)
...
@@ -443,11 +446,12 @@ static int
...
@@ -443,11 +446,12 @@ static int
virStorageBackendSCSIStartPool
(
virConnectPtr
conn
,
virStorageBackendSCSIStartPool
(
virConnectPtr
conn
,
virStoragePoolObjPtr
pool
)
virStoragePoolObjPtr
pool
)
{
{
virStoragePoolDefPtr
def
=
virStoragePoolObjGetDef
(
pool
);
const
char
*
configFile
=
virStoragePoolObjGetConfigFile
(
pool
);
const
char
*
configFile
=
virStoragePoolObjGetConfigFile
(
pool
);
if
(
pool
->
def
->
source
.
adapter
.
type
==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST
)
if
(
def
->
source
.
adapter
.
type
==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST
)
return
createVport
(
conn
,
pool
->
def
,
configFile
,
return
createVport
(
conn
,
def
,
configFile
,
&
pool
->
def
->
source
.
adapter
.
data
.
fchost
);
&
def
->
source
.
adapter
.
data
.
fchost
);
return
0
;
return
0
;
}
}
...
@@ -457,9 +461,11 @@ static int
...
@@ -457,9 +461,11 @@ static int
virStorageBackendSCSIStopPool
(
virConnectPtr
conn
,
virStorageBackendSCSIStopPool
(
virConnectPtr
conn
,
virStoragePoolObjPtr
pool
)
virStoragePoolObjPtr
pool
)
{
{
if
(
pool
->
def
->
source
.
adapter
.
type
==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST
)
virStoragePoolDefPtr
def
=
virStoragePoolObjGetDef
(
pool
);
if
(
def
->
source
.
adapter
.
type
==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST
)
return
virNodeDeviceDeleteVport
(
conn
,
return
virNodeDeviceDeleteVport
(
conn
,
&
pool
->
def
->
source
.
adapter
.
data
.
fchost
);
&
def
->
source
.
adapter
.
data
.
fchost
);
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录