From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgEb2-000160-VB for qemu-devel@nongnu.org; Mon, 20 Oct 2014 11:10:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgEat-0000kZ-QK for qemu-devel@nongnu.org; Mon, 20 Oct 2014 11:10:08 -0400 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]:59896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgEat-0000jh-5T for qemu-devel@nongnu.org; Mon, 20 Oct 2014 11:09:59 -0400 Received: by mail-pa0-f44.google.com with SMTP id et14so5379832pad.17 for ; Mon, 20 Oct 2014 08:09:54 -0700 (PDT) Message-ID: <544525AA.6030609@gmail.com> Date: Mon, 20 Oct 2014 23:09:30 +0800 From: Zhang Haoyu MIME-Version: 1.0 References: <201410202148499451733@sangfor.com> <20141020135955.GL3585@noname.redhat.com> In-Reply-To: <20141020135955.GL3585@noname.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [question] savevm/delvm: Is it necessary to perform bdrv_drain_all before savevm and delvm? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Zhang Haoyu Cc: qemu-devel , Stefan Hajnoczi , Max Reitz >> Hi, >> >> I noticed that bdrv_drain_all is performed in load_vmstate before bdrv_snapshot_goto, >> and bdrv_drain_all is performed in qmp_transaction before internal_snapshot_prepare, >> so is it also neccesary to perform bdrv_drain_all in savevm and delvm? > >Definitely yes for savevm. do_savevm() calls it indirectly via >vm_stop(), so that part looks okay. > Yes, you are right. >delvm doesn't affect the currently running VM, and therefore doesn't >interfere with guest requests that are in flight. So I think that a >bdrv_drain_all() isn't needed there. > I'm worried about that there are still pending IOs while deleting snapshot, then is it possible that there is concurrency problem between the process of deleting snapshot and the coroutine of io read/write(bdrv_co_do_rw) invoked by the pending IOs? This coroutine is also in main thread. Am I missing something? Thanks, Zhang Haoyu >Kevin