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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index f8bd91c01a..6c526da268 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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);
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-eth-hostip.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-eth-hostip.xml
new file mode 100644
index 0000000000..856b35bd48
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-eth-hostip.xml
@@ -0,0 +1,44 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 2056c03840..af697095bd 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -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");