From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSfBS-0006L3-BW for qemu-devel@nongnu.org; Mon, 08 Feb 2016 01:20:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSfBO-0008Ty-AN for qemu-devel@nongnu.org; Mon, 08 Feb 2016 01:20:26 -0500 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:34484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSfBO-0008Tk-1e for qemu-devel@nongnu.org; Mon, 08 Feb 2016 01:20:22 -0500 Received: by mail-pa0-x242.google.com with SMTP id yy13so5317703pab.1 for ; Sun, 07 Feb 2016 22:20:21 -0800 (PST) References: <1454638439-11938-1-git-send-email-david@gibson.dropbear.id.au> <1454638439-11938-4-git-send-email-david@gibson.dropbear.id.au> From: Alexey Kardashevskiy Message-ID: <56B8339F.9040207@ozlabs.ru> Date: Mon, 8 Feb 2016 17:20:15 +1100 MIME-Version: 1.0 In-Reply-To: <1454638439-11938-4-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/6] pseries: Simplify handling of the hash page table fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , benh@kernel.crashing.org, agraf@suse.de Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 02/05/2016 01:13 PM, David Gibson wrote: > When migrating the 'pseries' machine type with KVM, we use a special fd > to access the hash page table stored within KVM. Usually, this fd is > opened at the beginning of migration, and kept open until the migration > is complete. > > However, if there is a guest reset during the migration, the fd can become > stale and we need to re-open it. At the moment we use an 'htab_fd_stale' > flag in sPAPRMachineState to signal this, which is checked in the migration > iterators. > > But that's rather ugly. It's simpler to just close and invalidate the > fd on reset, and lazily re-open it in migration if necessary. This patch > implements that change. > > This requires a small addition to the machine state's instance_init, > so that htab_fd is initialized to -1 (telling the migration code it > needs to open it) instead of 0, which could be a valid fd. > > Signed-off-by: David Gibson Reviewed-by: Alexey Kardashevskiy -- Alexey