[Libvirt-cim] [PATCH 3 of 4] Add MigrationType support to VirtualSystemMigrationService

Heidi Eckhart heidieck at linux.vnet.ibm.com
Wed Feb 27 12:53:08 UTC 2008


Kaitlin Rupert wrote:
> @@ -424,25 +448,39 @@ static CMPIStatus migrate_vs(struct migr
>                  goto out;
>          }
>
> -        CU_DEBUG("Migrating %s -> %s", job->domain, uri);
> -
> -        ddom = virDomainMigrate(dom, dconn, VIR_MIGRATE_LIVE, NULL, NULL, 0);
> -        if (ddom == NULL) {
> -                CU_DEBUG("Migration failed");
> -                cu_statusf(_BROKER, &s,
> -                           CMPI_RC_ERR_FAILED,
> -                           "Migration Failed");
> -                goto out;
> -        }
> +        switch(job->type) {
> +        case CIM_MIGRATE_OTHER:
> +                /* FIXME - Handle offline migration here */
> +                CU_DEBUG("Preparing for offline migration");
> +                break;
> +        case CIM_MIGRATE_LIVE:
> +                CU_DEBUG("Preparing for live migration");
> +                s = handle_migrate(dconn, dom, uri, VIR_MIGRATE_LIVE, job);
>   
Is the type CIM_MIGRATE_LIVE or VIR_MIGRATE_LIVE ?
> +                break;
> +        case CIM_MIGRATE_RESUME:
> +        case CIM_MIGRATE_RESTART:
> +                CU_DEBUG("Preparing for static migration");
> +                s = handle_migrate(dconn, dom, uri, 0, job);
>   
The type should be CIM_MIGRATE_RESTART
> +                break;
> +        default: 
> +                CU_DEBUG("Unsupported migration type (%d)", job->type);
> +                cu_statusf(_BROKER, &s,
> +                           CMPI_RC_ERR_FAILED,
> +                           "Unsupported migration type (%d)", job->type);
> +                goto out;
> +        }
> +
> +        if (s.rc != CMPI_RC_OK)
> +                goto out;
>
>  


-- 
Regards

Heidi Eckhart
Software Engineer
IBM Linux Technology Center - Open Hypervisor




More information about the Libvirt-cim mailing list