]> git.proxmox.com Git - mirror_qemu.git/commit
pseries: Simplify handling of the hash page table fd
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 8 Feb 2016 23:28:58 +0000 (09:28 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 16 Feb 2016 22:59:30 +0000 (09:59 +1100)
commit715c54071a43ab978dc12b9da22a5016203ed284
treee94539962f1fa2894ce2a5bd150a9a2913ead835
parent808bc3b069fdb5fc660f89e6bc7774eeefdc97ea
pseries: Simplify handling of the hash page table fd

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 <david@gibson.dropbear.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
hw/ppc/spapr.c
include/hw/ppc/spapr.h