Bug 499844

Summary: Tries to set file context on read-only device even when none connected
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: rawhideCC: berrange, clalance, crobinso, itamar, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-09 18:22:26 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Tim Waugh 2009-05-08 10:40:24 EDT
Description of problem:
I am finding that a kvm instance I have installed cannot be started after initial installation until an ISO image is connected as hdc again.  It seems to be trying to set the SELinux file context on NULL when there is no file image for hdc, and fails altogether as a result.

Version-Release number of selected component (if applicable):
libvirt-0.6.2-7.fc11.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Install OS from local ISO image. Shut off domain.
2.hdc now shows:

Source type: block
Source path: -  [Connect]
Target type: cdrom
Target device: hdc
Target bus: ide
Permissions: Readonly

3.Attempt to start domain by clicking 'Run'.
  
Actual results:
Dialog appears:

==>
Error starting domain: internal error
Domain mydomain didn't show up

v Details
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 493, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 573, in startup
    self.vm.create()
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 287, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error Domain mydomain didn't show up
<==

/var/log/messages has:
May  8 15:37:48 worm libvirtd: 15:37:48.527: warning : Sound cards for VMs are disabled while SELinux security model is active
May  8 15:37:48 worm kernel: device vnet0 entered promiscuous mode
May  8 15:37:48 worm kernel: virbr0: topology change detected, propagating
May  8 15:37:48 worm kernel: virbr0: port 1(vnet0) entering forwarding state
May  8 15:37:48 worm libvirtd: 15:37:48.532: error : SELinuxSetFilecon: unable to set security context 'system_u:object_r:virt_content_t:s0' on (null): Bad address.
May  8 15:37:48 worm libvirtd: 15:37:48.532: error : internal error Failed to set security label
May  8 15:37:48 worm NetworkManager: nm_device_ethernet_new: assertion `driver != NULL' failed
May  8 15:37:49 worm avahi-daemon[1631]: Registering new address record for fe80::a470:c8ff:feb4:aee on vnet0.*.
May  8 15:37:51 worm ntpd[1917]: Listening on interface #22 vnet0, fe80::a470:c8ff:feb4:aee#123 Enabled
May  8 15:37:53 worm nm-system-settings: Added default wired connection 'Auto vnet0' for /org/freedesktop/Hal/devices/net_a6_70_c8_b4_0a_ee
May  8 15:37:58 worm libvirtd: 15:37:58.544: error : internal error Domain mydomain didn't show up#012
May  8 15:37:58 worm avahi-daemon[1631]: Withdrawing address record for fe80::a470:c8ff:feb4:aee on vnet0.
May  8 15:37:58 worm kernel: virbr0: port 1(vnet0) entering disabled state
May  8 15:37:58 worm kernel: device vnet0 left promiscuous mode
May  8 15:37:58 worm kernel: virbr0: port 1(vnet0) entering disabled state

Expected results:
Domain starts correctly.

Additional info:
Attaching an ISO image for hdc works around the problem and the domain starts normally.
Comment 1 Cole Robinson 2009-05-09 18:22:26 EDT

*** This bug has been marked as a duplicate of bug 499569 ***