Received: from eggs.gnu.org ([2001:4830:134:3::10]:37624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzcKK-0004Sq-Im for qemu-devel@nongnu.org; Thu, 27 Oct 2016 00:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzcKH-0001dZ-UR for qemu-devel@nongnu.org; Thu, 27 Oct 2016 00:30:04 -0400 Received: from indium.canonical.com ([91.189.90.7]:53210) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzcKH-0001d3-Pe for qemu-devel@nongnu.org; Thu, 27 Oct 2016 00:30:01 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1bzcKG-0004zY-Qv for ; Thu, 27 Oct 2016 04:30:00 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id BF58A2E80BF for ; Thu, 27 Oct 2016 04:30:00 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 27 Oct 2016 04:17:23 -0000 From: Launchpad Bug Tracker <588803@bugs.launchpad.net> Reply-To: Bug 588803 <588803@bugs.launchpad.net> Sender: bounces@canonical.com References: <20100602160905.25995.39284.malonedeb@palladium.canonical.com> Message-Id: <20161027041723.10649.54574.malone@loganberry.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 588803] Re: Image corruption during snapshot creation/deletion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org [Expired for QEMU because there has been no activity for 60 days.] ** Changed in: qemu Status: Incomplete =3D> Expired -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/588803 Title: Image corruption during snapshot creation/deletion Status in QEMU: Expired Bug description: Hello, The creation/deletion of snapshots sometimes crashes and corrupts the VM image and provoke a segmentation fault in "strcmp", called from "bdrv_snapshot_find". Here is a patch that temporarily fixes that (it fixes the segfault but not its reason) : --- qemu-kvm-0.12.2-old/savevm.c 2010-01-18 19:48:25.000000000 +0100 +++ qemu-kvm-0.12.2/savevm.c 2010-02-12 13:45:07.225644169 +0100 @@ -1624,6 +1624,7 @@ int nb_sns, i, ret; = ret =3D -ENOENT; + if (!name) return ret; nb_sns =3D bdrv_snapshot_list(bs, &sn_tab); if (nb_sns < 0) return ret; @@ -1649,6 +1650,8 @@ QEMUSnapshotInfo sn1, *snapshot =3D &sn1; int ret; = + if (!name) return 0; + QTAILQ_FOREACH(dinfo, &drives, next) { bs =3D dinfo->bdrv; if (bdrv_can_snapshot(bs) && @@ -1777,6 +1780,11 @@ QTAILQ_FOREACH(dinfo, &drives, next) { bs1 =3D dinfo->bdrv; if (bdrv_has_snapshot(bs1)) { + if (!name) { + monitor_printf(mon, "Could not find snapshot 'NULL' on " + "device '%s'\n", + bdrv_get_device_name(bs1)); + } ret =3D bdrv_snapshot_goto(bs1, name); if (ret < 0) { if (bs !=3D bs1) @@ -1804,6 +1812,11 @@ } } = + if (!name) { + monitor_printf(mon, "VM state name is NULL\n"); + return -EINVAL; + } + /* Don't even try to load empty VM states */ ret =3D bdrv_snapshot_find(bs, &sn, name); if ((ret >=3D 0) && (sn.vm_state_size =3D=3D 0)) @@ -1840,6 +1853,11 @@ QTAILQ_FOREACH(dinfo, &drives, next) { bs1 =3D dinfo->bdrv; if (bdrv_has_snapshot(bs1)) { + if (!name) { + monitor_printf(mon, "Could not find snapshot 'NULL' on " + "device '%s'\n", + bdrv_get_device_name(bs1)); + } ret =3D bdrv_snapshot_delete(bs1, name); if (ret < 0) { if (ret =3D=3D -ENOTSUP) = The patch is very simple. Some checks on the variable "name" were missing= in "savevm.c". Regards, Nicolas Grandjean Conix Security To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/588803/+subscriptions