mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +00:00
Extend v3 migration protocol to allow app supplied XML for target
This extends the v3 migration protocol such that the virDomainMigrateBegin3 and virDomainMigratePerform3 methods accept an application supplied XML config for the target VM. If the 'xmlin' parameter is NULL, then Begin3 uses the current guest XML as normal. A driver implementing the Begin3 method should either reject all non-NULL 'xmlin' parameters, or strictly validate that the app supplied XML does not change guest ABI. The Perform3 method also needed the xmlin parameter to cope with the Peer2Peer migration sequence. NB it is not yet possible to use this capability since neither of the public virDomainMigrate/virDomainMigrateToURI methods have a way to pass in XML. * daemon/remote.c, src/remote/remote_driver.c, src/remote/remote_protocol.x, src/remote_protocol-structs: Add 'remote_string xmlin' parameter to begin3/perform3 RPC messages * src/libvirt.c, src/driver.h, src/libvirt_internal.h: Add 'const char *xmlin' parameter to Begin3/Perform3 methods * src/qemu/qemu_driver.c, src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Pass xmlin parameter around migration methods
This commit is contained in:
parent
dea64db1d2
commit
7ad4b6b9cc
@ -3128,6 +3128,7 @@ remoteDispatchDomainMigrateBegin3(struct qemud_server *server ATTRIBUTE_UNUSED,
|
|||||||
char *xml = NULL;
|
char *xml = NULL;
|
||||||
virDomainPtr dom = NULL;
|
virDomainPtr dom = NULL;
|
||||||
char *dname;
|
char *dname;
|
||||||
|
char *xmlin;
|
||||||
char *cookieout = NULL;
|
char *cookieout = NULL;
|
||||||
int cookieoutlen = 0;
|
int cookieoutlen = 0;
|
||||||
int rv = -1;
|
int rv = -1;
|
||||||
@ -3140,9 +3141,10 @@ remoteDispatchDomainMigrateBegin3(struct qemud_server *server ATTRIBUTE_UNUSED,
|
|||||||
if (!(dom = get_nonnull_domain(conn, args->dom)))
|
if (!(dom = get_nonnull_domain(conn, args->dom)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
xmlin = args->xmlin == NULL ? NULL : *args->xmlin;
|
||||||
dname = args->dname == NULL ? NULL : *args->dname;
|
dname = args->dname == NULL ? NULL : *args->dname;
|
||||||
|
|
||||||
if (!(xml = virDomainMigrateBegin3(dom,
|
if (!(xml = virDomainMigrateBegin3(dom, xmlin,
|
||||||
&cookieout, &cookieoutlen,
|
&cookieout, &cookieoutlen,
|
||||||
args->flags, dname, args->resource)))
|
args->flags, dname, args->resource)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -3288,6 +3290,7 @@ remoteDispatchDomainMigratePerform3(struct qemud_server *server ATTRIBUTE_UNUSED
|
|||||||
remote_domain_migrate_perform3_ret *ret)
|
remote_domain_migrate_perform3_ret *ret)
|
||||||
{
|
{
|
||||||
virDomainPtr dom = NULL;
|
virDomainPtr dom = NULL;
|
||||||
|
char *xmlin;
|
||||||
char *dname;
|
char *dname;
|
||||||
char *cookieout = NULL;
|
char *cookieout = NULL;
|
||||||
int cookieoutlen = 0;
|
int cookieoutlen = 0;
|
||||||
@ -3301,9 +3304,10 @@ remoteDispatchDomainMigratePerform3(struct qemud_server *server ATTRIBUTE_UNUSED
|
|||||||
if (!(dom = get_nonnull_domain(conn, args->dom)))
|
if (!(dom = get_nonnull_domain(conn, args->dom)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
xmlin = args->xmlin == NULL ? NULL : *args->xmlin;
|
||||||
dname = args->dname == NULL ? NULL : *args->dname;
|
dname = args->dname == NULL ? NULL : *args->dname;
|
||||||
|
|
||||||
if (virDomainMigratePerform3(dom,
|
if (virDomainMigratePerform3(dom, xmlin,
|
||||||
args->cookie_in.cookie_in_val,
|
args->cookie_in.cookie_in_val,
|
||||||
args->cookie_in.cookie_in_len,
|
args->cookie_in.cookie_in_len,
|
||||||
&cookieout, &cookieoutlen,
|
&cookieout, &cookieoutlen,
|
||||||
|
@ -538,6 +538,7 @@ typedef int
|
|||||||
typedef char *
|
typedef char *
|
||||||
(*virDrvDomainMigrateBegin3)
|
(*virDrvDomainMigrateBegin3)
|
||||||
(virDomainPtr domain,
|
(virDomainPtr domain,
|
||||||
|
const char *xmlin,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
int *cookieoutlen,
|
int *cookieoutlen,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
@ -575,6 +576,7 @@ typedef int
|
|||||||
typedef int
|
typedef int
|
||||||
(*virDrvDomainMigratePerform3)
|
(*virDrvDomainMigratePerform3)
|
||||||
(virDomainPtr dom,
|
(virDomainPtr dom,
|
||||||
|
const char *xmlin,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
|
@ -3719,6 +3719,7 @@ finish:
|
|||||||
static virDomainPtr
|
static virDomainPtr
|
||||||
virDomainMigrateVersion3(virDomainPtr domain,
|
virDomainMigrateVersion3(virDomainPtr domain,
|
||||||
virConnectPtr dconn,
|
virConnectPtr dconn,
|
||||||
|
const char *xmlin,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
const char *dname,
|
const char *dname,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
@ -3748,8 +3749,8 @@ virDomainMigrateVersion3(virDomainPtr domain,
|
|||||||
|
|
||||||
VIR_DEBUG("Begin3 %p", domain->conn);
|
VIR_DEBUG("Begin3 %p", domain->conn);
|
||||||
dom_xml = domain->conn->driver->domainMigrateBegin3
|
dom_xml = domain->conn->driver->domainMigrateBegin3
|
||||||
(domain, &cookieout, &cookieoutlen, flags, dname,
|
(domain, xmlin, &cookieout, &cookieoutlen,
|
||||||
bandwidth);
|
flags, dname, bandwidth);
|
||||||
if (!dom_xml)
|
if (!dom_xml)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
@ -3792,7 +3793,8 @@ virDomainMigrateVersion3(virDomainPtr domain,
|
|||||||
cookieout = NULL;
|
cookieout = NULL;
|
||||||
cookieoutlen = 0;
|
cookieoutlen = 0;
|
||||||
ret = domain->conn->driver->domainMigratePerform3
|
ret = domain->conn->driver->domainMigratePerform3
|
||||||
(domain, cookiein, cookieinlen, &cookieout, &cookieoutlen,
|
(domain, NULL, cookiein, cookieinlen,
|
||||||
|
&cookieout, &cookieoutlen,
|
||||||
uri, flags, dname, bandwidth);
|
uri, flags, dname, bandwidth);
|
||||||
|
|
||||||
/* Perform failed. Make sure Finish doesn't overwrite the error */
|
/* Perform failed. Make sure Finish doesn't overwrite the error */
|
||||||
@ -3872,6 +3874,7 @@ finish:
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
virDomainMigratePeer2Peer (virDomainPtr domain,
|
virDomainMigratePeer2Peer (virDomainPtr domain,
|
||||||
|
const char *xmlin,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
const char *dname,
|
const char *dname,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
@ -3907,6 +3910,7 @@ virDomainMigratePeer2Peer (virDomainPtr domain,
|
|||||||
VIR_DRV_FEATURE_MIGRATION_V3)) {
|
VIR_DRV_FEATURE_MIGRATION_V3)) {
|
||||||
VIR_DEBUG("Using migration protocol 3");
|
VIR_DEBUG("Using migration protocol 3");
|
||||||
return domain->conn->driver->domainMigratePerform3(domain,
|
return domain->conn->driver->domainMigratePerform3(domain,
|
||||||
|
xmlin,
|
||||||
NULL, /* cookiein */
|
NULL, /* cookiein */
|
||||||
0, /* cookieinlen */
|
0, /* cookieinlen */
|
||||||
NULL, /* cookieoutlen */
|
NULL, /* cookieoutlen */
|
||||||
@ -3917,6 +3921,11 @@ virDomainMigratePeer2Peer (virDomainPtr domain,
|
|||||||
bandwidth);
|
bandwidth);
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG("Using migration protocol 2");
|
VIR_DEBUG("Using migration protocol 2");
|
||||||
|
if (xmlin) {
|
||||||
|
virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("Unable to change target guest XML during migration"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return domain->conn->driver->domainMigratePerform(domain,
|
return domain->conn->driver->domainMigratePerform(domain,
|
||||||
NULL, /* cookie */
|
NULL, /* cookie */
|
||||||
0, /* cookielen */
|
0, /* cookielen */
|
||||||
@ -3941,6 +3950,7 @@ virDomainMigratePeer2Peer (virDomainPtr domain,
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
virDomainMigrateDirect (virDomainPtr domain,
|
virDomainMigrateDirect (virDomainPtr domain,
|
||||||
|
const char *xmlin,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
const char *dname,
|
const char *dname,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
@ -3959,6 +3969,7 @@ virDomainMigrateDirect (virDomainPtr domain,
|
|||||||
VIR_DRV_FEATURE_MIGRATION_V3)) {
|
VIR_DRV_FEATURE_MIGRATION_V3)) {
|
||||||
VIR_DEBUG("Using migration protocol 3");
|
VIR_DEBUG("Using migration protocol 3");
|
||||||
return domain->conn->driver->domainMigratePerform3(domain,
|
return domain->conn->driver->domainMigratePerform3(domain,
|
||||||
|
xmlin,
|
||||||
NULL, /* cookiein */
|
NULL, /* cookiein */
|
||||||
0, /* cookieinlen */
|
0, /* cookieinlen */
|
||||||
NULL, /* cookieoutlen */
|
NULL, /* cookieoutlen */
|
||||||
@ -3969,6 +3980,11 @@ virDomainMigrateDirect (virDomainPtr domain,
|
|||||||
bandwidth);
|
bandwidth);
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG("Using migration protocol 2");
|
VIR_DEBUG("Using migration protocol 2");
|
||||||
|
if (xmlin) {
|
||||||
|
virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("Unable to change target guest XML during migration"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return domain->conn->driver->domainMigratePerform(domain,
|
return domain->conn->driver->domainMigratePerform(domain,
|
||||||
NULL, /* cookie */
|
NULL, /* cookie */
|
||||||
0, /* cookielen */
|
0, /* cookielen */
|
||||||
@ -4093,7 +4109,8 @@ virDomainMigrate (virDomainPtr domain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("Using peer2peer migration");
|
VIR_DEBUG("Using peer2peer migration");
|
||||||
if (virDomainMigratePeer2Peer(domain, flags, dname, uri ? uri : dstURI, bandwidth) < 0) {
|
if (virDomainMigratePeer2Peer(domain, NULL, flags, dname,
|
||||||
|
uri ? uri : dstURI, bandwidth) < 0) {
|
||||||
VIR_FREE(dstURI);
|
VIR_FREE(dstURI);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -4118,7 +4135,7 @@ virDomainMigrate (virDomainPtr domain,
|
|||||||
VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_V3)) {
|
VIR_DRV_FEATURE_MIGRATION_V3)) {
|
||||||
VIR_DEBUG("Using migration protocol 3");
|
VIR_DEBUG("Using migration protocol 3");
|
||||||
ddomain = virDomainMigrateVersion3(domain, dconn, flags, dname, uri, bandwidth);
|
ddomain = virDomainMigrateVersion3(domain, dconn, NULL, flags, dname, uri, bandwidth);
|
||||||
} else if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
} else if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_V2) &&
|
VIR_DRV_FEATURE_MIGRATION_V2) &&
|
||||||
VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
||||||
@ -4238,7 +4255,8 @@ virDomainMigrateToURI (virDomainPtr domain,
|
|||||||
if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn,
|
if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_P2P)) {
|
VIR_DRV_FEATURE_MIGRATION_P2P)) {
|
||||||
VIR_DEBUG("Using peer2peer migration");
|
VIR_DEBUG("Using peer2peer migration");
|
||||||
if (virDomainMigratePeer2Peer (domain, flags, dname, duri, bandwidth) < 0)
|
if (virDomainMigratePeer2Peer(domain, NULL, flags,
|
||||||
|
dname, duri, bandwidth) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
/* No peer to peer migration supported */
|
/* No peer to peer migration supported */
|
||||||
@ -4249,7 +4267,8 @@ virDomainMigrateToURI (virDomainPtr domain,
|
|||||||
if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn,
|
if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_DIRECT)) {
|
VIR_DRV_FEATURE_MIGRATION_DIRECT)) {
|
||||||
VIR_DEBUG("Using direct migration");
|
VIR_DEBUG("Using direct migration");
|
||||||
if (virDomainMigrateDirect (domain, flags, dname, duri, bandwidth) < 0)
|
if (virDomainMigrateDirect(domain, NULL, flags,
|
||||||
|
dname, duri, bandwidth) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
/* Cannot do a migration with only the perform step */
|
/* Cannot do a migration with only the perform step */
|
||||||
@ -4567,6 +4586,7 @@ error:
|
|||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
virDomainMigrateBegin3(virDomainPtr domain,
|
virDomainMigrateBegin3(virDomainPtr domain,
|
||||||
|
const char *xmlin,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
int *cookieoutlen,
|
int *cookieoutlen,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
@ -4575,9 +4595,9 @@ virDomainMigrateBegin3(virDomainPtr domain,
|
|||||||
{
|
{
|
||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
|
|
||||||
VIR_DOMAIN_DEBUG(domain, "cookieout=%p, cookieoutlen=%p, "
|
VIR_DOMAIN_DEBUG(domain, "xmlin=%s cookieout=%p, cookieoutlen=%p, "
|
||||||
"flags=%lu, dname=%s, bandwidth=%lu",
|
"flags=%lu, dname=%s, bandwidth=%lu",
|
||||||
cookieout, cookieoutlen, flags,
|
NULLSTR(xmlin), cookieout, cookieoutlen, flags,
|
||||||
NULLSTR(dname), bandwidth);
|
NULLSTR(dname), bandwidth);
|
||||||
|
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
@ -4596,7 +4616,7 @@ virDomainMigrateBegin3(virDomainPtr domain,
|
|||||||
|
|
||||||
if (conn->driver->domainMigrateBegin3) {
|
if (conn->driver->domainMigrateBegin3) {
|
||||||
char *xml;
|
char *xml;
|
||||||
xml = conn->driver->domainMigrateBegin3(domain,
|
xml = conn->driver->domainMigrateBegin3(domain, xmlin,
|
||||||
cookieout, cookieoutlen,
|
cookieout, cookieoutlen,
|
||||||
flags, dname, bandwidth);
|
flags, dname, bandwidth);
|
||||||
VIR_DEBUG("xml %s", NULLSTR(xml));
|
VIR_DEBUG("xml %s", NULLSTR(xml));
|
||||||
@ -4733,6 +4753,7 @@ error:
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virDomainMigratePerform3(virDomainPtr domain,
|
virDomainMigratePerform3(virDomainPtr domain,
|
||||||
|
const char *xmlin,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
@ -4744,9 +4765,11 @@ virDomainMigratePerform3(virDomainPtr domain,
|
|||||||
{
|
{
|
||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
|
|
||||||
VIR_DOMAIN_DEBUG(domain, "cookiein=%p, cookieinlen=%d, cookieout=%p, cookieoutlen=%p,"
|
VIR_DOMAIN_DEBUG(domain, "xmlin=%s cookiein=%p, cookieinlen=%d, "
|
||||||
|
"cookieout=%p, cookieoutlen=%p, "
|
||||||
"uri=%s, flags=%lu, dname=%s, bandwidth=%lu",
|
"uri=%s, flags=%lu, dname=%s, bandwidth=%lu",
|
||||||
cookiein, cookieinlen, cookieout, cookieoutlen,
|
NULLSTR(xmlin), cookiein, cookieinlen,
|
||||||
|
cookieout, cookieoutlen,
|
||||||
uri, flags, NULLSTR(dname), bandwidth);
|
uri, flags, NULLSTR(dname), bandwidth);
|
||||||
|
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
@ -4765,7 +4788,7 @@ virDomainMigratePerform3(virDomainPtr domain,
|
|||||||
|
|
||||||
if (conn->driver->domainMigratePerform3) {
|
if (conn->driver->domainMigratePerform3) {
|
||||||
int ret;
|
int ret;
|
||||||
ret = conn->driver->domainMigratePerform3(domain,
|
ret = conn->driver->domainMigratePerform3(domain, xmlin,
|
||||||
cookiein, cookieinlen,
|
cookiein, cookieinlen,
|
||||||
cookieout, cookieoutlen,
|
cookieout, cookieoutlen,
|
||||||
uri,
|
uri,
|
||||||
|
@ -124,6 +124,7 @@ int virDomainMigratePrepareTunnel(virConnectPtr dconn,
|
|||||||
|
|
||||||
|
|
||||||
char *virDomainMigrateBegin3(virDomainPtr domain,
|
char *virDomainMigrateBegin3(virDomainPtr domain,
|
||||||
|
const char *xmlin,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
int *cookieoutlen,
|
int *cookieoutlen,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
@ -155,6 +156,7 @@ int virDomainMigratePrepareTunnel3(virConnectPtr dconn,
|
|||||||
|
|
||||||
|
|
||||||
int virDomainMigratePerform3(virDomainPtr dom,
|
int virDomainMigratePerform3(virDomainPtr dom,
|
||||||
|
const char *xmlin,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
|
@ -5973,7 +5973,7 @@ qemudDomainMigratePerform (virDomainPtr dom,
|
|||||||
* Consume any cookie we were able to decode though
|
* Consume any cookie we were able to decode though
|
||||||
*/
|
*/
|
||||||
ret = qemuMigrationPerform(driver, dom->conn, vm,
|
ret = qemuMigrationPerform(driver, dom->conn, vm,
|
||||||
uri, cookie, cookielen,
|
NULL, uri, cookie, cookielen,
|
||||||
NULL, NULL, /* No output cookies in v2 */
|
NULL, NULL, /* No output cookies in v2 */
|
||||||
flags, dname, resource, true);
|
flags, dname, resource, true);
|
||||||
|
|
||||||
@ -6042,6 +6042,7 @@ cleanup:
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
qemuDomainMigrateBegin3(virDomainPtr domain,
|
qemuDomainMigrateBegin3(virDomainPtr domain,
|
||||||
|
const char *xmlin,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
int *cookieoutlen,
|
int *cookieoutlen,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
@ -6071,7 +6072,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = qemuMigrationBegin(driver, vm,
|
xml = qemuMigrationBegin(driver, vm, xmlin,
|
||||||
cookieout, cookieoutlen);
|
cookieout, cookieoutlen);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -6188,6 +6189,7 @@ cleanup:
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
qemuDomainMigratePerform3(virDomainPtr dom,
|
qemuDomainMigratePerform3(virDomainPtr dom,
|
||||||
|
const char *xmlin,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
@ -6220,7 +6222,7 @@ qemuDomainMigratePerform3(virDomainPtr dom,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = qemuMigrationPerform(driver, dom->conn, vm,
|
ret = qemuMigrationPerform(driver, dom->conn, vm, xmlin,
|
||||||
uri, cookiein, cookieinlen,
|
uri, cookiein, cookieinlen,
|
||||||
cookieout, cookieoutlen,
|
cookieout, cookieoutlen,
|
||||||
flags, dname, resource, false);
|
flags, dname, resource, false);
|
||||||
|
@ -863,12 +863,19 @@ qemuDomainMigrateGraphicsRelocate(struct qemud_driver *driver,
|
|||||||
|
|
||||||
char *qemuMigrationBegin(struct qemud_driver *driver,
|
char *qemuMigrationBegin(struct qemud_driver *driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
|
const char *xmlin,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
int *cookieoutlen)
|
int *cookieoutlen)
|
||||||
{
|
{
|
||||||
char *rv = NULL;
|
char *rv = NULL;
|
||||||
qemuMigrationCookiePtr mig = NULL;
|
qemuMigrationCookiePtr mig = NULL;
|
||||||
|
|
||||||
|
if (xmlin) {
|
||||||
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
"%s", _("Passing XML for the target VM is not yet supported"));
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("domain is not running"));
|
"%s", _("domain is not running"));
|
||||||
@ -1779,6 +1786,7 @@ static int doPeer2PeerMigrate3(struct qemud_driver *driver,
|
|||||||
virConnectPtr sconn,
|
virConnectPtr sconn,
|
||||||
virConnectPtr dconn,
|
virConnectPtr dconn,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
|
const char *xmlin,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
const char *dname,
|
const char *dname,
|
||||||
@ -1797,7 +1805,7 @@ static int doPeer2PeerMigrate3(struct qemud_driver *driver,
|
|||||||
virStreamPtr st = NULL;
|
virStreamPtr st = NULL;
|
||||||
|
|
||||||
VIR_DEBUG("Begin3 %p", sconn);
|
VIR_DEBUG("Begin3 %p", sconn);
|
||||||
dom_xml = qemuMigrationBegin(driver, vm,
|
dom_xml = qemuMigrationBegin(driver, vm, xmlin,
|
||||||
&cookieout, &cookieoutlen);
|
&cookieout, &cookieoutlen);
|
||||||
if (!dom_xml)
|
if (!dom_xml)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1943,6 +1951,7 @@ finish:
|
|||||||
static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
||||||
virConnectPtr sconn,
|
virConnectPtr sconn,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
|
const char *xmlin,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
const char *dname,
|
const char *dname,
|
||||||
@ -1987,7 +1996,7 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (v3)
|
if (v3)
|
||||||
ret = doPeer2PeerMigrate3(driver, sconn, dconn, vm,
|
ret = doPeer2PeerMigrate3(driver, sconn, dconn, vm, xmlin,
|
||||||
uri, flags, dname, resource);
|
uri, flags, dname, resource);
|
||||||
else
|
else
|
||||||
ret = doPeer2PeerMigrate2(driver, sconn, dconn, vm,
|
ret = doPeer2PeerMigrate2(driver, sconn, dconn, vm,
|
||||||
@ -2006,6 +2015,7 @@ cleanup:
|
|||||||
int qemuMigrationPerform(struct qemud_driver *driver,
|
int qemuMigrationPerform(struct qemud_driver *driver,
|
||||||
virConnectPtr conn,
|
virConnectPtr conn,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
|
const char *xmlin,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
@ -2048,7 +2058,8 @@ int qemuMigrationPerform(struct qemud_driver *driver,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doPeer2PeerMigrate(driver, conn, vm, uri, flags, dname, resource) < 0)
|
if (doPeer2PeerMigrate(driver, conn, vm, xmlin,
|
||||||
|
uri, flags, dname, resource) < 0)
|
||||||
/* doPeer2PeerMigrate already set the error, so just get out */
|
/* doPeer2PeerMigrate already set the error, so just get out */
|
||||||
goto endjob;
|
goto endjob;
|
||||||
} else {
|
} else {
|
||||||
|
@ -34,6 +34,7 @@ int qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr
|
|||||||
|
|
||||||
char *qemuMigrationBegin(struct qemud_driver *driver,
|
char *qemuMigrationBegin(struct qemud_driver *driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
|
const char *xmlin,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
int *cookieoutlen);
|
int *cookieoutlen);
|
||||||
|
|
||||||
@ -61,6 +62,7 @@ int qemuMigrationPrepareDirect(struct qemud_driver *driver,
|
|||||||
int qemuMigrationPerform(struct qemud_driver *driver,
|
int qemuMigrationPerform(struct qemud_driver *driver,
|
||||||
virConnectPtr conn,
|
virConnectPtr conn,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
|
const char *xmlin,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
|
@ -4982,6 +4982,7 @@ done:
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
remoteDomainMigrateBegin3(virDomainPtr domain,
|
remoteDomainMigrateBegin3(virDomainPtr domain,
|
||||||
|
const char *xmlin,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
int *cookieoutlen,
|
int *cookieoutlen,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
@ -4999,6 +5000,7 @@ remoteDomainMigrateBegin3(virDomainPtr domain,
|
|||||||
memset(&ret, 0, sizeof(ret));
|
memset(&ret, 0, sizeof(ret));
|
||||||
|
|
||||||
make_nonnull_domain (&args.dom, domain);
|
make_nonnull_domain (&args.dom, domain);
|
||||||
|
args.xmlin = xmlin == NULL ? NULL : (char **) &xmlin;
|
||||||
args.flags = flags;
|
args.flags = flags;
|
||||||
args.dname = dname == NULL ? NULL : (char **) &dname;
|
args.dname = dname == NULL ? NULL : (char **) &dname;
|
||||||
args.resource = resource;
|
args.resource = resource;
|
||||||
@ -5167,6 +5169,7 @@ error:
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
remoteDomainMigratePerform3(virDomainPtr dom,
|
remoteDomainMigratePerform3(virDomainPtr dom,
|
||||||
|
const char *xmlin,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
@ -5188,6 +5191,7 @@ remoteDomainMigratePerform3(virDomainPtr dom,
|
|||||||
|
|
||||||
make_nonnull_domain(&args.dom, dom);
|
make_nonnull_domain(&args.dom, dom);
|
||||||
|
|
||||||
|
args.xmlin = xmlin == NULL ? NULL : (char **) &xmlin;
|
||||||
args.cookie_in.cookie_in_val = (char *)cookiein;
|
args.cookie_in.cookie_in_val = (char *)cookiein;
|
||||||
args.cookie_in.cookie_in_len = cookieinlen;
|
args.cookie_in.cookie_in_len = cookieinlen;
|
||||||
args.uri = (char *) uri;
|
args.uri = (char *) uri;
|
||||||
|
@ -1973,6 +1973,7 @@ struct remote_domain_get_state_ret {
|
|||||||
|
|
||||||
struct remote_domain_migrate_begin3_args {
|
struct remote_domain_migrate_begin3_args {
|
||||||
remote_nonnull_domain dom;
|
remote_nonnull_domain dom;
|
||||||
|
remote_string xmlin;
|
||||||
unsigned hyper flags;
|
unsigned hyper flags;
|
||||||
remote_string dname;
|
remote_string dname;
|
||||||
unsigned hyper resource;
|
unsigned hyper resource;
|
||||||
@ -2011,6 +2012,7 @@ struct remote_domain_migrate_prepare_tunnel3_ret {
|
|||||||
|
|
||||||
struct remote_domain_migrate_perform3_args {
|
struct remote_domain_migrate_perform3_args {
|
||||||
remote_nonnull_domain dom;
|
remote_nonnull_domain dom;
|
||||||
|
remote_string xmlin;
|
||||||
opaque cookie_in<REMOTE_MIGRATE_COOKIE_MAX>;
|
opaque cookie_in<REMOTE_MIGRATE_COOKIE_MAX>;
|
||||||
remote_nonnull_string uri;
|
remote_nonnull_string uri;
|
||||||
unsigned hyper flags;
|
unsigned hyper flags;
|
||||||
|
@ -1457,6 +1457,7 @@ struct remote_domain_get_state_ret {
|
|||||||
};
|
};
|
||||||
struct remote_domain_migrate_begin3_args {
|
struct remote_domain_migrate_begin3_args {
|
||||||
remote_nonnull_domain dom;
|
remote_nonnull_domain dom;
|
||||||
|
remote_string xmlin;
|
||||||
uint64_t flags;
|
uint64_t flags;
|
||||||
remote_string dname;
|
remote_string dname;
|
||||||
uint64_t resource;
|
uint64_t resource;
|
||||||
@ -1504,6 +1505,7 @@ struct remote_domain_migrate_prepare_tunnel3_ret {
|
|||||||
};
|
};
|
||||||
struct remote_domain_migrate_perform3_args {
|
struct remote_domain_migrate_perform3_args {
|
||||||
remote_nonnull_domain dom;
|
remote_nonnull_domain dom;
|
||||||
|
remote_string xmlin;
|
||||||
struct {
|
struct {
|
||||||
u_int cookie_in_len;
|
u_int cookie_in_len;
|
||||||
char * cookie_in_val;
|
char * cookie_in_val;
|
||||||
|
Loading…
Reference in New Issue
Block a user