]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: preserve netdev MAC address during 'domxml-to-native'
authorBing Bu Cao <mars@linux.vnet.ibm.com>
Wed, 27 Nov 2013 10:52:12 +0000 (18:52 +0800)
committerLaine Stump <laine@laine.org>
Wed, 27 Nov 2013 12:20:18 +0000 (14:20 +0200)
commit8e043864ecd32cd402176308d00ced8e8a15f758
tree713da8e9df28d404c3350184fd58ce5bb7d55e14
parent56022a293ceab65f86fdd91b17a507132afe58c5
qemu: preserve netdev MAC address during 'domxml-to-native'

The virsh command 'domxml-to-native' (virConnectDomainXMLToNative())
converts all network devices to "type='ethernet'" in order to make it
more likely that the generated command could be run directly from a
shell (other libvirt network device types end up referencing file
descriptors for tap devices assumed to have been created by libvirt,
which can't be done in this case).

During this conversion, all of the netdev parameters are cleared out,
then specific items are filled in after changing the type. The MAC
address was not one of these preserved items, and the result was that
mac addresses in the generated commandlines were always
00:00:00:00:00:00.

This patch saves the mac address before the conversion, then
repopulates it afterwards, so the proper mac addresses show up in the
commandline.

Signed-off-by: Bing Bu Cao <mars@linux.vnet.ibm.com>
Signed-off-by: Laine Stump <laine@laine.org>
src/qemu/qemu_driver.c