RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 954247 - error/debug messages throw out when start guest with static label + relabel='no' and libvirtd log_level=1
Summary: error/debug messages throw out when start guest with static label + relabel='...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 954248
TreeView+ depends on / blocked
 
Reported: 2013-04-22 04:07 UTC by yanbing du
Modified: 2014-06-18 00:48 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.0.5-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 954248 (view as bug list)
Environment:
Last Closed: 2014-06-13 12:22:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yanbing du 2013-04-22 04:07:03 UTC
Description of problem:
Config libvirtd log_level=1, and set lable for a guest with static type 
<seclabel>, and relabel='no', when start the guest, error/debug messages 
throw out.
If set log_level=3, then this bug gone.


Version-Release number of selected component (if applicable):
libvirt-1.0.4-1.el7.x86_64
libvirt-0.10.2-18.el6_4.4.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Config libvirtd log level:

log_level = 1
log_outputs="1:file:/var/log/libvirt/libvirtd.log"

2. Make sure selinux is enforcing.
3. Config the <seclabel> element, and start it.
......
   <seclabel type='static' model='selinux' relabel='ynoes'>
     <label>system_u:system_r:svirt_t:s0:c392,c662</label>
   </seclabel>
......
On rhel7 host:
# virsh start kvm-rhel6.4-x86_64-qcow2-virtio
error: Failed to start domain kvm-rhel6.4-x86_64-qcow2-virtio
error: internal error process exited while connecting to monitor: 2013-04-19 10:36:20.886+0000: 3635: debug : virFileClose:72 : Closed fd 23
2013-04-19 10:36:20.886+0000: 3635: debug : virFileClose:72 : Closed fd 30
2013-04-19 10:36:20.888+0000: 3635: debug : virFileClose:72 : Closed fd 3
2013-04-19 10:36:20.888+0000: 3636: debug : virExec:602 : Run hook 0x7fca68d9b630 0x7fca6e0953a0
2013-04-19 10:36:20.888+0000: 3636: debug : qemuProcessHook:2505 : Obtaining domain lock
2013-04-19 10:36:20.888+0000: 3636: debug : virSecuritySELinuxSetSecuritySocketLabel:2016 : Setting VM kvm-rhel6.4-x86_64-qcow2-virtio socket context system_u:system_r:svirt_t:s0:c392,c662
2013-04-19 10:36:20.888+0000: 3636: debug : virDomainLockProcessStart:170 : plugin=0x7fca6001e0d0 dom=0x7fca602df720 paused=1 fd=0x7fca6e094f4c
2013-04-19 10:36:20.888+0000: 3636: debug : virDomainLockManagerNew:128 : plugin=0x7fca6001e0d0 dom=0x7fca602df720 withResources=1
2013-04-19 10:36:20.888+0000: 3636: debug : virLockManagerPluginGetDriver:297 : plugin=0x7fca6001e0d0
20


On rhel6 host:
# virsh start kvm-rhel6.4-x86_64-qcow2-virtio
error: Failed to start domain kvm-rhel6.4-x86_64-qcow2-virtio
error: internal error process exited while connecting to monitor: 2013-04-19 10:42:30.147+0000: 19121: debug : virFileClose:72 : Closed fd 21
2013-04-19 10:42:30.147+0000: 19121: debug : virFileClose:72 : Closed fd 28
2013-04-19 10:42:30.147+0000: 19121: debug : virFileClose:72 : Closed fd 3
char device redirected to /dev/pts/1
qemu-kvm: -drive file=/var/lib/libvirt/images/kvm-rhel6.4-x86_64-qcow2.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none: could not open disk image /var/lib/libvirt/images/kvm-rhel6.4-x86_64-qcow2.img: Permission denied

4. If set log_level = 3, and restart libvirtd:
On rhel7 host:
# virsh start kvm-rhel6.4-x86_64-qcow2-virtio
error: Failed to start domain kvm-rhel6.4-x86_64-qcow2-virtio
error: internal error process exited while connecting to monitor: char device redirected to /dev/pts/3 (label charserial0)
qemu-kvm: -drive file=/var/lib/libvirt/images/kvm-rhel6.4-x86_64-qcow2.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none: could not open disk image /var/lib/libvirt/images/kvm-rhel6.4-x86_64-qcow2.img: Permission denied

