* [Qemu-devel] [PATCH] hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled
@ 2016-07-21 9:21 Thomas Huth
2016-07-21 10:10 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2016-07-21 9:21 UTC (permalink / raw)
To: David Gibson, qemu-ppc; +Cc: Alexander Graf, qemu-devel
When canceling a migration process, we currently do not close the
HTAB migration file descriptor since htab_save_complete() is never
called in that case. So we leave the migration process with a
dangling htab_fd value around, and this causes any further migration
attempts to fail. To fix this issue, simply make sure that the
htab_fd is closed during the migration cleanup stage. And since the
cleanup() function is also called when migration succeeds, we can
also remove the call to close_htab_fd() from the htab_save_complete()
function.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1354341
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/ppc/spapr.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7f33a1b..9193ac2 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1512,7 +1512,6 @@ static int htab_save_complete(QEMUFile *f, void *opaque)
if (rc < 0) {
return rc;
}
- close_htab_fd(spapr);
} else {
if (spapr->htab_first_pass) {
htab_save_first_pass(f, spapr, -1);
@@ -1614,10 +1613,18 @@ static int htab_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
+static void htab_cleanup(void *opaque)
+{
+ sPAPRMachineState *spapr = opaque;
+
+ close_htab_fd(spapr);
+}
+
static SaveVMHandlers savevm_htab_handlers = {
.save_live_setup = htab_save_setup,
.save_live_iterate = htab_save_iterate,
.save_live_complete_precopy = htab_save_complete,
+ .cleanup = htab_cleanup,
.load_state = htab_load,
};
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled
2016-07-21 9:21 [Qemu-devel] [PATCH] hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled Thomas Huth
@ 2016-07-21 10:10 ` Greg Kurz
2016-07-21 12:51 ` David Gibson
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kurz @ 2016-07-21 10:10 UTC (permalink / raw)
To: Thomas Huth; +Cc: David Gibson, qemu-ppc, qemu-devel
On Thu, 21 Jul 2016 11:21:34 +0200
Thomas Huth <thuth@redhat.com> wrote:
> When canceling a migration process, we currently do not close the
> HTAB migration file descriptor since htab_save_complete() is never
> called in that case. So we leave the migration process with a
> dangling htab_fd value around, and this causes any further migration
> attempts to fail. To fix this issue, simply make sure that the
> htab_fd is closed during the migration cleanup stage. And since the
> cleanup() function is also called when migration succeeds, we can
> also remove the call to close_htab_fd() from the htab_save_complete()
> function.
>
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1354341
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> hw/ppc/spapr.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 7f33a1b..9193ac2 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1512,7 +1512,6 @@ static int htab_save_complete(QEMUFile *f, void *opaque)
> if (rc < 0) {
> return rc;
> }
> - close_htab_fd(spapr);
> } else {
> if (spapr->htab_first_pass) {
> htab_save_first_pass(f, spapr, -1);
> @@ -1614,10 +1613,18 @@ static int htab_load(QEMUFile *f, void *opaque, int version_id)
> return 0;
> }
>
> +static void htab_cleanup(void *opaque)
> +{
> + sPAPRMachineState *spapr = opaque;
> +
> + close_htab_fd(spapr);
> +}
> +
> static SaveVMHandlers savevm_htab_handlers = {
> .save_live_setup = htab_save_setup,
> .save_live_iterate = htab_save_iterate,
> .save_live_complete_precopy = htab_save_complete,
> + .cleanup = htab_cleanup,
> .load_state = htab_load,
> };
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled
2016-07-21 10:10 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
@ 2016-07-21 12:51 ` David Gibson
0 siblings, 0 replies; 3+ messages in thread
From: David Gibson @ 2016-07-21 12:51 UTC (permalink / raw)
To: Greg Kurz; +Cc: Thomas Huth, qemu-ppc, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2256 bytes --]
On Thu, Jul 21, 2016 at 12:10:11PM +0200, Greg Kurz wrote:
> On Thu, 21 Jul 2016 11:21:34 +0200
> Thomas Huth <thuth@redhat.com> wrote:
>
> > When canceling a migration process, we currently do not close the
> > HTAB migration file descriptor since htab_save_complete() is never
> > called in that case. So we leave the migration process with a
> > dangling htab_fd value around, and this causes any further migration
> > attempts to fail. To fix this issue, simply make sure that the
> > htab_fd is closed during the migration cleanup stage. And since the
> > cleanup() function is also called when migration succeeds, we can
> > also remove the call to close_htab_fd() from the htab_save_complete()
> > function.
> >
> > Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1354341
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
>
> Reviewed-by: Greg Kurz <groug@kaod.org>
Applied to ppc-for-2.7
>
> > hw/ppc/spapr.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index 7f33a1b..9193ac2 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -1512,7 +1512,6 @@ static int htab_save_complete(QEMUFile *f, void *opaque)
> > if (rc < 0) {
> > return rc;
> > }
> > - close_htab_fd(spapr);
> > } else {
> > if (spapr->htab_first_pass) {
> > htab_save_first_pass(f, spapr, -1);
> > @@ -1614,10 +1613,18 @@ static int htab_load(QEMUFile *f, void *opaque, int version_id)
> > return 0;
> > }
> >
> > +static void htab_cleanup(void *opaque)
> > +{
> > + sPAPRMachineState *spapr = opaque;
> > +
> > + close_htab_fd(spapr);
> > +}
> > +
> > static SaveVMHandlers savevm_htab_handlers = {
> > .save_live_setup = htab_save_setup,
> > .save_live_iterate = htab_save_iterate,
> > .save_live_complete_precopy = htab_save_complete,
> > + .cleanup = htab_cleanup,
> > .load_state = htab_load,
> > };
> >
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-21 13:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21 9:21 [Qemu-devel] [PATCH] hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled Thomas Huth
2016-07-21 10:10 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-07-21 12:51 ` David Gibson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.