virDomainPtr ddomain = NULL;
char *uri_out = NULL;
char *cookie = NULL;
- int cookielen = 0;
+ int cookielen = 0, ret;
+ virDomainInfo info;
+
+ ret = virDomainGetInfo (domain, &info);
+ if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) {
+ flags |= VIR_MIGRATE_PAUSED;
+ }
/* Prepare the migration.
*
char *cookie = NULL;
char *dom_xml = NULL;
int cookielen = 0, ret;
+ virDomainInfo info;
/* Prepare the migration.
*
if (!dom_xml)
return NULL;
+ ret = virDomainGetInfo (domain, &info);
+ if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) {
+ flags |= VIR_MIGRATE_PAUSED;
+ }
+
ret = dconn->driver->domainMigratePrepare2
(dconn, &cookie, &cookielen, uri, &uri_out, flags, dname,
bandwidth, dom_xml);
if (flags & VIR_MIGRATE_PERSIST_DEST)
flags &= ~VIR_MIGRATE_PERSIST_DEST;
+ /* This is buggy in Xend, but could be supported in principle. Give
+ * a nice error message.
+ */
+ if (flags & VIR_MIGRATE_PAUSED) {
+ virXendError (conn, VIR_ERR_NO_SUPPORT,
+ "%s", _("xenDaemonDomainMigrate: xend cannot migrate paused domains"));
+ return -1;
+ }
+
/* XXX we could easily do tunnelled & peer2peer migration too
if we want to. support these... */
if (flags != 0) {