Bug 1267435

Summary: Crash tool arbitrarily rejects virsh dump files.
Product: Red Hat Enterprise Linux 7 Reporter: Dan Zheng <dzheng>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Jing Qi <jinqi>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: dyuan, dzheng, ggopinat, gsun, huding, jdenemar, jen, juzhang, knoel, mzhan, pagupta, rbalakri, thuth, virt-maint, xfu, xuzhang, yafu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-06 08:22:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Zheng 2015-09-30 03:00:13 UTC
Description of problem:
Crash tool arbitrarily rejects virsh dump files. This is a regression one from 
qemu-kvm-rhev-2.3.0-17.el7.ppc64le. Before that version, crash tool can accept the virsh dump file.

Version-Release number of selected component (if applicable):
kernel-3.10.0-319.el7.x86_64
libvirt-1.2.17-11.el7.x86_64
qemu-kvm-rhev-2.3.0-26.el7.x86_64
kernel-debuginfo-common-x86_64-3.10.0-319.el7.x86_64
kernel-debuginfo-3.10.0-319.el7.x86_64
crash-7.1.2-2.el7.x86_64

Guest: kernel-3.10.0-319.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start the guest and run # virsh dump guest /tmp/001, then /tmp/001 is created.
 
2. # crash /usr/lib/debug/lib/modules/3.10.0-319.el7.x86_64/vmlinux /tmp/001

Actual results:
Crash tool rejects the virsh dump file.

crash 7.1.2-2.el7
Copyright (C) 2002-2014  Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
Copyright (C) 1999-2006  Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011  NEC Corporation
Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions.  Enter "help copying" to see the conditions.
This program has absolutely no warranty.  Enter "help warranty" for details.
 
                                       
crash: /tmp/001: initialization failed


Expected results:
Two ways to fix when run 'virsh dump'
1. Produce an error message saying --memory-only option is required.
or 
2. Create the dump file with valid format, maybe ELF by default??

Additional info:
Refer to bug 1240497, there are different code paths for virsh dump and guest crash. And two different formats are used for the two cases. 'virsh dump' used the old qemu migration file format which seems out of date and will not developed any more. So it is suggested using 'virsh dump --memory-only' which will by default use ELF format instead of 'virsh dump'.  However, 'virsh dump' can work with qemu-kvm-rhev-2.3.0-16.el7.x86_64 and before. It is unreasonable that it fails from qemu-kvm-rhev-2.3.0-17.el7.x86_64. So two ways are suggested to fix this.

Comment 5 Jeff Nelson 2016-10-07 14:08:49 UTC
Related:
BZ 1304222
BZ 1373088

Comment 6 Greeshma Gopinath 2017-02-03 18:25:52 UTC
As per Lazlo Ersek's recommendations:
The following solution wouldnt work:

Two ways to fix when run 'virsh dump'
1. Produce an error message saying --memory-only option is required.
or 
2. Create the dump file with valid format, maybe ELF by default??

"because the file format that plain "virsh dump" produces (which is
basically a QEMU migration stream saved into a file) could still be
useful for various use cases."

I am reassigning the bug to the libvirt to note the new change in virsh behaviour

Comment 7 Jiri Denemark 2017-02-06 08:22:58 UTC
This is already documented in 7.3:

commit dd14032b39c8682b822c7055db5668302686fbcf
Author:     Jaroslav Suchanek <jsuchane>
AuthorDate: Mon Jun 20 13:34:28 2016 +0200
Commit:     Martin Kletzander <mkletzan>
CommitDate: Mon Jun 20 14:37:02 2016 +0200

    docs: virsh: Added note for the dump command
    
    Crash dump in a old kvmdump format is being obsolete and cannot be loaded and
    processed by crash utility since its version 6.1.0. A --memory-only option is
    required in order to produce valid ELF file which can be later processed by the
    crash utility. A new note is added to the dump command description.