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 1459945 - migration fails with hungup serial console reader on -M pc-i440fx-rhel7.0.0 and pc-i440fx-rhel7.1.0
Summary: migration fails with hungup serial console reader on -M pc-i440fx-rhel7.0.0 a...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: jingzhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-08 16:03 UTC by Paolo Bonzini
Modified: 2018-04-11 00:25 UTC (History)
19 users (show)

Fixed In Version: qemu-kvm-rhev-2.10.0-18.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1452067
Environment:
Last Closed: 2018-04-11 00:23:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:1104 0 None None None 2018-04-11 00:25:33 UTC

Description Paolo Bonzini 2017-06-08 16:03:06 UTC
See also qemu-kvm bug 1452067.

1) start /usr/libexec/qemu-kvm -drive if=none,id=hd,file=$HOME/f25-64.qcow2 -device virtio-blk,drive=hd -m 256 --enable-kvm -serial pty -monitor stdio -M pc-i440fx-rhel7.0.0

2) start cat for pty opened by first QEMU instance, e.g. "cat /dev/pts/5" if it prints
     char device redirected to /dev/pts/5 (label serial0)

3) start /usr/libexec/qemu-kvm -drive if=none,id=hd,file=$HOME/f25-64.qcow2 -device virtio-blk,drive=hd -m 256 --enable-kvm -serial pty -monitor stdio -M pc-i440fx-rhel7.0.0 -incoming tcp:localhost:12345

4) start cat for pty opened by second QEMU instance

6) type "yes > /dev/ttyS0", endless stream of "y" comes out of cat instance #1

7) type ^Z to stop cat instance #1

8) start migration:
      migrate_set_speed 1G
      migrate tcp:localhost:12345

Expected results:
 endless stream of "y" should come out of cat instance #2

Actual results:
 qemu-system-x86_64: inconsistent state in serial device (tsr not empty, tsr_retry=0
 qemu-system-x86_64: Failed to load serial:state
 qemu-system-x86_64: error while loading state for instance 0x1 of device 'serial'
 qemu-system-x86_64: load of migration failed: Operation not permitted


Originally introduced by:

    commit 17f9a1880e63e32d9fff0cf821ba70ceed861da2
    Author: Dr. David Alan Gilbert <dgilbert>
    Date:   Wed Jun 24 13:39:56 2015 +0200

    Serial: Migration compatibility pre 2.2/7.2
    
    Message-id: <1435153196-26350-3-git-send-email-dgilbert>
    Patchwork-id: 66380
    O-Subject: [RHEL-7.2 qemu-kvm-rhev PATCH v3 2/2] Serial: Migration compatibility pre 2.2/7.2
    Bugzilla: 1215087
    RH-Acked-by: Juan Quintela <quintela>
    RH-Acked-by: Laszlo Ersek <lersek>
    RH-Acked-by: Michael S. Tsirkin <mst>
    RH-Acked-by: Paolo Bonzini <pbonzini>
    
    From: "Dr. David Alan Gilbert" <dgilbert>
    
    Disable subsections added in qemu 2.3
    
    Newer qemu fixed migration corner cases for serial by adding subsections,
    however if these are generated it will break backwards migration.
    Disabling these subsections on older machine types should leave it no
    worse than existing qemu, from which we're not aware of having any reports
    of problems, and still allow these improvements on new machine types.
    Even when a user isn't actively using a serial port a guest will
    probably initialise it and may send stuff (e.g. a copy of the console 
    messages or the login: prompt).
    
    Signed-off-by: Dr. David Alan Gilbert <dgilbert>
    Signed-off-by: Miroslav Rezanina <mrezanin>

The commit message mentions that "a guest will probably initialise it and may send stuff", but a disconnected console eats data immediately.  Only a hungup reader can cause data to accumulate in the serial port's FIFO.

Comment 4 Miroslav Rezanina 2018-01-23 12:58:51 UTC
Fix included in qemu-kvm-rhev-2.10.0-18.el7

Comment 6 huiqingding 2018-01-29 10:14:26 UTC
Reproduce this bug using the following version:
qemu-kvm-rhev-2.10.0-17.el7.x86_64
kernel-3.10.0-838.el7.x86_64

1. Boot a rhel7.5 guest with "-machine pc-i440fx-rhel7.0.0":
/usr/libexec/qemu-kvm \
    -name 'avocado-vt-vm1'  \
    -sandbox off  \
    -machine pc-i440fx-rhel7.0.0  \
    -nodefaults  \
    -vga std  \
    -device virtio-serial-pci,id=virtio_serial_pci0,bus=pci.0,addr=03 \
    -device nec-usb-xhci,id=usb1,bus=pci.0 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=05 \
    -drive id=drive_image1,if=none,snapshot=off,format=qcow2,snapshot=off,file=/mnt/rhel7.5.qcow2 \
    -device scsi-hd,id=image1,drive=drive_image1,bus=virtio_scsi_pci0.0 \
    -device virtio-net-pci,mac=9a:7b:7c:7d:7e:90,id=id9HRc5V,vectors=4,netdev=idjlQN53,bus=pci.0,addr=10 \
    -netdev tap,id=idjlQN53,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown \
    -m 4G  \
    -smp 4  \
    -name debug-threads=on \
    -serial pty \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -device usb-kbd,bus=usb1.0,port=2 \
    -device usb-mouse,bus=usb1.0,port=3 \
    -vnc :1 \
    -rtc base=localtime,clock=vm,driftfix=slew  \
    -boot order=cdn,once=c,menu=on,strict=off \
    -monitor stdio \
    -enable-kvm
2. boot the guest with "-incoming tcp:0:5800"
 
3 on src host,start cat for pty opened by src host QEMU instance:
# cat /dev/pts/2

4. on dst host, start cat for pty opened by dst host QEMU instance:
# cat /dev/pts/4

5. inside guest, type "yes > /dev/ttyS0",endless stream of "y" comes out of cat instance on src host
# cat /dev/pts/2
y
y
y
y
....
6. type ^Z to stop cat instance #1

7. on src host, do migration
(qemu) migrate -d tcp:0:5800

after step7, migration is failed, the destination qemu-kvm quits with error:
(qemu) qemu-kvm: inconsistent state in serial device (tsr not empty, tsr_retry=0
qemu-kvm: Failed to load serial:state
qemu-kvm: error while loading state for instance 0x0 of device 'serial'
qemu-kvm: load of migration failed: Operation not permitted

Comment 7 huiqingding 2018-01-29 10:27:23 UTC
Verify this bug using version:
qemu-kvm-rhev-2.10.0-17.el7.x86_64
kernel-3.10.0-838.el7.x86_64

Test "-machine pc-i440fx-rhel7.0.0" and "-machine pc-i440fx-rhel7.1.0". The steps are same as comment #6.

After step7, migration can be finished normally and endless stream of "y" comes out of cat instance on dst host
# cat /dev/pts/2
y
y
y
y
....

Comment 8 huiqingding 2018-01-29 10:27:57 UTC
Based on comment #7, set this bug to be verified.

Comment 11 errata-xmlrpc 2018-04-11 00:23:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:1104


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