qemu: preserve netdev MAC address during 'domxml-to-native'
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 <44a07a1c8cc71de0e980dba3aca732b752fa1df5@linux.vnet.ibm.com>
Signed-off-by: Laine Stump <c23361c43fbf79fed83e8b76173707b083d6caf5@laine.org>

agx/libvirt,jardasgit/libvirt,rlaager/libvirt,cbosdo/libvirt,cbosdo/libvirt,eskultety/libvirt,jardasgit/libvirt,elmarco/libvirt,VenkatDatta/libvirt,shugaoye/libvirt,crobinso/libvirt,cbosdo/libvirt,eskultety/libvirt,zippy2/libvirt,VenkatDatta/libvirt,datto/libvirt,shugaoye/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,olafhering/libvirt,shugaoye/libvirt,taget/libvirt,zippy2/libvirt,crobinso/libvirt,jfehlig/libvirt,eskultety/libvirt,taget/libvirt,rlaager/libvirt,agx/libvirt,datto/libvirt,andreabolognani/libvirt,taget/libvirt,crobinso/libvirt,jfehlig/libvirt,elmarco/libvirt,libvirt/libvirt,olafhering/libvirt,nertpinx/libvirt,olafhering/libvirt,rlaager/libvirt,crobinso/libvirt,libvirt/libvirt,eskultety/libvirt,libvirt/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,elmarco/libvirt,nertpinx/libvirt,nertpinx/libvirt,rlaager/libvirt,agx/libvirt,datto/libvirt,jardasgit/libvirt,olafhering/libvirt,VenkatDatta/libvirt,eskultety/libvirt,shugaoye/libvirt,jardasgit/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,taget/libvirt,datto/libvirt,elmarco/libvirt,agx/libvirt,jfehlig/libvirt,andreabolognani/libvirt,cbosdo/libvirt,libvirt/libvirt,jfehlig/libvirt,zippy2/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,zippy2/libvirt,taget/libvirt,agx/libvirt,jardasgit/libvirt,rlaager/libvirt,datto/libvirt,shugaoye/libvirt,fabianfreyer/libvirt,elmarco/libvirt,cbosdo/libvirt,nertpinx/libvirt