Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
0b4645a7
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看板
提交
0b4645a7
编写于
6月 21, 2016
作者:
L
Laine Stump
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: support setting host-side IP addresses/routes
For type='ethernet' interfaces only.
上级
cd5c9f21
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
113 addition
and
1 deletion
+113
-1
src/qemu/qemu_interface.c
src/qemu/qemu_interface.c
+5
-1
tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args
tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args
+23
-0
tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.xml
tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.xml
+39
-0
tests/qemuxml2argvtest.c
tests/qemuxml2argvtest.c
+1
-0
tests/qemuxml2xmloutdata/qemuxml2xmlout-net-eth-hostip.xml
tests/qemuxml2xmloutdata/qemuxml2xmlout-net-eth-hostip.xml
+44
-0
tests/qemuxml2xmltest.c
tests/qemuxml2xmltest.c
+1
-0
未找到文件。
src/qemu/qemu_interface.c
浏览文件 @
0b4645a7
...
...
@@ -196,8 +196,12 @@ qemuInterfaceStopDevice(virDomainNetDefPtr net)
break
;
}
case
VIR_DOMAIN_NET_TYPE_USER
:
case
VIR_DOMAIN_NET_TYPE_ETHERNET
:
if
(
virNetDevIPInfoAddToDev
(
net
->
ifname
,
&
net
->
hostIP
)
<
0
)
goto
cleanup
;
break
;
case
VIR_DOMAIN_NET_TYPE_USER
:
case
VIR_DOMAIN_NET_TYPE_VHOSTUSER
:
case
VIR_DOMAIN_NET_TYPE_SERVER
:
case
VIR_DOMAIN_NET_TYPE_CLIENT
:
...
...
tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args
0 → 100644
浏览文件 @
0b4645a7
LC_ALL=C \
PATH=/bin \
HOME=/home/test \
USER=test \
LOGNAME=test \
QEMU_AUDIO_DRV=none \
/usr/bin/qemu \
-name QEMUGuest1 \
-S \
-M pc \
-m 214 \
-smp 1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-nographic \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
-no-acpi \
-boot c \
-usb \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-device rtl8139,vlan=0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x3 \
-net tap,fd=3,vlan=0,name=hostnet0
tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.xml
0 → 100644
浏览文件 @
0b4645a7
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory
unit=
'KiB'
>
219100
</memory>
<currentMemory
unit=
'KiB'
>
219100
</currentMemory>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/usr/bin/qemu
</emulator>
<disk
type=
'block'
device=
'disk'
>
<driver
name=
'qemu'
type=
'raw'
/>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
bus=
'ide'
/>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'0'
unit=
'0'
/>
</disk>
<controller
type=
'usb'
index=
'0'
/>
<controller
type=
'ide'
index=
'0'
/>
<controller
type=
'pci'
index=
'0'
model=
'pci-root'
/>
<interface
type=
'ethernet'
>
<mac
address=
'00:11:22:33:44:55'
/>
<source>
<ip
address=
'192.168.125.1'
family=
'ipv4'
prefix=
'24'
peer=
'192.168.125.2'
/>
<route
family=
'ipv4'
address=
'10.20.0.0'
prefix=
'16'
gateway=
'192.168.125.2'
/>
</source>
<script
path=
'/etc/qemu-ifup'
/>
<model
type=
'rtl8139'
/>
</interface>
<input
type=
'mouse'
bus=
'ps2'
/>
<input
type=
'keyboard'
bus=
'ps2'
/>
<memballoon
model=
'none'
/>
</devices>
</domain>
tests/qemuxml2argvtest.c
浏览文件 @
0b4645a7
...
...
@@ -1012,6 +1012,7 @@ mymain(void)
DO_TEST
(
"net-eth"
,
NONE
);
DO_TEST
(
"net-eth-ifname"
,
NONE
);
DO_TEST
(
"net-eth-names"
,
NONE
);
DO_TEST
(
"net-eth-hostip"
,
NONE
);
DO_TEST
(
"net-client"
,
NONE
);
DO_TEST
(
"net-server"
,
NONE
);
DO_TEST
(
"net-mcast"
,
NONE
);
...
...
tests/qemuxml2xmloutdata/qemuxml2xmlout-net-eth-hostip.xml
0 → 100644
浏览文件 @
0b4645a7
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory
unit=
'KiB'
>
219100
</memory>
<currentMemory
unit=
'KiB'
>
219100
</currentMemory>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/usr/bin/qemu
</emulator>
<disk
type=
'block'
device=
'disk'
>
<driver
name=
'qemu'
type=
'raw'
/>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
bus=
'ide'
/>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'0'
unit=
'0'
/>
</disk>
<controller
type=
'usb'
index=
'0'
>
<address
type=
'pci'
domain=
'0x0000'
bus=
'0x00'
slot=
'0x01'
function=
'0x2'
/>
</controller>
<controller
type=
'ide'
index=
'0'
>
<address
type=
'pci'
domain=
'0x0000'
bus=
'0x00'
slot=
'0x01'
function=
'0x1'
/>
</controller>
<controller
type=
'pci'
index=
'0'
model=
'pci-root'
/>
<interface
type=
'ethernet'
>
<mac
address=
'00:11:22:33:44:55'
/>
<source>
<ip
address=
'192.168.125.1'
family=
'ipv4'
prefix=
'24'
peer=
'192.168.125.2'
/>
<route
family=
'ipv4'
address=
'10.20.0.0'
prefix=
'16'
gateway=
'192.168.125.2'
/>
</source>
<script
path=
'/etc/qemu-ifup'
/>
<model
type=
'rtl8139'
/>
<address
type=
'pci'
domain=
'0x0000'
bus=
'0x00'
slot=
'0x03'
function=
'0x0'
/>
</interface>
<input
type=
'mouse'
bus=
'ps2'
/>
<input
type=
'keyboard'
bus=
'ps2'
/>
<memballoon
model=
'none'
/>
</devices>
</domain>
tests/qemuxml2xmltest.c
浏览文件 @
0b4645a7
...
...
@@ -464,6 +464,7 @@ mymain(void)
DO_TEST
(
"net-virtio-disable-offloads"
);
DO_TEST
(
"net-eth"
);
DO_TEST
(
"net-eth-ifname"
);
DO_TEST
(
"net-eth-hostip"
);
DO_TEST
(
"net-virtio-network-portgroup"
);
DO_TEST
(
"net-hostdev"
);
DO_TEST
(
"net-hostdev-vfio"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录