Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 887886 - Record the default network card model into the domain XML
Summary: Record the default network card model into the domain XML
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
Depends On: 834812
TreeView+ depends on / blocked
Reported: 2012-12-17 14:45 UTC by Dave Allan
Modified: 2016-04-26 13:49 UTC (History)
13 users (show)

Fixed In Version: libvirt-1.0.5-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 834812
Last Closed: 2014-06-13 10:21:07 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Dave Allan 2012-12-17 14:45:32 UTC
+++ This bug was initially created as a clone of Bug #834812 +++

Realtek 8139 is KVM's worst performing emulated NIC, both regarding performance and stability.
rtl8139 bugs are a pain, and we encourage customers to switch to virtio NIC, or E1000, hence it is best to also change the default emulated NIC to E1000.
I believe that in the past E1000 was not bundeled with Win-XP, and it should be verified at the time this bug is fixed.
The issue might be true for virt-manager just the same.

Thanks, Ronen.

--- Additional comment from Eric Blake on 2012-07-11 17:08:10 EDT ---

In qemu/qemu_command.c, I see:

char *
qemuBuildNicDevStr(virDomainNetDefPtr net,
                   int vlan,
                   int bootindex,
                   virBitmapPtr qemuCaps)
    virBuffer buf = VIR_BUFFER_INITIALIZER;
    const char *nic;
    bool usingVirtio = false;

    if (!net->model) {
        nic = "rtl8139";
    } else if (STREQ(net->model, "virtio")) {
        nic = "virtio-net-pci";
        usingVirtio = true;
    } else {
        nic = net->model;

that is, we are hard-coding a default to match what old qemu used to default, if the user didn't specify a model.  It also looks like we are failing to record that we hard-coded the model back into the guest XML.  We may need to clone this to virt-install to ensure that installers never rely on the default, but I'm not sure what we can do from libvirt, short of recording the model that we actually default to, but where we are careful to not cause windows guests to see new hardware.

Comment 1 Peter Krempa 2013-01-29 13:57:01 UTC
As libvirt didn't record the default model into the XML we can't change the default without breaking backward compatibility.

The best thing we are able to do is to record the model used into the XML even in case of the default NIC model.

The default NIC model has to be changed in management apps used on top of libvirt. 

I'm changing the summary to reflect this.

Comment 2 Peter Krempa 2013-04-05 12:51:39 UTC
The default network card model is now recorded in the XML instead of just being silently used.

commit a68d6726679323823ee5be47f0144e9ccffa0757
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Tue Feb 19 17:33:52 2013 +0100

    qemu: Record the default NIC model in the domain XML
    This patch implements the devices post parse callback and uses it to fill
    the default qemu network card model into the XML if none is specified.
    Libvirt assumes that the network card model for qemu is the "rtl8139".
    Record this in the XML using the new callback to avoid user


Comment 3 hongming 2013-05-07 02:33:48 UTC
Verify it as follows. The result is expected. Move its status to VERIFIED.

Add the defaule NIC to guest.
 <interface type='network'>
    <source network='default'/>

# virsh edit rhel7
Domain rhel7 XML configuration edited.

# virsh start rhel7
Domain rhel7 started

# virsh dumpxml rhel7
<domain type='kvm' id='2'>
    <interface type='network'>
      <mac address='52:54:00:b5:0a:7d'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>

# ps -ef|grep qemu
root      2413     1 99 22:22 ?        00:00:21 /usr/libexec/qemu-kvm -name rhel7 -S -machine pc-i440fx-1.4,accel=kvm,usb=off -cpu qemu64,-kvmclock -bios 
,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device

Comment 4 Ludek Smid 2014-06-13 10:21:07 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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