diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index b48ae50464..e637d21fb7 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -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: diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args new file mode 100644 index 0000000000..b96c933ff1 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args @@ -0,0 +1,23 @@ +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 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.xml new file mode 100644 index 0000000000..6d08e82fb1 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.xml @@ -0,0 +1,39 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + +
+ + + + + + + + + + +