On rhel6 host:
# virsh start kvm-rhel6.4-x86_64-qcow2-virtio
error: Failed to start domain kvm-rhel6.4-x86_64-qcow2-virtio
error: internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
qemu-kvm: -drive file=/var/lib/libvirt/images/kvm-rhel6.4-x86_64-qcow2.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none: could not open disk image /var/lib/libvirt/images/kvm-rhel6.4-x86_64-qcow2.img: Permission denied

  
Actual results:
Step4 outputs are expected results, but step3 need fix

Expected results:
Step3 output should like steps4's

Additional info:

Comment 2 Jiri Denemark 2013-04-22 18:31:01 UTC
Fixed upstream by v1.0.4-232-ge4bdba8 and v1.0.4-233-g6d1b3ed:

commit 6d1b3edc6e3e86567bd88b3e5157a88e49f1b118
Author: Jiri Denemark <jdenemar>
Date:   Mon Apr 22 18:20:21 2013 +0200

    qemu: Ignore libvirt logs when reading QEMU error output
    
    When QEMU fails to start, libvirt read its error output and reports it
    back in an error message. However, when libvirtd is configured to log
    debug messages, one would get the following unhelpful garbage:
    
        virsh # start cd
        error: Failed to start domain cd
        error: internal error process exited while connecting to monitor: \
          2013-04-22 14:24:54.214+0000: 2194219: debug : virFileClose:72 : \
          Closed fd 21
        2013-04-22 14:24:54.214+0000: 2194219: debug : virFileClose:72 : \
          Closed fd 27
        2013-04-22 14:24:54.215+0000: 2194219: debug : virFileClose:72 : \
          Closed fd 3
        2013-04-22 14:24:54.215+0000: 2194220: debug : virExec:602 : Run \
          hook 0x7feb8f600bf0 0x7feb86ef9300
        2013-04-22 14:24:54.215+0000: 2194220: debug : qemuProcessHook:2507 \
          : Obtaining domain lock
        2013-04-22 14:24:54.216+0000: 2194220: debug : \
          virDomainLockProcessStart:170 : plugin=0x7feb780261f0 \
          dom=0x7feb7802a360 paused=1 fd=0x7feb86ef8ec4
        2013-04-22 14:24:54.216+0000: 2194220: debug : \
          virDomainLockManagerNew:128 : plugin=0x7feb780261f0 \
          dom=0x7feb7802a360 withResources=1
        2013-04-22 14:24:54.216+0000: 2194220: debug : \
          virLockManagerPluginGetDriver:297 : plugin=0x7feb780261f0
        2013-04-22 14:24:54.216+0000: 2194220: debug : \
          virLockManagerNew:321 : driver=0x7feb8ef08640 type=0 nparams=5 \
          params=0x7feb86ef8d60 flags=0
        2013-04-22 14:24:54.216+000
    
    instead of (the output with this patch applied):
    
        virsh # start cd
        error: Reconnected to the hypervisor
        error: Failed to start domain cd
        error: internal error process exited while connecting to monitor: \
          char device redirected to /dev/pts/33 (label charserial0)
        qemu-system-x86_64: -drive file=/home/vm/systemrescuecd-x86-1.2.0.\
          iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw,cache=none: \
          could not open disk image /home/vm/systemrescuecd-x86-1.2.0.iso: \
          Permission denied

commit e4bdba8d7f86d2b0ea224b64e336b36ef52f6276
Author: Jiri Denemark <jdenemar>
Date:   Mon Apr 22 18:16:57 2013 +0200

    qemu: Move QEMU log reading into a separate function

Comment 3 zhenfeng wang 2013-05-07 09:04:44 UTC
Verify this bug with :
libvirt-1.0.5-1.el7.x86_64
1. Config libvirtd log level:

log_level = 1
log_outputs="1:file:/var/log/libvirt/libvirtd.log"

2. Make sure selinux is enforcing.
3. Config the <seclabel> element, and start it.
......
   <seclabel type='static' model='selinux' relabel='no'>
     <label>system_u:system_r:svirt_t:s0:c392,c662</label>
   </seclabel>
......
4. start the guest on rhel7 host,got the expect error as comment 2
# virsh start rhelguest1
error: Failed to start domain rhelguest1
error: internal error process exited while connecting to monitor: char device redirected to /dev/pts/1 (label charserial0)
qemu-kvm: -drive file=/var/lib/libvirt/images/kvm-rhel6.4.z-x86_64-qcow2.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none: could not open disk image /var/lib/libvirt/images/kvm-rhel6.4.z-x86_64-qcow2.img: Permission denied

since we got the expect error which is the same with comment 2 ,so mark this bug verified

Comment 4 Ludek Smid 2014-06-13 12:22:51 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.