Bug 524022

Summary: qemu's pci_add monitor command should not exit() if the NIC model is not valid
Product: [Fedora] Fedora Reporter: Vladimir Benes <vbenes>
Component: qemuAssignee: Glauber Costa <gcosta>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: rawhideCC: berrange, crobinso, dwmw2, gcosta, hbrock, itamar, jaswinder, jforbes, markmc, quintela, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-28 12:46:21 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 498969    
Description Flags
virt-manager.log none

Description Vladimir Benes 2009-09-17 12:05:34 EDT
Description of problem:
when I attach network device then detach it and then attach it again virtual guest goes down with this message in /var/log/libvirt/qemu/$guest.log:
char device redirected to /dev/pts/0
qemu: Unsupported NIC model: �c��
qemu: Supported NIC models: 

Version-Release number of selected component (if applicable):



How reproducible:

Steps to Reproduce:
1.install virt guest and delete all NIC devices
2.power on guest
3.attach new NIC (NAT type)
4.detach that NIC again
5.attach that NIC again
Actual results:
guest is stopped with this question:

Are you sure you want to add this device?

This device could not be attached to the running machine. Would you like to make the device available after the next VM shutdown?

Warning: this will overwrite any other changes that require a VM reboot.

Expected results:
guest still running and NIC attached again

Additional info:
Comment 1 Vladimir Benes 2009-09-17 12:07:33 EDT
Created attachment 361520 [details]
Comment 2 Mark McLoughlin 2009-09-17 12:36:27 EDT
This looks like two issues with qemu:

  1) When not passed a model and you do pci_add/pci_del/pci_add with no
     model= parameter, it seems to get the parameters confused

  2) It exits when you pass an invalid model= via pci_add rather than
     just printing an error
Comment 3 Glauber Costa 2009-09-17 16:30:04 EDT
This is a trivial use-after-free bug.

I've just sent a patch upstream
Comment 4 Mark McLoughlin 2009-09-18 08:13:09 EDT
Patch is here:


Still need to fix (2), though
Comment 5 Mark McLoughlin 2009-09-23 07:33:40 EDT
Patch applied in rawhide now, thanks

* Wed Sep 23 2009 Mark McLoughlin <markmc@redhat.com> - 2:0.10.92-5
- Fix issue causing NIC hotplug confusion when no model is specified (#524022)

Leaving it open to fix the other issue
Comment 6 Mark McLoughlin 2009-09-28 12:46:21 EDT
Should be fixed in rawhide now thanks to a cherry-pick from Markus's series here:


* Mon Sep 28 2009 Mark McLoughlin <markmc@redhat.com> - 2:0.11.0-2
- Fix pci hotplug to not exit if supplied an invalid NIC model (#524022)