From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEDxn-0006bx-5q for qemu-devel@nongnu.org; Tue, 27 Aug 2013 03:45:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEDxe-0001Rc-OA for qemu-devel@nongnu.org; Tue, 27 Aug 2013 03:45:19 -0400 Received: from mail-ee0-x22f.google.com ([2a00:1450:4013:c00::22f]:61937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEDxe-0001RW-Hu for qemu-devel@nongnu.org; Tue, 27 Aug 2013 03:45:10 -0400 Received: by mail-ee0-f47.google.com with SMTP id d49so2051526eek.6 for ; Tue, 27 Aug 2013 00:45:09 -0700 (PDT) Date: Tue, 27 Aug 2013 09:45:07 +0200 From: Stefan Hajnoczi Message-ID: <20130827074507.GC24247@stefanha-thinkpad.redhat.com> References: <7453899A-FDF5-4290-82FA-3EFDC4DD8EA4@icloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7453899A-FDF5-4290-82FA-3EFDC4DD8EA4@icloud.com> Subject: Re: [Qemu-devel] questions about the bdrv_co_do_readv() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yaodong Yang Cc: "qemu-devel@nongnu.org" On Mon, Aug 26, 2013 at 09:59:51PM -0500, Yaodong Yang wrote: > In sum, the bdrv_co_do_readv() seems to be executed inside two thread, the migration thread and native iothread. Both of them executed the function twice for a single request. Could someone explain it for me ? I appreciate it very much! Did you check the bdrv_co_readv(bs=...) argument? The calls may be referring to two different BlockDriverState instances. A raw image file looks like this: BDS#1 (block/raw.c) ->backing_hd = NULL ->file = BDS#2 BDS#2 (block/raw-posix.c) With qcow2 and no backing file you would have something like this: BDS#1 (block/qcow2.c) ->backing_hd = NULL ->file = BDS#2 BDS#2 (block/raw-posix.c) Expect to see calls forwarded from BDS#1 to BDS#2. Stefan