Bug 1311035 - New qemu log is not writen into log file after restarting virtlogd when guest is running
New qemu log is not writen into log file after restarting virtlogd when guest...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-23 03:39 EST by Fangge Jin
Modified: 2016-06-03 07:56 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-03 07:56:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Fangge Jin 2016-02-23 03:39:39 EST
Description of problem:
When guest is running, restart virtlogd, then make qemu process produce new log data, it's not writen into $guest.log file.

Version-Release number of selected component (if applicable):
# git describe
v1.3.1-347-gfb2bd20

How reproducible:
100%

Steps to Reproduce:
0. Use logd to handle qemu stdout/stderr

1. Prepare a guest with spice graphic and start it
 # virsh dumpxml $guest
...
    <graphics type='spice' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
...

2. Open/close spice graphic, check $guest.log:
# tailf /var/log/libvirt/qemu/rhel7.2.log
main_channel_link: add main channel client
main_channel_handle_parsed: net test: latency 48.529000 ms, bitrate 2031746031 bps (1937.624007 Mbps)
inputs_connect: inputs channel client create
red_dispatcher_set_cursor_peer:
...

3. Check opened FDs
# lsof |grep pipe|grep virtlogd
virtlogd  28591          root   12r     FIFO                0,8         0t0    2205627 pipe
virtlogd  28591 28592    root   12r     FIFO                0,8         0t0    2205627 pipe

# lsof |grep pipe|grep qemu
qemu-kvm  28678          qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678          qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28696    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28696    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28709    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28709    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28710    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28710    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28711    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28711    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28712    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28712    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28714    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28714    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28715    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28715    qemu    2w     FIFO                0,8         0t0    2205627 pipe

# lsof /var/log/libvirt/qemu/rhel7.2.log
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
virtlogd 28591 root   14w   REG  253,0     7168 1345121 /var/log/libvirt/qemu/rhel7.2.log

4.Restart virtlogd
# systemctl restart virtlogd

5.Open/close spice graphic again, check $guest.log:
# tailf /var/log/libvirt/qemu/rhel7.2.log
(no new log data)

6.Check opened FDs again:
# lsof /var/log/libvirt/qemu/rhel7.2.log
(no output)


# lsof |grep pipe|grep qemu
qemu-kvm  28678          qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678          qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28696    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28696    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28709    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28709    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28710    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28710    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28711    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28711    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28712    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28712    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28714    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28714    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28715    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28715    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28778    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28778    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28781    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28781    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28782    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28782    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28783    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28783    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28784    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28784    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28785    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28785    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28786    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28786    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28787    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28787    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28788    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28788    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28789    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28789    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28790    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28790    qemu    2w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28791    qemu    1w     FIFO                0,8         0t0    2205627 pipe
qemu-kvm  28678 28791    qemu    2w     FIFO                0,8         0t0    2205627 pipe


# lsof |grep pipe|grep virtlogd
virtlogd  28798          root    7r     FIFO                0,8         0t0    2210039 pipe
virtlogd  28798          root    8w     FIFO                0,8         0t0    2210039 pipe
virtlogd  28798          root    9r     FIFO                0,8         0t0    2210040 pipe
virtlogd  28798          root   10w     FIFO                0,8         0t0    2210040 pipe
virtlogd  28798 28799    root    7r     FIFO                0,8         0t0    2210039 pipe
virtlogd  28798 28799    root    8w     FIFO                0,8         0t0    2210039 pipe
virtlogd  28798 28799    root    9r     FIFO                0,8         0t0    2210040 pipe
virtlogd  28798 28799    root   10w     FIFO                0,8         0t0    2210040 pipe


As we can see, no new pipes are created between virtlogd and qemu process.


Actual results:
New qemu log is not writen into log file after restarting virtlogd when guest is running

Expected results:
New pipes are created and new qemu log can be writen into log file after restarting virtlogd when guest is running


Additional info:
Comment 1 Cole Robinson 2016-04-13 10:21:06 EDT
Moving to RHEL7, this may be something we want to fix before 7.3. Not sure if it's 'just a bug' or more work than that
Comment 2 Daniel Berrange 2016-04-13 10:23:20 EDT
This is really not a bug - you should *not* restart virtlogd while guests are running. It is explicitly designed to be able to re-exec itself to allow for live upgrades while it is running, so there should be no reason to restart it fully while guests are running.

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