[libvirt] [PATCH v2 1/2] qemuMigrationCookieAddPersistent: change argument type

Jiri Denemark jdenemar at redhat.com
Thu Mar 17 11:50:00 UTC 2016


On Fri, Mar 11, 2016 at 18:13:39 +0300, Dmitry Andreev wrote:
> It wasn't possible to add XML not assigned to a domain because
> virDomainObjPtr was an argument type.
> ---
>  src/qemu/qemu_migration.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 38fa81c..92d2ce9 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -507,7 +507,7 @@ qemuMigrationCookieAddLockstate(qemuMigrationCookiePtr mig,
>  
>  static int
>  qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig,
> -                                 virDomainObjPtr dom)
> +                                 virDomainDefPtr def)
>  {
>      if (mig->flags & QEMU_MIGRATION_COOKIE_PERSISTENT) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> @@ -515,10 +515,10 @@ qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig,
>          return -1;
>      }
>  
> -    if (!dom->newDef)
> +    if (!def)
>          return 0;
>  
> -    mig->persistent = dom->newDef;
> +    mig->persistent = def;
>      mig->flags |= QEMU_MIGRATION_COOKIE_PERSISTENT;
>      mig->flagsMandatory |= QEMU_MIGRATION_COOKIE_PERSISTENT;
>      return 0;
> @@ -1367,7 +1367,7 @@ qemuMigrationBakeCookie(qemuMigrationCookiePtr mig,
>          return -1;
>  
>      if (flags & QEMU_MIGRATION_COOKIE_PERSISTENT &&
> -        qemuMigrationCookieAddPersistent(mig, dom) < 0)
> +        qemuMigrationCookieAddPersistent(mig, dom->newDef) < 0)
>          return -1;

As mentioned in my reply to the second patch, I think this if statement
could just be dropped completely, forcing the caller to use
qemuMigrationCookieAddPersistent explicitly.

Jirka




More information about the libvir-list mailing list