Bug 626277

Summary: qemu-dm defunct when vif model misspelled
Product: Red Hat Enterprise Linux 5 Reporter: Lei Wang <leiwang>
Component: xenAssignee: Michal Novotny <minovotn>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.6CC: areis, minovotn, mrezanin, mshao, xen-maint, yuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: xen-3.0.3-119.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 22:23:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 514500    
Attachments:
Description Flags
Full xend.log
none
xm dmesg info in the host
none
Check for emulated NIC model
none
Check for emulated NIC model v2 none

Description Lei Wang 2010-08-23 03:18:39 UTC
Description of problem:
Create a HVM guest with vif model=rtl8130 which is misspelled in vif specification, xm create command does not return any error, but in virt-viewer could see error message "TCP/IP error:VNC connection to hypervisor host got refused or disconnected!" and when execute "ps aux |grep qemu-dm" could notice "[qemu-dm] <defunct>".

Version-Release number of selected component (if applicable):
xen-3.0.3-115.el5
kernel-xen-2.6.18-212.el5
host:rhel5.5 x86_64
guest:rhel5.5 i386

How reproducible:
Always

Steps to Reproduce:
1.Create a HVM guest with vif model misspelled.
2.virt-viewer
3.#ps aux |grep qemu-dm
4.#xm list
5.#cat /var/log/xen/qemu-dem.4592.log
6.#tail /var/log/xen/xend.log

Actual results:
At step1:
xm create command executed successfully without error.

At step3:
root      4592  0.0  0.0      0     0 ?        Z    11:00   0:00 [qemu-dm] <defunct>
root      4832  0.0  0.0  61196   748 pts/1    S+   11:01   0:00 grep qemu

At step4:
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0     3296     2 r-----     34.5
rhel-5.5-32                                1      511     1 ------      0.0

At step5:
domid: 1
qemu: the number of cpus is 1
Watching /local/domain/1/logdirty/next-active
Watching /local/domain/0/device-model/1/command
xs_read(): vncpasswd get error. /vm/11bf03f8-1cbf-1d39-131c-970e25881cb7/vncpasswd.
qemu_map_cache_init nr_buckets = 10000
shared page at pfn 1ffff
buffered io page at pfn 1fffd
xs_read(/vm/11bf03f8-1cbf-1d39-131c-970e25881cb7/rtc/timeoffset): read error
qemu: Unsupported NIC: rtl8130

At step6: (xend hangs here)
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:538) hotplugStatusCallback /local/domain/0/backend/vbd/1/768/hotplug-status.
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:552) hotplugStatusCallback 1.
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:160) Waiting for devices irq.
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:160) Waiting for devices vkbd.
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:160) Waiting for devices vfb.
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:160) Waiting for devices pci.
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:160) Waiting for devices ioports.
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:160) Waiting for devices tap.
[2010-08-23 11:00:23 xend 3541] DEBUG (DevController:160) Waiting for devices vtpm.
[2010-08-23 11:00:23 xend 3541] INFO (XendDomain:386) Domain rhel-5.5-32 (1) unpaused.

Expected results:
Xend should check the vif model available or not before really create the HVM guest, if not available report an detailed error message to user or use the default model rtl8139 as a replacement, just like it change xvda to hda when the first disk specified with blktap driver which is actually not supported.

Comment 1 Lei Wang 2010-08-23 04:34:44 UTC
Created attachment 440285 [details]
Full xend.log

Please neglect the output at step 6, reattach the full xend.log.

Comment 2 Lei Wang 2010-08-23 04:36:30 UTC
Created attachment 440286 [details]
xm dmesg info in the host

Comment 3 Michal Novotny 2010-09-17 14:58:48 UTC
Well, unfortunately there's failure with error "Unsupported NIC" error in the code. We could either fallback to the some other default NIC (maybe hypervisor default which is rtl8139 for case Xen) or we could disable the network device entirely. Falling back to netfront is also the option but I don't know what's the best idea to solve this one.

Michal

Comment 4 Michal Novotny 2010-09-21 11:08:37 UTC
Created attachment 448672 [details]
Check for emulated NIC model

Hi,
this is the patch to whitelist supported NIC models. This patch is checking the NIC model for ioemu (emulated) NIC devices only since according to my testing devices defined as netfront (PV drivers) are fine to be run with invalid model since this variable is not being used there. Prior to my patch the qemu-dm died saying that the NIC model is not supported into the qemu-dm log file and now it's failing with the error message that the NIC model is not supported.

The patch has been tested on x86_64 RHEL-5 dom0 and it was working fine not to create the guest with invalid (unsupported) model of NIC device, i.e. not letting qemu-dm die immediately.

Michal

Comment 5 Michal Novotny 2010-09-21 13:03:50 UTC
Created attachment 448687 [details]
Check for emulated NIC model v2

Differences between v1 and v2:
 - Check for 'ioemu' type (or None value for type) has been implement instead
   of checking against 'netfront' since only devices with type == 'ioemu' or
   None device should be treated like emulated devices (other values defines
   that the PV drivers are being used)
 - Check only HVM guest vif devices since for PV guests it doesn't fail
   according to my testing
 - Implement handling of None values for model and type
   - Allow None value of model, default 'rtl8139' will be used instead
   - Treat None value for type as type='ioemu', i.e. check model if type is None
 - Tested with model unspecified (None), unsupported model specified, supported
   model specified and also PV guests and everything was working fine

Michal

Comment 10 Lei Wang 2010-11-24 06:15:15 UTC
Could reproduce the issue with:
xen-3.0.3-115.el5
host:rhel5.5 x86_64
guest:rhel5.5 i386

With xen-3.0.3-119, 
when create hvm guest with type=ioemu or None and vif model misspelled,
there report error message immediately, no qemu-dm process left:

# xm cr rhel-5.5-32-hvm.conf
Using config file "./rhel-5.5-32-hvm.conf".
Error: NIC model rtl8130 is not supported

According to the test result above, move to VERIFIED.

Comment 12 errata-xmlrpc 2011-01-13 22:23:49 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0031.html