Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
c34a9d6e
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看板
提交
c34a9d6e
编写于
4月 20, 2016
作者:
N
Nikolay Shirokovskiy
提交者:
Maxim Nestratov
6月 25, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vz: dump route info in domain xml
Signed-off-by:
N
Nikolay Shirokovskiy
<
nshirokovskiy@virtuozzo.com
>
上级
b86396dc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
49 addition
and
2 deletion
+49
-2
src/conf/networkcommon_conf.c
src/conf/networkcommon_conf.c
+1
-1
src/conf/networkcommon_conf.h
src/conf/networkcommon_conf.h
+1
-1
src/vz/vz_sdk.c
src/vz/vz_sdk.c
+47
-0
未找到文件。
src/conf/networkcommon_conf.c
浏览文件 @
c34a9d6e
...
...
@@ -60,7 +60,7 @@ virNetworkRouteDefFree(virNetworkRouteDefPtr def)
virNetworkRouteDefPtr
virNetworkRouteDefCreate
(
const
char
*
errorDetail
,
char
*
family
,
c
onst
c
har
*
family
,
const
char
*
address
,
const
char
*
netmask
,
const
char
*
gateway
,
...
...
src/conf/networkcommon_conf.h
浏览文件 @
c34a9d6e
...
...
@@ -40,7 +40,7 @@ virNetworkRouteDefFree(virNetworkRouteDefPtr def);
virNetworkRouteDefPtr
virNetworkRouteDefCreate
(
const
char
*
networkName
,
char
*
family
,
c
onst
c
har
*
family
,
const
char
*
address
,
const
char
*
netmask
,
const
char
*
gateway
,
...
...
src/vz/vz_sdk.c
浏览文件 @
c34a9d6e
...
...
@@ -832,6 +832,50 @@ prlsdkGetNetAddresses(PRL_HANDLE sdknet, virDomainNetDefPtr net)
return
ret
;
}
static
int
prlsdkGetRoutes
(
PRL_HANDLE
sdknet
,
virDomainNetDefPtr
net
)
{
int
ret
=
-
1
;
char
*
gw
=
NULL
;
char
*
gw6
=
NULL
;
virNetworkRouteDefPtr
route
=
NULL
;
if
(
!
(
gw
=
prlsdkGetStringParamVar
(
PrlVmDevNet_GetDefaultGateway
,
sdknet
)))
goto
cleanup
;
if
(
!
(
gw6
=
prlsdkGetStringParamVar
(
PrlVmDevNet_GetDefaultGatewayIPv6
,
sdknet
)))
goto
cleanup
;
if
(
*
gw
!=
'\0'
)
{
if
(
!
(
route
=
virNetworkRouteDefCreate
(
_
(
"Domain interface"
),
"ipv4"
,
VIR_SOCKET_ADDR_IPV4_ALL
,
NULL
,
gw
,
0
,
true
,
0
,
false
)))
goto
cleanup
;
if
(
VIR_APPEND_ELEMENT
(
net
->
routes
,
net
->
nroutes
,
route
)
<
0
)
goto
cleanup
;
}
if
(
*
gw6
!=
'\0'
)
{
if
(
!
(
route
=
virNetworkRouteDefCreate
(
_
(
"Domain interface"
),
"ipv6"
,
VIR_SOCKET_ADDR_IPV6_ALL
,
NULL
,
gw6
,
0
,
true
,
0
,
false
)))
goto
cleanup
;
if
(
VIR_APPEND_ELEMENT
(
net
->
routes
,
net
->
nroutes
,
route
)
<
0
)
goto
cleanup
;
}
ret
=
0
;
cleanup:
VIR_FREE
(
route
);
VIR_FREE
(
gw
);
VIR_FREE
(
gw6
);
return
ret
;
}
static
int
prlsdkGetNetInfo
(
PRL_HANDLE
netAdapter
,
virDomainNetDefPtr
net
,
bool
isCt
)
{
...
...
@@ -874,6 +918,9 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt)
if
(
prlsdkGetNetAddresses
(
netAdapter
,
net
)
<
0
)
goto
cleanup
;
if
(
prlsdkGetRoutes
(
netAdapter
,
net
)
<
0
)
goto
cleanup
;
pret
=
PrlVmDev_GetEmulatedType
(
netAdapter
,
&
emulatedType
);
prlsdkCheckRetGoto
(
pret
,
cleanup
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录