Bug 656214

Summary: domxml-to-native always set rtl8139 and all zeros mac for networking
Product: Red Hat Enterprise Linux 6 Reporter: Mark Wu <dwu>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: ccui, dallan, dyuan, eblake, jyang, lveyde, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-26 12:04:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mark Wu 2010-11-23 09:03:51 UTC
Description of problem:
domxml-to-native always use the model rtl8139 and zeroed mac address for networking in the exported qemu command line. I think network model and mac address should be exported the same as the configuration of original virtual machine.

Version-Release number of selected component (if applicable):
Related Package Version: libvirt-0.8.1-27.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
#virsh domxml-to-native qemu-argv /etc/libvirt/qemu/guest.xml 
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/libexec/qemu-kvm -S -M rhel6.0.0 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name adasd -uuid 0b346301-de68-06a0-eb54-b2317d61f7df -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/adasd.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -no-reboot -boot n -drive file=/var/lock/subsys/hh,if=none,id=drive-ide0-0-0,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=00:00:00:00:00:00 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc 127.0.0.1:0 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 

  
Actual results:


Expected results:


Additional info:
1. This issue was also reported in BZ636832
2. The mac address and network model can be exported with the following patch on fedora14:
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 25695df..0b21d49 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6855,7 +6855,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
         if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
             VIR_FREE(net->data.network.name);
 
-            memset(net, 0, sizeof *net);
+     //     memset(net, 0, sizeof *net);
 
             net->type = VIR_DOMAIN_NET_TYPE_ETHERNET;
             net->data.ethernet.dev = NULL;


LC_ALL=C PATH=/usr/lib64/ccache:/sbin:/bin:/usr/sbin:/usr/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/bin/qemu-kvm -S -M fedora-13 -cpu core2duo,+x2apic -enable-kvm -m 512 -smp 2,sockets=2,cores=1,threads=1 -name rhel-5.2 -uuid 66ae1400-1bb9-7759-fe77-f350eaf777a0 -nodefconfig -nodefaults -chardev socket,id=monitor,path=/usr/local/var/lib/libvirt/qemu/rhel-5.2.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot c -device lsi,id=scsi0,bus=pci.0,addr=0x6 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/var/lib/libvirt/images/rhel-5.2.img,if=none,id=drive-scsi0-0-0,boot=on,format=raw -device scsi-disk,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0 -device e1000,vlan=0,id=net0,mac=52:54:00:06:ec:67,bus=pci.0,addr=0x4 -net tap,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc 127.0.0.1:0 -k en-us -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x5 -device virtio-balloon-pci,id=balloon0

Comment 1 Osier Yang 2011-01-26 12:04:17 UTC
It is by design, libvirt creates TAP/macvtap devices to setup network interface of type direct/bridge/network for a domain, but for "domxml-to-native", we are just responsible to exporting the qemu args, and converting those configs into generic 'ethernet' config and assume the user has suitable 'ifup-qemu' scripts, otherwise, it definitely fails if trying to start the guest with the qemu args got from "domxml-to-native", as qemu won't setup the tap/mactap device for you.

Thus, close it as not a bug.

Comment 2 Jiri Denemark 2012-12-13 13:15:10 UTC
*** Bug 884767 has been marked as a duplicate of this bug. ***