This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 822068 - libvirtd will crash when hotplug attah-disk to guest
libvirtd will crash when hotplug attah-disk to guest
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
x86_64 Linux
high Severity high
: rc
: 6.4
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-16 05:02 EDT by Huang Wenlong
Modified: 2013-10-20 17:45 EDT (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:13:10 EST
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)
libvirtd crash log (4.36 MB, text/plain)
2012-05-16 05:04 EDT, Huang Wenlong
no flags Details
gdb backtrace (9.04 KB, text/plain)
2012-05-21 01:10 EDT, Huang Wenlong
no flags Details

  None (edit)
Description Huang Wenlong 2012-05-16 05:02:09 EDT
Description of problem:
libvirtd will crash when attah-disk to guest

Version-Release number of selected component (if applicable):
libvirt-0.9.11.3-1.el7.x86_64
qemu-kvm-1.0-17.1.el7.x86_64

How reproducible:
90%

Steps to Reproduce:
1. virsh attach-disk copy /dev/sda1 vda
error: Failed to attach disk
error: End of file while reading data: Input/output error

[root@intel-q9400-4-7 tmp]# virsh list
error: Failed to reconnect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': 
Connection refused


Actual results:
attach disk will crash libvirtd

Expected results:
attach disk successfully  and libvirtd is alive

Additional info:
I will attach libvirtd debug log when it crash
Comment 1 Huang Wenlong 2012-05-16 05:04:15 EDT
Created attachment 584905 [details]
libvirtd crash log
Comment 2 Peter Krempa 2012-05-18 08:36:25 EDT
Hi Huang,
could you please provide a full backtrace of the crashed daemon? I'm not able to reproduce this.

Peter
Comment 3 Huang Wenlong 2012-05-21 01:10:57 EDT
Created attachment 585716 [details]
gdb backtrace

Hi,Peter

I attached the gdb all backtrace ,thanks .


Wenlong
Comment 6 Peter Krempa 2012-06-14 07:52:43 EDT
Fixed upstream:

commit 0f4660c8787cc41fe67f869984c0ae11d680037e
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Jun 14 10:29:36 2012 +0200

    qemu: Fix off-by-one error while unescaping monitor strings
    
    While unescaping the commands the commands passed through to the monitor
    function qemuMonitorUnescapeArg() initialized lenght of the input string
    to strlen()+1 which is fine for alloc but not for iteration of the
    string.
    
    This patch fixes the off-by-one error and drops the pointless check for
    a single trailing slash that is automaticaly handled by the default
    branch of switch.
Comment 9 zhe peng 2012-07-31 06:20:39 EDT
I can reproduce this with:
libvirt-0.9.11.3-1.el7.x86_64
qemu-kvm-1.0-17.1.el7.x86_64

verify with:
libvirt-0.9.13-3.el6.x86_64

step:
  1: run cmd:
#for i in {a..z}; do virsh attach-disk $guest_name /dev/zero vd$i; done
error: Failed to attach disk
error: operation failed: target vda already exists

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

error: Failed to attach disk
error: internal error No more available PCI addresses

#virsh list --all
Id    Name                           State
----------------------------------------------------
 3     rhel6.3rcqcow2                 running
 -     rhel6.3c                       shut off
 -     rhel6.3rc                      shut off
 -     rhel6u2                        shut off

libvirt not crash, verification passed.
Comment 10 errata-xmlrpc 2013-02-21 02:13:10 EST
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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html

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