Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
91cc3d95
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看板
提交
91cc3d95
编写于
11月 13, 2014
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary curly brackets in tools/
Signed-off-by:
N
Martin Kletzander
<
mkletzan@redhat.com
>
上级
4fab1209
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
28 addition
and
56 deletion
+28
-56
tools/virsh-console.c
tools/virsh-console.c
+2
-4
tools/virsh-domain.c
tools/virsh-domain.c
+9
-18
tools/virsh-edit.c
tools/virsh-edit.c
+2
-4
tools/virsh-host.c
tools/virsh-host.c
+1
-2
tools/virsh-pool.c
tools/virsh-pool.c
+2
-4
tools/virsh-volume.c
tools/virsh-volume.c
+4
-8
tools/virsh.c
tools/virsh.c
+6
-12
tools/wireshark/src/packet-libvirt.c
tools/wireshark/src/packet-libvirt.c
+2
-4
未找到文件。
tools/virsh-console.c
浏览文件 @
91cc3d95
...
...
@@ -224,9 +224,8 @@ virConsoleEventOnStdin(int watch ATTRIBUTE_UNUSED,
con
->
terminalToStream
.
offset
,
avail
);
if
(
got
<
0
)
{
if
(
errno
!=
EAGAIN
)
{
if
(
errno
!=
EAGAIN
)
virConsoleShutdown
(
con
);
}
return
;
}
if
(
got
==
0
)
{
...
...
@@ -268,9 +267,8 @@ virConsoleEventOnStdout(int watch ATTRIBUTE_UNUSED,
con
->
streamToTerminal
.
data
,
con
->
streamToTerminal
.
offset
);
if
(
done
<
0
)
{
if
(
errno
!=
EAGAIN
)
{
if
(
errno
!=
EAGAIN
)
virConsoleShutdown
(
con
);
}
return
;
}
memmove
(
con
->
streamToTerminal
.
data
,
...
...
tools/virsh-domain.c
浏览文件 @
91cc3d95
...
...
@@ -161,9 +161,8 @@ vshNodeGetCPUCount(virConnectPtr conn)
if
((
ret
=
virNodeGetCPUMap
(
conn
,
NULL
,
NULL
,
0
))
<
0
)
{
/* fall back to nodeinfo */
vshResetLibvirtError
();
if
(
virNodeGetInfo
(
conn
,
&
nodeinfo
)
==
0
)
{
if
(
virNodeGetInfo
(
conn
,
&
nodeinfo
)
==
0
)
ret
=
VIR_NODEINFO_MAXCPUS
(
nodeinfo
);
}
}
return
ret
;
}
...
...
@@ -3446,9 +3445,8 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd)
flags
|=
VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA
;
snapshots_safe
=
true
;
}
if
(
nvram
)
{
if
(
nvram
)
flags
|=
VIR_DOMAIN_UNDEFINE_NVRAM
;
}
if
(
!
(
dom
=
vshCommandOptDomain
(
ctl
,
cmd
,
&
name
)))
return
false
;
...
...
@@ -3498,9 +3496,8 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd)
flags
&=
~
VIR_DOMAIN_UNDEFINE_MANAGED_SAVE
;
managed_save_safe
=
true
;
}
if
(
has_snapshots
==
0
)
{
if
(
has_snapshots
==
0
)
snapshots_safe
=
true
;
}
if
(
has_snapshots_metadata
==
0
)
{
flags
&=
~
VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA
;
snapshots_safe
=
true
;
...
...
@@ -6183,9 +6180,8 @@ vshPrintPinInfo(unsigned char *cpumaps, size_t cpumaplen,
int
cpu
,
lastcpu
;
bool
bit
,
lastbit
,
isInvert
;
if
(
!
cpumaps
||
cpumaplen
<=
0
||
maxcpu
<=
0
||
vcpuindex
<
0
)
{
if
(
!
cpumaps
||
cpumaplen
<=
0
||
maxcpu
<=
0
||
vcpuindex
<
0
)
return
false
;
}
bit
=
lastbit
=
isInvert
=
false
;
lastcpu
=
-
1
;
...
...
@@ -6205,9 +6201,8 @@ vshPrintPinInfo(unsigned char *cpumaps, size_t cpumaplen,
vshPrint
(
ctl
,
"-%d"
,
cpu
-
1
);
lastbit
=
bit
;
}
if
(
bit
&&
!
isInvert
)
{
if
(
bit
&&
!
isInvert
)
vshPrint
(
ctl
,
"-%d"
,
maxcpu
-
1
);
}
return
true
;
}
...
...
@@ -6364,9 +6359,8 @@ cmdVcpuPin(vshControl *ctl, const vshCmd *cmd)
goto
cleanup
;
}
if
((
maxcpu
=
vshNodeGetCPUCount
(
ctl
->
conn
))
<
0
)
{
if
((
maxcpu
=
vshNodeGetCPUCount
(
ctl
->
conn
))
<
0
)
goto
cleanup
;
}
cpumaplen
=
VIR_CPU_MAPLEN
(
maxcpu
);
...
...
@@ -7934,13 +7928,11 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd)
kibibytes
=
VIR_DIV_UP
(
bytes
,
1024
);
if
(
flags
==
-
1
)
{
if
(
virDomainSetMemory
(
dom
,
kibibytes
)
!=
0
)
{
if
(
virDomainSetMemory
(
dom
,
kibibytes
)
!=
0
)
ret
=
false
;
}
}
else
{
if
(
virDomainSetMemoryFlags
(
dom
,
kibibytes
,
flags
)
<
0
)
{
if
(
virDomainSetMemoryFlags
(
dom
,
kibibytes
,
flags
)
<
0
)
ret
=
false
;
}
}
virDomainFree
(
dom
);
...
...
@@ -9494,9 +9486,8 @@ doMigrate(void *opaque)
if
(
vshCommandOptBool
(
cmd
,
"rdma-pin-all"
))
flags
|=
VIR_MIGRATE_RDMA_PIN_ALL
;
if
(
vshCommandOptBool
(
cmd
,
"offline"
))
{
if
(
vshCommandOptBool
(
cmd
,
"offline"
))
flags
|=
VIR_MIGRATE_OFFLINE
;
}
if
(
vshCommandOptBool
(
cmd
,
"abort-on-error"
))
flags
|=
VIR_MIGRATE_ABORT_ON_ERROR
;
...
...
tools/virsh-edit.c
浏览文件 @
91cc3d95
...
...
@@ -85,9 +85,8 @@ do {
goto
edit_cleanup
;
/* Compare original XML with edited. Has it changed at all? */
if
(
STREQ
(
doc
,
doc_edited
))
{
if
(
STREQ
(
doc
,
doc_edited
))
EDIT_NOT_CHANGED
;
}
redefine:
msg
=
NULL
;
...
...
@@ -109,9 +108,8 @@ do {
}
/* Everything checks out, so redefine the object. */
if
(
!
msg
&&
!
(
EDIT_DEFINE
))
{
if
(
!
msg
&&
!
(
EDIT_DEFINE
))
msg
=
_
(
"Failed."
);
}
if
(
msg
)
{
int
c
=
vshAskReedit
(
ctl
,
msg
);
...
...
tools/virsh-host.c
浏览文件 @
91cc3d95
...
...
@@ -376,9 +376,8 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd)
goto
cleanup
;
vshPrint
(
ctl
,
_
(
"Node %d:
\n
"
),
cell
);
for
(
j
=
0
;
j
<
npages
;
j
++
)
{
for
(
j
=
0
;
j
<
npages
;
j
++
)
vshPrint
(
ctl
,
"%uKiB: %lld
\n
"
,
pagesize
[
j
],
counts
[
j
]);
}
vshPrint
(
ctl
,
"%c"
,
'\n'
);
}
...
...
tools/virsh-pool.c
浏览文件 @
91cc3d95
...
...
@@ -470,13 +470,11 @@ cmdPoolBuild(vshControl *ctl, const vshCmd *cmd)
if
(
!
(
pool
=
vshCommandOptPool
(
ctl
,
cmd
,
"pool"
,
&
name
)))
return
false
;
if
(
vshCommandOptBool
(
cmd
,
"no-overwrite"
))
{
if
(
vshCommandOptBool
(
cmd
,
"no-overwrite"
))
flags
|=
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE
;
}
if
(
vshCommandOptBool
(
cmd
,
"overwrite"
))
{
if
(
vshCommandOptBool
(
cmd
,
"overwrite"
))
flags
|=
VIR_STORAGE_POOL_BUILD_OVERWRITE
;
}
if
(
virStoragePoolBuild
(
pool
,
flags
)
==
0
)
{
vshPrint
(
ctl
,
_
(
"Pool %s built
\n
"
),
name
);
...
...
tools/virsh-volume.c
浏览文件 @
91cc3d95
...
...
@@ -687,9 +687,8 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd)
return
false
;
}
if
(
!
(
vol
=
vshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
&
name
)))
{
if
(
!
(
vol
=
vshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
&
name
)))
return
false
;
}
if
(
vshCommandOptStringReq
(
ctl
,
cmd
,
"file"
,
&
file
)
<
0
)
goto
cleanup
;
...
...
@@ -885,9 +884,8 @@ cmdVolDelete(vshControl *ctl, const vshCmd *cmd)
bool
ret
=
true
;
const
char
*
name
;
if
(
!
(
vol
=
vshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
&
name
)))
{
if
(
!
(
vol
=
vshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
&
name
)))
return
false
;
}
if
(
virStorageVolDelete
(
vol
,
0
)
==
0
)
{
vshPrint
(
ctl
,
_
(
"Vol %s deleted
\n
"
),
name
);
...
...
@@ -945,9 +943,8 @@ cmdVolWipe(vshControl *ctl, const vshCmd *cmd)
int
algorithm
=
VIR_STORAGE_VOL_WIPE_ALG_ZERO
;
int
funcRet
;
if
(
!
(
vol
=
vshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
&
name
)))
{
if
(
!
(
vol
=
vshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
&
name
)))
return
false
;
}
if
(
vshCommandOptStringReq
(
ctl
,
cmd
,
"algorithm"
,
&
algorithm_str
)
<
0
)
goto
out
;
...
...
@@ -1741,9 +1738,8 @@ cmdVolPath(vshControl *ctl, const vshCmd *cmd)
virStorageVolPtr
vol
;
char
*
StorageVolPath
;
if
(
!
(
vol
=
vshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
NULL
)))
{
if
(
!
(
vol
=
vshCommandOptVol
(
ctl
,
cmd
,
"vol"
,
"pool"
,
NULL
)))
return
false
;
}
if
((
StorageVolPath
=
virStorageVolGetPath
(
vol
))
==
NULL
)
{
virStorageVolFree
(
vol
);
...
...
tools/virsh.c
浏览文件 @
91cc3d95
...
...
@@ -499,9 +499,8 @@ vshPrintRaw(vshControl *ctl, ...)
char
*
key
;
va_start
(
ap
,
ctl
);
while
((
key
=
va_arg
(
ap
,
char
*
))
!=
NULL
)
{
while
((
key
=
va_arg
(
ap
,
char
*
))
!=
NULL
)
vshPrint
(
ctl
,
"%s
\r\n
"
,
key
);
}
va_end
(
ap
);
}
...
...
@@ -874,9 +873,8 @@ cmdCd(vshControl *ctl, const vshCmd *cmd)
return
false
;
}
if
(
vshCommandOptString
(
cmd
,
"dir"
,
&
dir
)
<=
0
)
{
if
(
vshCommandOptString
(
cmd
,
"dir"
,
&
dir
)
<=
0
)
dir
=
dir_malloced
=
virGetUserDirectory
();
}
if
(
!
dir
)
dir
=
"/"
;
...
...
@@ -1139,9 +1137,8 @@ vshCmddefGetOption(vshControl *ctl, const vshCmdDef *cmd, const char *name,
const
vshCmdOptDef
*
ret
=
NULL
;
char
*
alias
=
NULL
;
if
(
STREQ
(
name
,
helpopt
.
name
))
{
if
(
STREQ
(
name
,
helpopt
.
name
))
return
&
helpopt
;
}
for
(
i
=
0
;
cmd
->
opts
&&
cmd
->
opts
[
i
].
name
;
i
++
)
{
const
vshCmdOptDef
*
opt
=
&
cmd
->
opts
[
i
];
...
...
@@ -1651,9 +1648,8 @@ vshCommandOptString(const vshCmd *cmd, const char *name, const char **value)
if
(
ret
<=
0
)
return
ret
;
if
(
!*
arg
->
data
&&
!
(
arg
->
def
->
flags
&
VSH_OFLAG_EMPTY_OK
))
{
if
(
!*
arg
->
data
&&
!
(
arg
->
def
->
flags
&
VSH_OFLAG_EMPTY_OK
))
return
-
1
;
}
*
value
=
arg
->
data
;
return
1
;
}
...
...
@@ -1848,9 +1844,8 @@ vshCommandOptArgv(const vshCmd *cmd, const vshCmdOpt *opt)
opt
=
opt
?
opt
->
next
:
cmd
->
opts
;
while
(
opt
)
{
if
(
opt
->
def
->
type
==
VSH_OT_ARGV
)
{
if
(
opt
->
def
->
type
==
VSH_OT_ARGV
)
return
opt
;
}
opt
=
opt
->
next
;
}
return
NULL
;
...
...
@@ -3712,9 +3707,8 @@ main(int argc, char **argv)
else
progname
++
;
if
((
defaultConn
=
virGetEnvBlockSUID
(
"VIRSH_DEFAULT_CONNECT_URI"
)))
{
if
((
defaultConn
=
virGetEnvBlockSUID
(
"VIRSH_DEFAULT_CONNECT_URI"
)))
ctl
->
name
=
vshStrdup
(
ctl
,
defaultConn
);
}
vshInitDebug
(
ctl
);
...
...
tools/wireshark/src/packet-libvirt.c
浏览文件 @
91cc3d95
...
...
@@ -249,9 +249,8 @@ find_payload_dissector(guint32 proc, guint32 type,
first
=
pds
[
0
].
proc
;
last
=
pds
[
length
-
1
].
proc
;
if
(
proc
<
first
||
proc
>
last
)
{
if
(
proc
<
first
||
proc
>
last
)
return
NULL
;
}
pd
=
&
pds
[
proc
-
first
];
/* There is no guarantee to proc numbers has no gap */
...
...
@@ -329,9 +328,8 @@ dissect_libvirt_payload_xdr_data(tvbuff_t *tvb, proto_tree *tree, gint payload_l
xdr_destroy
(
&
xdrs
);
g_free
(
payload_data
);
if
(
nfds
!=
0
)
{
if
(
nfds
!=
0
)
dissect_libvirt_fds
(
tvb
,
start
+
payload_length
,
nfds
);
}
}
static
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录