[libvirt] [PATCH v3 2/3] libxl: move begin phase job handling

Jim Fehlig jfehlig at suse.com
Tue Feb 2 01:23:13 UTC 2016


On 01/20/2016 12:00 PM, Joao Martins wrote:
> . From libxlMigrationBegin to libxlDomainMigrateBegin3Params().
> This is a preparatory patch to be able to begin a job in the
> perform phase.
>
> Signed-off-by: Joao Martins <joao.m.martins at oracle.com>
> ---
>  src/libxl/libxl_driver.c    | 18 +++++++++++++++++-
>  src/libxl/libxl_migration.c | 16 +++-------------
>  2 files changed, 20 insertions(+), 14 deletions(-)
>
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index d34f843..28220b2 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -5187,6 +5187,8 @@ libxlDomainMigrateBegin3Params(virDomainPtr domain,
>  {
>      const char *xmlin = NULL;
>      virDomainObjPtr vm = NULL;
> +    libxlDriverPrivatePtr driver;
> +    char *ret;
>  
>  #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
>      virReportUnsupportedError();
> @@ -5223,7 +5225,21 @@ libxlDomainMigrateBegin3Params(virDomainPtr domain,
>          return NULL;
>      }
>  
> -    return libxlDomainMigrationBegin(domain->conn, vm, xmlin);
> +    driver = domain->conn->privateData;
> +    if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) {
> +        virObjectUnlock(vm);
> +        return NULL;
> +    }
> +
> +    ret = libxlDomainMigrationBegin(domain->conn, vm, xmlin);
> +
> +    if (!libxlDomainObjEndJob(driver, vm))
> +        vm = NULL;

IIRC the qemu driver handles this a bit differently, and probably more
correctly. On the sender, a job is started during the begin phase and ended in
the confirm phase. On the receiver, a job is started in the prepare phase and
ended in the finish phase. This prevents modifying the virDomainObj between
phases, e.g. the begin and perform phases on the sender. Is it possible to
change the job handling similarly in the libxl migration phases?

Regards,
Jim




More information about the libvir-list mailing list