Dan Smith wrote:
HE> Its not very consistent that libvirt uses VIR_MIGRATE_LIVE and
0
HE> (instead of VIR_MIGRATE_STATIC or something else) as values, but
HE> that's something we seem to live with.
The reason for this is that it's not a "type" parameter, but a
"flags"
parameter. Static migration is considered the default, with Live
being an option. You could potentially also have a flag like
VIR_MIGRATE_SECURE, which would give you the following two
combinations:
VIR_MIGRATE_SECURE -- Static, secure migration
VIR_MIGRATE_SECURE | VIR_MIGRATE_LIVE -- Live, secure migration
Make sense?
The code bit that caused the confusion is:
static CMPIStatus handle_migrate(virConnectPtr dconn,
virDomainPtr dom,
char *uri,
int type,
struct migration_job *job)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
virDomainPtr ddom = NULL;
CU_DEBUG("Migrating %s -> %s", job->domain, uri);
ddom = virDomainMigrate(dom, dconn, type, NULL, NULL, 0);
if (ddom == NULL) {
CU_DEBUG("Migration failed");
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
"Migration Failed");
}
virDomainFree(ddom);
return s;
}
Would it be better to change the variable name from int type to int flag?
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com