[libvirt] [PATCH v2 8/8] qemu: Fix some corner cases in persistent migration
Jiri Denemark
jdenemar at redhat.com
Fri Sep 18 12:25:47 UTC 2015
On Thu, Sep 17, 2015 at 18:40:59 -0400, John Ferlan wrote:
>
>
> On 09/11/2015 09:26 AM, Jiri Denemark wrote:
> > When persistently migrating a domain to a destination host where the
> > same domain already exists (i.e., it is persistent and shutdown at the
> > destination), we would happily through away the original persistent
>
> s/through/throw
>
> > definition without properly freeing it. And when updating the definition
> > fails for some reason we don't properly revert to the original state
> > leaving the domain broken.
> >
> > In addition to fixing these issues, the patch also makes sure the domain
> > definition parsed from a migration cookie is either used or freed.
> >
> > Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> > ---
> >
> > Notes:
> > Version 2:
> > - new patch
> >
> > src/qemu/qemu_migration.c | 56 +++++++++++++++++++++++++++++++----------------
> > 1 file changed, 37 insertions(+), 19 deletions(-)
> >
>
> Ran using my Coverity checker...
>
> One issue - in qemuMigrationPersist can get to 'cleanup:' calling
> qemuMigrationCookieGetPersistent when 'mig == NULL' from either the goto
> in the "if (!qemuMigrationJobIsActive(vm...)" or "if (!(mig =
> qemuMigrationEatCookie(driver, ..." paths
>
>
> > diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> > index c761657..1d556eb 100644
> > --- a/src/qemu/qemu_migration.c
> > +++ b/src/qemu/qemu_migration.c
...
> > @@ -5796,6 +5813,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
> > qemuMonitorSetDomainLog(priv->mon, -1);
> > VIR_FREE(priv->origname);
> > virDomainObjEndAPI(&vm);
> > + virDomainDefFree(qemuMigrationCookieGetPersistent(mig));
>
> If this has a "if (mig)", then Coverity is happy.
Hmm, coverity is right.
Jirka
More information about the libvir-list
mailing list