Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b3e7890a
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,发现更多精彩内容 >>
提交
b3e7890a
编写于
2月 19, 2010
作者:
S
Stefan Berger
提交者:
Daniel Veillard
2月 19, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
macvtap mac_filter support
This patch adds the mac_filter support to the macvtap device.
上级
62f4ae15
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
3 deletion
+15
-3
src/qemu/qemu_conf.c
src/qemu/qemu_conf.c
+13
-2
src/qemu/qemu_conf.h
src/qemu/qemu_conf.h
+1
-0
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+1
-1
未找到文件。
src/qemu/qemu_conf.c
浏览文件 @
b3e7890a
...
...
@@ -335,7 +335,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
if
(
!
(
driver
->
ebtables
=
ebtablesContextNew
(
"qemu"
)))
{
driver
->
macFilter
=
0
;
virReportSystemError
(
errno
,
_
(
"failed to enable mac filter in
in
'%s'"
),
_
(
"failed to enable mac filter in '%s'"
),
__FILE__
);
}
...
...
@@ -1432,6 +1432,7 @@ int qemudExtractVersion(struct qemud_driver *driver) {
*/
int
qemudPhysIfaceConnect
(
virConnectPtr
conn
,
struct
qemud_driver
*
driver
,
virDomainNetDefPtr
net
,
char
*
linkdev
,
int
brmode
,
...
...
@@ -1441,6 +1442,7 @@ qemudPhysIfaceConnect(virConnectPtr conn,
#if WITH_MACVTAP
char
*
res_ifname
=
NULL
;
int
vnet_hdr
=
0
;
int
err
;
if
(
qemuCmdFlags
&
QEMUD_CMD_FLAG_VNET_HDR
&&
net
->
model
&&
STREQ
(
net
->
model
,
"virtio"
))
...
...
@@ -1452,12 +1454,21 @@ qemudPhysIfaceConnect(virConnectPtr conn,
VIR_FREE
(
net
->
ifname
);
net
->
ifname
=
res_ifname
;
}
if
(
rc
>=
0
&&
driver
->
macFilter
)
{
if
((
err
=
networkAllowMacOnPort
(
driver
,
net
->
ifname
,
net
->
mac
)))
{
virReportSystemError
(
err
,
_
(
"failed to add ebtables rule to allow MAC address on '%s'"
),
net
->
ifname
);
}
}
#else
(
void
)
conn
;
(
void
)
net
;
(
void
)
linkdev
;
(
void
)
brmode
;
(
void
)
qemuCmdFlags
;
(
void
)
driver
;
qemuReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"No support for macvtap device"
));
rc
=
-
1
;
...
...
@@ -3757,7 +3768,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
if
(
snprintf
(
tapfd_name
,
sizeof
(
tapfd_name
),
"%d"
,
tapfd
)
>=
sizeof
(
tapfd_name
))
goto
no_memory
;
}
else
if
(
net
->
type
==
VIR_DOMAIN_NET_TYPE_DIRECT
)
{
int
tapfd
=
qemudPhysIfaceConnect
(
conn
,
net
,
int
tapfd
=
qemudPhysIfaceConnect
(
conn
,
driver
,
net
,
net
->
data
.
direct
.
linkdev
,
net
->
data
.
direct
.
mode
,
qemuCmdFlags
);
...
...
src/qemu/qemu_conf.h
浏览文件 @
b3e7890a
...
...
@@ -251,6 +251,7 @@ int qemudNetworkIfaceConnect (virConnectPtr conn,
ATTRIBUTE_NONNULL
(
1
);
int
qemudPhysIfaceConnect
(
virConnectPtr
conn
,
struct
qemud_driver
*
driver
,
virDomainNetDefPtr
net
,
char
*
linkdev
,
int
brmode
,
...
...
src/qemu/qemu_driver.c
浏览文件 @
b3e7890a
...
...
@@ -5723,7 +5723,7 @@ static int qemudDomainAttachNetDevice(virConnectPtr conn,
return
-
1
;
}
if
((
tapfd
=
qemudPhysIfaceConnect
(
conn
,
net
,
if
((
tapfd
=
qemudPhysIfaceConnect
(
conn
,
driver
,
net
,
net
->
data
.
direct
.
linkdev
,
net
->
data
.
direct
.
mode
,
qemuCmdFlags
))
<
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录