Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
cfd9c028
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cfd9c028
编写于
11月 13, 2014
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary curly brackets in daemon/ and examples/
Signed-off-by:
N
Martin Kletzander
<
mkletzan@redhat.com
>
上级
e09f9e4c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
13 addition
and
26 deletion
+13
-26
daemon/libvirtd.c
daemon/libvirtd.c
+5
-10
daemon/remote.c
daemon/remote.c
+4
-8
examples/object-events/event-test.c
examples/object-events/event-test.c
+1
-2
examples/openauth/openauth.c
examples/openauth/openauth.c
+3
-6
未找到文件。
daemon/libvirtd.c
浏览文件 @
cfd9c028
...
@@ -981,9 +981,8 @@ static int migrateProfile(void)
...
@@ -981,9 +981,8 @@ static int migrateProfile(void)
if
(
!
(
home
=
virGetUserDirectory
()))
if
(
!
(
home
=
virGetUserDirectory
()))
goto
cleanup
;
goto
cleanup
;
if
(
virAsprintf
(
&
old_base
,
"%s/.libvirt"
,
home
)
<
0
)
{
if
(
virAsprintf
(
&
old_base
,
"%s/.libvirt"
,
home
)
<
0
)
goto
cleanup
;
goto
cleanup
;
}
/* if the new directory is there or the old one is not: do nothing */
/* if the new directory is there or the old one is not: do nothing */
if
(
!
(
config_dir
=
virGetUserConfigDirectory
()))
if
(
!
(
config_dir
=
virGetUserConfigDirectory
()))
...
@@ -998,22 +997,19 @@ static int migrateProfile(void)
...
@@ -998,22 +997,19 @@ static int migrateProfile(void)
}
}
/* test if we already attempted to migrate first */
/* test if we already attempted to migrate first */
if
(
virAsprintf
(
&
updated
,
"%s/DEPRECATED-DIRECTORY"
,
old_base
)
<
0
)
{
if
(
virAsprintf
(
&
updated
,
"%s/DEPRECATED-DIRECTORY"
,
old_base
)
<
0
)
goto
cleanup
;
goto
cleanup
;
}
if
(
virFileExists
(
updated
))
if
(
virFileExists
(
updated
))
{
goto
cleanup
;
goto
cleanup
;
}
config_home
=
virGetEnvBlockSUID
(
"XDG_CONFIG_HOME"
);
config_home
=
virGetEnvBlockSUID
(
"XDG_CONFIG_HOME"
);
if
(
config_home
&&
config_home
[
0
]
!=
'\0'
)
{
if
(
config_home
&&
config_home
[
0
]
!=
'\0'
)
{
if
(
VIR_STRDUP
(
xdg_dir
,
config_home
)
<
0
)
if
(
VIR_STRDUP
(
xdg_dir
,
config_home
)
<
0
)
goto
cleanup
;
goto
cleanup
;
}
else
{
}
else
{
if
(
virAsprintf
(
&
xdg_dir
,
"%s/.config"
,
home
)
<
0
)
{
if
(
virAsprintf
(
&
xdg_dir
,
"%s/.config"
,
home
)
<
0
)
goto
cleanup
;
goto
cleanup
;
}
}
}
old_umask
=
umask
(
077
);
old_umask
=
umask
(
077
);
if
(
virFileMakePath
(
xdg_dir
)
<
0
)
{
if
(
virFileMakePath
(
xdg_dir
)
<
0
)
{
...
@@ -1164,9 +1160,8 @@ int main(int argc, char **argv) {
...
@@ -1164,9 +1160,8 @@ int main(int argc, char **argv) {
c
=
getopt_long
(
argc
,
argv
,
"ldf:p:t:vVh"
,
opts
,
&
optidx
);
c
=
getopt_long
(
argc
,
argv
,
"ldf:p:t:vVh"
,
opts
,
&
optidx
);
if
(
c
==
-
1
)
{
if
(
c
==
-
1
)
break
;
break
;
}
switch
(
c
)
{
switch
(
c
)
{
case
0
:
case
0
:
...
...
daemon/remote.c
浏览文件 @
cfd9c028
...
@@ -500,9 +500,8 @@ remoteRelayDomainEventGraphics(virConnectPtr conn,
...
@@ -500,9 +500,8 @@ remoteRelayDomainEventGraphics(virConnectPtr conn,
authScheme
,
callback
->
callbackID
);
authScheme
,
callback
->
callbackID
);
VIR_DEBUG
(
"Subject %d"
,
subject
->
nidentity
);
VIR_DEBUG
(
"Subject %d"
,
subject
->
nidentity
);
for
(
i
=
0
;
i
<
subject
->
nidentity
;
i
++
)
{
for
(
i
=
0
;
i
<
subject
->
nidentity
;
i
++
)
VIR_DEBUG
(
" %s=%s"
,
subject
->
identities
[
i
].
type
,
subject
->
identities
[
i
].
name
);
VIR_DEBUG
(
" %s=%s"
,
subject
->
identities
[
i
].
type
,
subject
->
identities
[
i
].
name
);
}
/* build return data */
/* build return data */
memset
(
&
data
,
0
,
sizeof
(
data
));
memset
(
&
data
,
0
,
sizeof
(
data
));
...
@@ -4268,9 +4267,8 @@ remoteDispatchDomainOpenGraphicsFd(virNetServerPtr server ATTRIBUTE_UNUSED,
...
@@ -4268,9 +4267,8 @@ remoteDispatchDomainOpenGraphicsFd(virNetServerPtr server ATTRIBUTE_UNUSED,
cleanup:
cleanup:
VIR_FORCE_CLOSE
(
fd
);
VIR_FORCE_CLOSE
(
fd
);
if
(
rv
<
0
)
{
if
(
rv
<
0
)
virNetMessageSaveError
(
rerr
);
virNetMessageSaveError
(
rerr
);
}
if
(
dom
)
if
(
dom
)
virDomainFree
(
dom
);
virDomainFree
(
dom
);
...
@@ -5689,9 +5687,8 @@ remoteDispatchDomainCreateXMLWithFiles(virNetServerPtr server ATTRIBUTE_UNUSED,
...
@@ -5689,9 +5687,8 @@ remoteDispatchDomainCreateXMLWithFiles(virNetServerPtr server ATTRIBUTE_UNUSED,
rv
=
0
;
rv
=
0
;
cleanup:
cleanup:
for
(
i
=
0
;
i
<
nfiles
;
i
++
)
{
for
(
i
=
0
;
i
<
nfiles
;
i
++
)
VIR_FORCE_CLOSE
(
files
[
i
]);
VIR_FORCE_CLOSE
(
files
[
i
]);
}
VIR_FREE
(
files
);
VIR_FREE
(
files
);
if
(
rv
<
0
)
if
(
rv
<
0
)
virNetMessageSaveError
(
rerr
);
virNetMessageSaveError
(
rerr
);
...
@@ -5741,9 +5738,8 @@ static int remoteDispatchDomainCreateWithFiles(virNetServerPtr server ATTRIBUTE_
...
@@ -5741,9 +5738,8 @@ static int remoteDispatchDomainCreateWithFiles(virNetServerPtr server ATTRIBUTE_
rv
=
0
;
rv
=
0
;
cleanup:
cleanup:
for
(
i
=
0
;
i
<
nfiles
;
i
++
)
{
for
(
i
=
0
;
i
<
nfiles
;
i
++
)
VIR_FORCE_CLOSE
(
files
[
i
]);
VIR_FORCE_CLOSE
(
files
[
i
]);
}
VIR_FREE
(
files
);
VIR_FREE
(
files
);
if
(
rv
<
0
)
if
(
rv
<
0
)
virNetMessageSaveError
(
rerr
);
virNetMessageSaveError
(
rerr
);
...
...
examples/object-events/event-test.c
浏览文件 @
cfd9c028
...
@@ -730,9 +730,8 @@ int main(int argc, char **argv)
...
@@ -730,9 +730,8 @@ int main(int argc, char **argv)
virConnectUnregisterCloseCallback
(
dconn
,
connectClose
);
virConnectUnregisterCloseCallback
(
dconn
,
connectClose
);
VIR_DEBUG
(
"Closing connection"
);
VIR_DEBUG
(
"Closing connection"
);
if
(
dconn
&&
virConnectClose
(
dconn
)
<
0
)
{
if
(
dconn
&&
virConnectClose
(
dconn
)
<
0
)
printf
(
"error closing
\n
"
);
printf
(
"error closing
\n
"
);
}
printf
(
"done
\n
"
);
printf
(
"done
\n
"
);
return
0
;
return
0
;
...
...
examples/openauth/openauth.c
浏览文件 @
cfd9c028
...
@@ -132,9 +132,8 @@ showDomains(virConnectPtr conn)
...
@@ -132,9 +132,8 @@ showDomains(virConnectPtr conn)
goto
out
;
goto
out
;
}
}
if
(
numNames
>
0
)
{
if
(
numNames
>
0
)
printf
(
"Inactive domains:
\n
"
);
printf
(
"Inactive domains:
\n
"
);
}
for
(
i
=
0
;
i
<
numNames
;
i
++
)
{
for
(
i
=
0
;
i
<
numNames
;
i
++
)
{
printf
(
" %s
\n
"
,
*
(
nameList
+
i
));
printf
(
" %s
\n
"
,
*
(
nameList
+
i
));
...
@@ -181,9 +180,8 @@ authCallback(virConnectCredentialPtr cred, unsigned int ncred, void *cbdata)
...
@@ -181,9 +180,8 @@ authCallback(virConnectCredentialPtr cred, unsigned int ncred, void *cbdata)
case
VIR_CRED_AUTHNAME
:
case
VIR_CRED_AUTHNAME
:
cred
[
i
].
result
=
strdup
(
authData
->
username
);
cred
[
i
].
result
=
strdup
(
authData
->
username
);
if
(
cred
[
i
].
result
==
NULL
)
{
if
(
cred
[
i
].
result
==
NULL
)
return
-
1
;
return
-
1
;
}
cred
[
i
].
resultlen
=
strlen
(
cred
[
i
].
result
);
cred
[
i
].
resultlen
=
strlen
(
cred
[
i
].
result
);
break
;
break
;
...
@@ -191,9 +189,8 @@ authCallback(virConnectCredentialPtr cred, unsigned int ncred, void *cbdata)
...
@@ -191,9 +189,8 @@ authCallback(virConnectCredentialPtr cred, unsigned int ncred, void *cbdata)
case
VIR_CRED_PASSPHRASE
:
case
VIR_CRED_PASSPHRASE
:
cred
[
i
].
result
=
strdup
(
authData
->
password
);
cred
[
i
].
result
=
strdup
(
authData
->
password
);
if
(
cred
[
i
].
result
==
NULL
)
{
if
(
cred
[
i
].
result
==
NULL
)
return
-
1
;
return
-
1
;
}
cred
[
i
].
resultlen
=
strlen
(
cred
[
i
].
result
);
cred
[
i
].
resultlen
=
strlen
(
cred
[
i
].
result
);
break
;
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录