From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQasN-0008F8-5Z for qemu-devel@nongnu.org; Tue, 02 Feb 2016 08:20:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQasJ-0001kH-RR for qemu-devel@nongnu.org; Tue, 02 Feb 2016 08:20:10 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQasJ-0001kC-KB for qemu-devel@nongnu.org; Tue, 02 Feb 2016 08:20:07 -0500 Received: by mail-wm0-x244.google.com with SMTP id 128so2387479wmz.3 for ; Tue, 02 Feb 2016 05:20:07 -0800 (PST) Sender: Paolo Bonzini References: <1453273940-15382-1-git-send-email-den@openvz.org> <1453273940-15382-2-git-send-email-den@openvz.org> From: Paolo Bonzini Message-ID: <56B0AD04.1020303@redhat.com> Date: Tue, 2 Feb 2016 14:20:04 +0100 MIME-Version: 1.0 In-Reply-To: <1453273940-15382-2-git-send-email-den@openvz.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] block: fix assert in qcow2_get_specific_info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Kevin Wolf , qemu-devel@nongnu.org On 20/01/2016 08:12, Denis V. Lunev wrote: > There is a possibility to hit assert qcow2_get_specific_info that > s->qcow_version is undefined. This happens when VM in starting from > suspended state, i.e. it processes incoming migration, and in the same > time 'info block' is called. > > The problem is that in the qcow2_invalidate_cache closes and the image > and memsets BDRVQcowState in the middle. > > The patch moves processing of qcow2_get_specific_info into coroutine > context and ensures that qcow2_invalidate_cache and qcow2_get_specific_info > can not run simultaneosly. I'm sitting next to Kevin :) and this is not a qcow2 bug. The problem is that qcow2_invalidate_cache is being called in coroutine context. The process_incoming_migration_co code starting with bdrv_invalidate_cache_all should be moved out of the coroutine and into the main loop. You can use a bottom half to get out of coroutine context. The result should be a much simpler patch, too. Thanks, and sorry for the delay. I saw qcow2 in the title and assumed it was something I knew nothing about. :) Paolo