Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
50e9b389
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看板
提交
50e9b389
编写于
1月 31, 2012
作者:
M
Michal Privoznik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Clenup qemuDomainSetInterfaceParameters
which contained some useless lines, copied code, NULL dereference.
上级
bb311b34
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
30 deletion
+18
-30
src/libvirt.c
src/libvirt.c
+2
-2
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+16
-28
未找到文件。
src/libvirt.c
浏览文件 @
50e9b389
...
...
@@ -7226,8 +7226,8 @@ error:
*
* Change a subset or all parameters of interface; currently this
* includes bandwidth parameters. The value of @flags should be
* either VIR_DOMAIN_AFFECT_CURRENT, or a bitwise-or of values
from
* VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_C
URRENT
, although
* either VIR_DOMAIN_AFFECT_CURRENT, or a bitwise-or of values
* VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_C
ONFIG
, although
* hypervisors vary in which flags are supported.
*
* This function may require privileged access to the hypervisor.
...
...
src/qemu/qemu_driver.c
浏览文件 @
50e9b389
...
...
@@ -7779,20 +7779,12 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
}
}
if
(
VIR_ALLOC
(
bandwidth
)
<
0
)
{
if
((
VIR_ALLOC
(
bandwidth
)
<
0
)
||
(
VIR_ALLOC
(
bandwidth
->
in
)
<
0
)
||
(
VIR_ALLOC
(
bandwidth
->
out
)
<
0
))
{
virReportOOMError
();
goto
cleanup
;
}
if
(
VIR_ALLOC
(
bandwidth
->
in
)
<
0
)
{
virReportOOMError
();
goto
cleanup
;
}
memset
(
bandwidth
->
in
,
0
,
sizeof
(
*
bandwidth
->
in
));
if
(
VIR_ALLOC
(
bandwidth
->
out
)
<
0
)
{
virReportOOMError
();
goto
cleanup
;
}
memset
(
bandwidth
->
out
,
0
,
sizeof
(
*
bandwidth
->
out
));
for
(
i
=
0
;
i
<
nparams
;
i
++
)
{
virTypedParameterPtr
param
=
&
params
[
i
];
...
...
@@ -7817,11 +7809,9 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
* inbound/outbound to not be set. */
if
(
!
bandwidth
->
in
->
average
)
{
VIR_FREE
(
bandwidth
->
in
);
bandwidth
->
in
=
NULL
;
}
if
(
!
bandwidth
->
out
->
average
)
{
VIR_FREE
(
bandwidth
->
out
);
bandwidth
->
out
=
NULL
;
}
if
(
flags
&
VIR_DOMAIN_AFFECT_LIVE
)
{
...
...
@@ -7833,29 +7823,27 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
/* virNetDevBandwidthSet() will clear any previous value of
* bandwidth parameters, so merge with old bandwidth parameters
* here to prevent them from being lost. */
if
(
bandwidth
->
in
||
net
->
bandwidth
->
in
)
{
if
(
bandwidth
->
in
||
(
net
->
bandwidth
&&
net
->
bandwidth
->
in
))
{
if
(
VIR_ALLOC
(
newBandwidth
->
in
)
<
0
)
{
virReportOOMError
();
goto
cleanup
;
}
if
(
bandwidth
->
in
)
memcpy
(
newBandwidth
->
in
,
bandwidth
->
in
,
sizeof
(
*
newBandwidth
->
in
));
else
if
(
net
->
bandwidth
->
in
)
memcpy
(
newBandwidth
->
in
,
net
->
bandwidth
->
in
,
sizeof
(
*
newBandwidth
->
in
));
}
if
(
bandwidth
->
out
||
net
->
bandwidth
->
out
)
{
memcpy
(
newBandwidth
->
in
,
bandwidth
->
in
?
bandwidth
->
in
:
net
->
bandwidth
->
in
,
sizeof
(
*
newBandwidth
->
in
));
}
if
(
bandwidth
->
out
||
(
net
->
bandwidth
&&
net
->
bandwidth
->
out
))
{
if
(
VIR_ALLOC
(
newBandwidth
->
out
)
<
0
)
{
virReportOOMError
();
goto
cleanup
;
}
if
(
bandwidth
->
out
)
memcpy
(
newBandwidth
->
out
,
bandwidth
->
out
,
sizeof
(
*
newBandwidth
->
out
));
else
if
(
net
->
bandwidth
->
out
)
memcpy
(
newBandwidth
->
out
,
net
->
bandwidth
->
out
,
sizeof
(
*
newBandwidth
->
out
));
memcpy
(
newBandwidth
->
out
,
bandwidth
->
out
?
bandwidth
->
out
:
net
->
bandwidth
->
out
,
sizeof
(
*
newBandwidth
->
out
));
}
if
(
virNetDevBandwidthSet
(
net
->
ifname
,
newBandwidth
)
<
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录