# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1205453395 25200
# Node ID 9905f7a33ed9ef02ff6ecfc0d1b5b335dcd16580
# Parent 2fa4dbe7b38189aeb1ddb4b770c531a75df788d3
Clean up uri param in VSMigrationService.
Now that the connection pointer is a part of the job struct, we don't have a uri
parameter to pass around.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 2fa4dbe7b381 -r 9905f7a33ed9 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Thu Mar 13 17:09:54 2008 -0700
+++ b/src/Virt_VSMigrationService.c Thu Mar 13 17:09:55 2008 -0700
@@ -625,12 +625,14 @@ static CMPIStatus define_guest_on_target
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;
+ char *uri;
+
+ uri = virConnectGetURI(dconn);
CU_DEBUG("Migrating %s -> %s", job->domain, uri);
ddom = virDomainMigrate(dom, dconn, type, NULL, NULL, 0);
@@ -642,13 +644,13 @@ static CMPIStatus handle_migrate(virConn
}
virDomainFree(ddom);
+ free(uri);
return s;
}
static CMPIStatus handle_offline_migrate(virConnectPtr dconn,
virDomainPtr dom,
- char *uri,
struct migration_job *job)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
@@ -688,7 +690,6 @@ static CMPIStatus migrate_vs(struct migr
CMPIStatus s;
virConnectPtr conn = NULL;
virDomainPtr dom = NULL;
- char *uri = NULL;
conn = connect_by_classname(_BROKER, job->ref_cn, &s);
if (conn == NULL)
@@ -706,16 +707,16 @@ static CMPIStatus migrate_vs(struct migr
switch(job->type) {
case CIM_MIGRATE_OTHER:
CU_DEBUG("Preparing for offline migration");
- s = handle_offline_migrate(job->conn, dom, uri, job);
+ s = handle_offline_migrate(job->conn, dom, job);
break;
case CIM_MIGRATE_LIVE:
CU_DEBUG("Preparing for live migration");
- s = handle_migrate(job->conn, dom, uri, VIR_MIGRATE_LIVE, job);
+ s = handle_migrate(job->conn, dom, VIR_MIGRATE_LIVE, job);
break;
case CIM_MIGRATE_RESUME:
case CIM_MIGRATE_RESTART:
CU_DEBUG("Preparing for static migration");
- s = handle_migrate(job->conn, dom, uri, 0, job);
+ s = handle_migrate(job->conn, dom, 0, job);
break;
default:
CU_DEBUG("Unsupported migration type (%d)", job->type);
@@ -745,7 +746,6 @@ static CMPIStatus migrate_vs(struct migr
out:
raise_deleted_ind(job);
- free(uri);
virDomainFree(dom);
virConnectClose(conn);