Received: from [140.186.70.92] (port=49161 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcEnV-0007Ka-DM for qemu-devel@nongnu.org; Mon, 10 Jan 2011 05:16:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcEnT-0000iU-TF for qemu-devel@nongnu.org; Mon, 10 Jan 2011 05:16:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcEnT-0000hy-LQ for qemu-devel@nongnu.org; Mon, 10 Jan 2011 05:16:19 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0AAGIIw017767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Jan 2011 05:16:18 -0500 From: Juan Quintela In-Reply-To: (Juan Quintela's message of "Tue, 4 Jan 2011 15:33:25 +0100") References: Date: Mon, 10 Jan 2011 11:15:17 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 0/5] Fix migration with NFS & iscsi/Fiber channel Reply-To: quintela@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Juan Quintela wrote: > Hi Nack myself :-( After discussions with hch on irc, he "convinced" me that only way to fix the problem is forcing O_DIRECT if migration is going to happen. So, changing patchset to check that cache=none is used in all read/write devices. Later, Juan. > This patch set creates infrastructure to invalidate buffers on > migration target machine. The best way to see the problems is: > > # create a new qcow2 image > qemu-img create -f qcow2 foo.img > # start the destination host > qemu .... path=foo.img.... > # start the source host with one installation > qemu .... path=foo.img.... > # migrate after lots of disk writes > > Destination will have "read" the beggining of the blocks of the file > (where the headers are). There are two bugs here: > a- we need to re-read the image after migration, to have the new values > (reopening fixes it) > b- we need to be sure that we read the new blocks that are on the server, > not the buffered ones locally from the start of the run. > NFS: flush on source and close + open on target invalidates the cache > Block devices: on linux, BLKFLSBUF invalidates all the buffers for that > device. This fixes iSCSI & FiberChannel. > > I tested iSCSI & NFS. NFS patch have been on RHEL5 kvm forever (I just > forget to send the patch upstream). Our NFS gurus & cluster gurus told > that this is enough for linux to ensure consistence. > > Once there, I fixed a couple of minor bugs (the first 3 patches): > - migration should exit with error 1 as everything else. > - memory leak on drive_uninit. > - fix cleanup on error on drive_init() > > Later, Juan. > > Juan Quintela (5): > migration: exit with error code > blockdev: don't leak id on removal > blockdev: release resources in the error case > Reopen files after migration > drive_open: Add invalidate option for block devices > > block.h | 2 ++ > block/raw-posix.c | 24 ++++++++++++++++++++++++ > blockdev.c | 53 +++++++++++++++++++++++++++++++++++++++++++++-------- > blockdev.h | 6 ++++++ > migration.c | 8 +++++++- > vl.c | 2 +- > 6 files changed, 85 insertions(+), 10 deletions(-)