Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
21f52833
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看板
提交
21f52833
编写于
11月 16, 2010
作者:
O
Osier Yang
提交者:
Eric Blake
11月 16, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virsh: add net-info command
To list basic information about the network. * tools/virsh.c * tools/virsh.pod
上级
61af79c1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
63 addition
and
0 deletion
+63
-0
tools/virsh.c
tools/virsh.c
+59
-0
tools/virsh.pod
tools/virsh.pod
+4
-0
未找到文件。
tools/virsh.c
浏览文件 @
21f52833
...
...
@@ -3678,6 +3678,64 @@ cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd)
return
ret
;
}
/*
* "net-info" command
*/
static
const
vshCmdInfo
info_network_info
[]
=
{
{
"help"
,
N_
(
"network information"
)},
{
"desc"
,
"Returns basic information about the network"
},
{
NULL
,
NULL
}
};
static
const
vshCmdOptDef
opts_network_info
[]
=
{
{
"network"
,
VSH_OT_DATA
,
VSH_OFLAG_REQ
,
N_
(
"network name"
)},
{
NULL
,
0
,
0
,
NULL
}
};
static
int
cmdNetworkInfo
(
vshControl
*
ctl
,
const
vshCmd
*
cmd
)
{
virNetworkPtr
network
;
char
uuid
[
VIR_UUID_STRING_BUFLEN
];
int
autostart
;
int
persistent
=
-
1
;
int
active
=
-
1
;
char
*
bridge
=
NULL
;
if
(
!
vshConnectionUsability
(
ctl
,
ctl
->
conn
))
return
FALSE
;
if
(
!
(
network
=
vshCommandOptNetworkBy
(
ctl
,
cmd
,
NULL
,
VSH_BYNAME
)))
return
FALSE
;
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Name"
),
virNetworkGetName
(
network
));
if
(
virNetworkGetUUIDString
(
network
,
uuid
)
==
0
)
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"UUID"
),
uuid
);
active
=
virNetworkIsActive
(
network
);
if
(
active
>=
0
)
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Active:"
),
active
?
_
(
"yes"
)
:
_
(
"no"
));
persistent
=
virNetworkIsPersistent
(
network
);
if
(
persistent
<
0
)
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Persistent:"
),
_
(
"unknown"
));
else
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Persistent:"
),
persistent
?
_
(
"yes"
)
:
_
(
"no"
));
if
(
virNetworkGetAutostart
(
network
,
&
autostart
)
<
0
)
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Autostart:"
),
_
(
"no autostart"
));
else
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Autostart:"
),
autostart
?
_
(
"yes"
)
:
_
(
"no"
));
bridge
=
virNetworkGetBridgeName
(
network
);
if
(
bridge
)
vshPrint
(
ctl
,
"%-15s %s
\n
"
,
_
(
"Bridge:"
),
bridge
);
virNetworkFree
(
network
);
return
TRUE
;
}
/*
* "iface-edit" command
...
...
@@ -9879,6 +9937,7 @@ static const vshCmdDef commands[] = {
{
"net-destroy"
,
cmdNetworkDestroy
,
opts_network_destroy
,
info_network_destroy
},
{
"net-dumpxml"
,
cmdNetworkDumpXML
,
opts_network_dumpxml
,
info_network_dumpxml
},
{
"net-edit"
,
cmdNetworkEdit
,
opts_network_edit
,
info_network_edit
},
{
"net-info"
,
cmdNetworkInfo
,
opts_network_info
,
info_network_info
},
{
"net-list"
,
cmdNetworkList
,
opts_network_list
,
info_network_list
},
{
"net-name"
,
cmdNetworkName
,
opts_network_name
,
info_network_name
},
{
"net-start"
,
cmdNetworkStart
,
opts_network_start
,
info_network_start
},
...
...
tools/virsh.pod
浏览文件 @
21f52833
...
...
@@ -743,6 +743,10 @@ except that it does some error checking.
The editor used can be supplied by the C<$VISUAL> or C<$EDITOR> environment
variables, and defaults to C<vi>.
=item B<net-info> I<network>
Returns basic information about the I<network> object.
=item B<net-list> optional I<--inactive> or I<--all>
Returns the list of active networks, if I<--all> is specified this will also
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录