Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
fe46a7e6
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看板
提交
fe46a7e6
编写于
2月 04, 2010
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove conn parameter from storage file functions
It was used for error reporting only.
上级
f972dc2d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
36 deletion
+22
-36
src/qemu/qemu_security_dac.c
src/qemu/qemu_security_dac.c
+2
-2
src/security/security_selinux.c
src/security/security_selinux.c
+2
-2
src/storage/storage_backend_fs.c
src/storage/storage_backend_fs.c
+5
-8
src/util/storage_file.c
src/util/storage_file.c
+11
-20
src/util/storage_file.h
src/util/storage_file.h
+2
-4
未找到文件。
src/qemu/qemu_security_dac.c
浏览文件 @
fe46a7e6
...
...
@@ -105,7 +105,7 @@ err:
static
int
qemuSecurityDACSetSecurityImageLabel
(
virConnectPtr
conn
,
qemuSecurityDACSetSecurityImageLabel
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
,
virDomainObjPtr
vm
ATTRIBUTE_UNUSED
,
virDomainDiskDefPtr
disk
)
...
...
@@ -125,7 +125,7 @@ qemuSecurityDACSetSecurityImageLabel(virConnectPtr conn,
memset
(
&
meta
,
0
,
sizeof
(
meta
));
ret
=
virStorageFileGetMetadata
(
conn
,
path
,
&
meta
);
ret
=
virStorageFileGetMetadata
(
path
,
&
meta
);
if
(
path
!=
disk
->
src
)
VIR_FREE
(
path
);
...
...
src/security/security_selinux.c
浏览文件 @
fe46a7e6
...
...
@@ -407,7 +407,7 @@ SELinuxRestoreSecurityImageLabel(virConnectPtr conn ATTRIBUTE_UNUSED,
}
static
int
SELinuxSetSecurityImageLabel
(
virConnectPtr
conn
,
SELinuxSetSecurityImageLabel
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
,
virDomainObjPtr
vm
,
virDomainDiskDefPtr
disk
)
...
...
@@ -428,7 +428,7 @@ SELinuxSetSecurityImageLabel(virConnectPtr conn,
memset
(
&
meta
,
0
,
sizeof
(
meta
));
ret
=
virStorageFileGetMetadata
(
conn
,
path
,
&
meta
);
ret
=
virStorageFileGetMetadata
(
path
,
&
meta
);
if
(
path
!=
disk
->
src
)
VIR_FREE
(
path
);
...
...
src/storage/storage_backend_fs.c
浏览文件 @
fe46a7e6
...
...
@@ -49,8 +49,7 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
static
int
virStorageBackendProbeTarget
(
virConnectPtr
conn
,
virStorageVolTargetPtr
target
,
virStorageBackendProbeTarget
(
virStorageVolTargetPtr
target
,
char
**
backingStore
,
unsigned
long
long
*
allocation
,
unsigned
long
long
*
capacity
,
...
...
@@ -78,7 +77,7 @@ virStorageBackendProbeTarget(virConnectPtr conn,
memset
(
&
meta
,
0
,
sizeof
(
meta
));
if
(
virStorageFileGetMetadataFromFD
(
conn
,
target
->
path
,
fd
,
&
meta
)
<
0
)
{
if
(
virStorageFileGetMetadataFromFD
(
target
->
path
,
fd
,
&
meta
)
<
0
)
{
close
(
fd
);
return
-
1
;
}
...
...
@@ -556,7 +555,7 @@ error:
* within it. This is non-recursive.
*/
static
int
virStorageBackendFileSystemRefresh
(
virConnectPtr
conn
,
virStorageBackendFileSystemRefresh
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
,
virStoragePoolObjPtr
pool
)
{
DIR
*
dir
;
...
...
@@ -591,8 +590,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
if
((
vol
->
key
=
strdup
(
vol
->
target
.
path
))
==
NULL
)
goto
no_memory
;
if
((
ret
=
virStorageBackendProbeTarget
(
conn
,
&
vol
->
target
,
if
((
ret
=
virStorageBackendProbeTarget
(
&
vol
->
target
,
&
backingStore
,
&
vol
->
allocation
,
&
vol
->
capacity
,
...
...
@@ -633,8 +631,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
}
else
{
vol
->
backingStore
.
path
=
backingStore
;
if
((
ret
=
virStorageBackendProbeTarget
(
conn
,
&
vol
->
backingStore
,
if
((
ret
=
virStorageBackendProbeTarget
(
&
vol
->
backingStore
,
NULL
,
NULL
,
NULL
,
NULL
))
<
0
)
{
if
(
ret
==
-
1
)
...
...
src/util/storage_file.c
浏览文件 @
fe46a7e6
...
...
@@ -73,16 +73,12 @@ struct FileTypeInfo {
int
qcowCryptOffset
;
/* Byte offset from start of file
* where to find encryption mode,
* -1 if encryption is not used */
int
(
*
getBackingStore
)(
virConnectPtr
conn
,
char
**
res
,
const
unsigned
char
*
buf
,
size_t
buf_size
);
int
(
*
getBackingStore
)(
char
**
res
,
const
unsigned
char
*
buf
,
size_t
buf_size
);
};
static
int
cowGetBackingStore
(
virConnectPtr
,
char
**
,
const
unsigned
char
*
,
size_t
);
static
int
qcowXGetBackingStore
(
virConnectPtr
,
char
**
,
const
unsigned
char
*
,
size_t
);
static
int
vmdk4GetBackingStore
(
virConnectPtr
,
char
**
,
const
unsigned
char
*
,
size_t
);
static
int
cowGetBackingStore
(
char
**
,
const
unsigned
char
*
,
size_t
);
static
int
qcowXGetBackingStore
(
char
**
,
const
unsigned
char
*
,
size_t
);
static
int
vmdk4GetBackingStore
(
char
**
,
const
unsigned
char
*
,
size_t
);
static
struct
FileTypeInfo
const
fileTypeInfo
[]
=
{
...
...
@@ -142,8 +138,7 @@ static struct FileTypeInfo const fileTypeInfo[] = {
};
static
int
cowGetBackingStore
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
/*TEMPORARY*/
,
char
**
res
,
cowGetBackingStore
(
char
**
res
,
const
unsigned
char
*
buf
,
size_t
buf_size
)
{
...
...
@@ -163,8 +158,7 @@ cowGetBackingStore(virConnectPtr conn ATTRIBUTE_UNUSED /*TEMPORARY*/,
}
static
int
qcowXGetBackingStore
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
/*TEMPORARY*/
,
char
**
res
,
qcowXGetBackingStore
(
char
**
res
,
const
unsigned
char
*
buf
,
size_t
buf_size
)
{
...
...
@@ -205,8 +199,7 @@ qcowXGetBackingStore(virConnectPtr conn ATTRIBUTE_UNUSED /*TEMPORARY*/,
static
int
vmdk4GetBackingStore
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
/*TEMPORARY*/
,
char
**
res
,
vmdk4GetBackingStore
(
char
**
res
,
const
unsigned
char
*
buf
,
size_t
buf_size
)
{
...
...
@@ -269,8 +262,7 @@ absolutePathFromBaseFile(const char *base_file, const char *path)
* it is, and info about its capacity if available.
*/
int
virStorageFileGetMetadataFromFD
(
virConnectPtr
conn
,
const
char
*
path
,
virStorageFileGetMetadataFromFD
(
const
char
*
path
,
int
fd
,
virStorageFileMetadata
*
meta
)
{
...
...
@@ -362,7 +354,7 @@ virStorageFileGetMetadataFromFD(virConnectPtr conn,
if
(
fileTypeInfo
[
i
].
getBackingStore
!=
NULL
)
{
char
*
base
;
switch
(
fileTypeInfo
[
i
].
getBackingStore
(
conn
,
&
base
,
head
,
len
))
{
switch
(
fileTypeInfo
[
i
].
getBackingStore
(
&
base
,
head
,
len
))
{
case
BACKING_STORE_OK
:
break
;
...
...
@@ -400,8 +392,7 @@ virStorageFileGetMetadataFromFD(virConnectPtr conn,
}
int
virStorageFileGetMetadata
(
virConnectPtr
conn
,
const
char
*
path
,
virStorageFileGetMetadata
(
const
char
*
path
,
virStorageFileMetadata
*
meta
)
{
int
fd
,
ret
;
...
...
@@ -411,7 +402,7 @@ virStorageFileGetMetadata(virConnectPtr conn,
return
-
1
;
}
ret
=
virStorageFileGetMetadataFromFD
(
conn
,
path
,
fd
,
meta
);
ret
=
virStorageFileGetMetadataFromFD
(
path
,
fd
,
meta
);
close
(
fd
);
...
...
src/util/storage_file.h
浏览文件 @
fe46a7e6
...
...
@@ -51,11 +51,9 @@ typedef struct _virStorageFileMetadata {
bool
encrypted
;
}
virStorageFileMetadata
;
int
virStorageFileGetMetadata
(
virConnectPtr
conn
,
const
char
*
path
,
int
virStorageFileGetMetadata
(
const
char
*
path
,
virStorageFileMetadata
*
meta
);
int
virStorageFileGetMetadataFromFD
(
virConnectPtr
conn
,
const
char
*
path
,
int
virStorageFileGetMetadataFromFD
(
const
char
*
path
,
int
fd
,
virStorageFileMetadata
*
meta
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录