Bug 596610 - "Guest moved used index from 0 to 61440" if remove virtio serial device before virtserialport
"Guest moved used index from 0 to 61440" if remove virtio serial device befor...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Amit Shah
Virtualization Bugs
:
Depends On:
Blocks: 580953
  Show dependency treegraph
 
Reported: 2010-05-27 02:39 EDT by lihuang
Modified: 2013-01-09 17:38 EST (History)
8 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.114.el6
Doc Type: Bug Fix
Doc Text:
Removing a virtio-serial port or device before a guest has booted and initialised the device would cause QEMU to exit with an error message. This happened due to the exit routines which were called when a port gets unplugged tried to free any unused data the guest may have sent. However, since the guest had not initalised the virtio device, the virtio layer exited with an assert indicating the guest and host virtio state are not in sync. The fix is to not check for any unused data on the host if the guest side virtio state is not yet initialised.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 07:28:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 07:20:36 EDT

  None (edit)
Description lihuang 2010-05-27 02:39:04 EDT
Description of problem:


Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.52.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. start guest with:
-device virtio-serial-pci,id=virtio-serial0,vectors=4,bus=pci.0,addr=0x4 \
-device virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0,id=channel0 \
-chardev socket,path=/tmp/channel0,server,nowait,id=channel0

2. in qemu monitor 
(qemu) device_del virtio-serial0

3.
  
Actual results:
Guest moved used index from 0 to 61440

Expected results:
handle the abnormal request

Additional info:
remove devices in correct order work fine.
(qemu) device_del channel0
(qemu) device_del virtio-serial0
Comment 1 Amit Shah 2010-06-08 02:23:32 EDT
I can't reproduce this; though I see that this really can happen.

Can you tell me exactly when you see this:
1) Does this happen if you start the guest and immediately remove the port, even before the guest has had a chance to boot up?

2) Does this happen after you do some activity on the virtio ports or does that not matter?

3) You are using rhel6 host as well as guest, right?
Comment 2 Amit Shah 2010-07-01 04:54:55 EDT
I just saw the exactly opposite behaviour:

Unplugging the *port* before unplugging the device gives me the 'Guest moved used index from 0 to 61440' message.
Comment 3 Amit Shah 2010-07-01 05:36:23 EDT
Patch submitted upstream:

http://news.gmane.org/find-root.php?message_id=%3c1c5b20f693ebc3882d01d8f2f9e807878251cd42.1277976486.git.amit.shah%40redhat.com%3e

This crash happens only if the virtserialport is removed before the guest boots and initialises the virtqueue structures.
Comment 9 Golita Yue 2011-01-19 04:53:31 EST
Reproduced in qemu-img-0.12.1.2-2.90.el6.x86_64 with #Description steps

Verified in qemu-img-0.12.1.2-2.120.el6.x86_64

The guest running normally after hot-unplug virtio-serial device directly.
Comment 11 Miya Chen 2011-03-08 22:17:56 EST
move to verified based on comment#9.
Comment 12 Amit Shah 2011-05-04 06:52:44 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Removing a virtio-serial port or device before a guest has booted and initialised the device would cause QEMU to exit with an error message.  This happened due to the exit routines which were called when a port gets unplugged tried to free any unused data the guest may have sent.  However, since the guest had not initalised the virtio device, the virtio layer exited with an assert indicating the guest and host virtio state are not in sync.  The fix is to not check for any unused data on the host if the guest side virtio state is not yet initialised.
Comment 13 errata-xmlrpc 2011-05-19 07:28:19 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html
Comment 14 errata-xmlrpc 2011-05-19 08:45:27 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html

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