Bug 656214 - domxml-to-native always set rtl8139 and all zeros mac for networking
Summary: domxml-to-native always set rtl8139 and all zeros mac for networking
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
: 884767 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2010-11-23 09:03 UTC by Mark Wu
Modified: 2018-11-14 16:52 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-01-26 12:04:17 UTC
Target Upstream Version:

Attachments (Terms of Use)

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:

Steps to Reproduce:
#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 -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) {
-            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 -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. ***

Note You need to log in before you can comment on or make changes to this bug.