Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b2df3510
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看板
提交
b2df3510
编写于
4月 07, 2009
作者:
D
Daniel Veillard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* src/storage_backend_scsi.[ch]: add SCSI storage rescan support,
patch by David Allan daniel
上级
8536e697
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
1 deletion
+60
-1
ChangeLog
ChangeLog
+5
-0
src/storage_backend_scsi.c
src/storage_backend_scsi.c
+54
-1
src/storage_backend_scsi.h
src/storage_backend_scsi.h
+1
-0
未找到文件。
ChangeLog
浏览文件 @
b2df3510
Tue Apr 7 14:48:35 CEST 2009 Daniel Veillard <veillard@redhat.com>
* src/storage_backend_scsi.[ch]: add SCSI storage rescan support,
patch by David Allan
Fri Apr 3 16:47:22 CEST 2009 Daniel Veillard <veillard@redhat.com>
Fri Apr 3 16:47:22 CEST 2009 Daniel Veillard <veillard@redhat.com>
* configure.in libvirt.spec.in NEWS docs/*: release of 0.6.2
* configure.in libvirt.spec.in NEWS docs/*: release of 0.6.2
...
...
src/storage_backend_scsi.c
浏览文件 @
b2df3510
...
@@ -565,6 +565,53 @@ out:
...
@@ -565,6 +565,53 @@ out:
}
}
static
int
virStorageBackendSCSITriggerRescan
(
virConnectPtr
conn
,
uint32_t
host
)
{
int
fd
=
-
1
;
int
retval
=
0
;
char
*
path
;
VIR_DEBUG
(
_
(
"Triggering rescan of host %d"
),
host
);
if
(
virAsprintf
(
&
path
,
"/sys/class/scsi_host/host%u/scan"
,
host
)
<
0
)
{
virReportOOMError
(
conn
);
retval
=
-
1
;
goto
out
;
}
VIR_DEBUG
(
_
(
"Scan trigger path is '%s'"
),
path
);
fd
=
open
(
path
,
O_WRONLY
);
if
(
fd
<
0
)
{
virReportSystemError
(
conn
,
errno
,
_
(
"Could not open '%s' to trigger host scan"
),
path
);
retval
=
-
1
;
goto
free_path
;
}
if
(
safewrite
(
fd
,
LINUX_SYSFS_SCSI_HOST_SCAN_STRING
,
sizeof
(
LINUX_SYSFS_SCSI_HOST_SCAN_STRING
))
<
0
)
{
virReportSystemError
(
conn
,
errno
,
_
(
"Write to '%s' to trigger host scan failed"
),
path
);
retval
=
-
1
;
}
close
(
fd
);
free_path:
VIR_FREE
(
path
);
out:
VIR_DEBUG
(
_
(
"Rescan of host %d complete"
),
host
);
return
retval
;
}
static
int
static
int
virStorageBackendSCSIRefreshPool
(
virConnectPtr
conn
,
virStorageBackendSCSIRefreshPool
(
virConnectPtr
conn
,
virStoragePoolObjPtr
pool
)
virStoragePoolObjPtr
pool
)
...
@@ -575,13 +622,19 @@ virStorageBackendSCSIRefreshPool(virConnectPtr conn,
...
@@ -575,13 +622,19 @@ virStorageBackendSCSIRefreshPool(virConnectPtr conn,
pool
->
def
->
allocation
=
pool
->
def
->
capacity
=
pool
->
def
->
available
=
0
;
pool
->
def
->
allocation
=
pool
->
def
->
capacity
=
pool
->
def
->
available
=
0
;
if
(
sscanf
(
pool
->
def
->
source
.
adapter
,
"host%u"
,
&
host
)
!=
1
)
{
if
(
sscanf
(
pool
->
def
->
source
.
adapter
,
"host%u"
,
&
host
)
!=
1
)
{
VIR_DEBUG
(
_
(
"Failed to get host number from '%s'"
),
pool
->
def
->
source
.
adapter
);
VIR_DEBUG
(
_
(
"Failed to get host number from '%s'"
),
pool
->
def
->
source
.
adapter
);
retval
=
-
1
;
retval
=
-
1
;
goto
out
;
goto
out
;
}
}
VIR_DEBUG
(
_
(
"Scanning host%u"
),
host
);
VIR_DEBUG
(
_
(
"Scanning host%u"
),
host
);
if
(
virStorageBackendSCSITriggerRescan
(
conn
,
host
)
<
0
)
{
retval
=
-
1
;
goto
out
;
}
virStorageBackendSCSIFindLUs
(
conn
,
pool
,
host
);
virStorageBackendSCSIFindLUs
(
conn
,
pool
,
host
);
out:
out:
...
...
src/storage_backend_scsi.h
浏览文件 @
b2df3510
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host"
#define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host"
#define LINUX_SYSFS_SCSI_HOST_POSTFIX "device"
#define LINUX_SYSFS_SCSI_HOST_POSTFIX "device"
#define LINUX_SYSFS_SCSI_HOST_SCAN_STRING "- - -"
extern
virStorageBackend
virStorageBackendSCSI
;
extern
virStorageBackend
virStorageBackendSCSI
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录