]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Clarify semantics of virDomainMigrate{,ToURI}2
authorJiri Denemark <jdenemar@redhat.com>
Mon, 16 Jan 2012 09:24:42 +0000 (10:24 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 17 Jan 2012 09:31:24 +0000 (10:31 +0100)
Commit 5d784bd6d7b19314b0908aec6b46bfe377aeba42 was a nice attempt to
clarify the semantics by requiring domain name from dxml to either match
original name or dname. However, setting dxml domain name to dname
doesn't really work since destination host needs to know the original
domain name to be able to use it in migration cookies. This patch
requires domain name in dxml to match the original domain name. The
change should be safe and backward compatible since migration would fail
just a bit later in the process.

src/libvirt.c
src/qemu/qemu_migration.c

index a540424837800762d5232ce0cbcadd45b23dbb25..7b8adf7f184b2f4a890d4e898ade43ba9337d180 100644 (file)
@@ -5188,8 +5188,8 @@ error:
  * if @dxml would cause any guest-visible changes.  Pass NULL
  * if no changes are needed to the XML between source and destination.
  * @dxml cannot be used to rename the domain during migration (use
- * @dname for that purpose).  Domain name in @dxml must either match the
- * original domain name or @dname if it was specified.
+ * @dname for that purpose).  Domain name in @dxml must match the
+ * original domain name.
  *
  * Returns the new domain object if the migration was successful,
  *   or NULL in case of error.  Note that the new domain object
index 92d60081c541907ef900528e15ca34427504df1c..8453a47072de9c6e39cc2e2eced7e77e9b72b617 100644 (file)
@@ -1046,11 +1046,9 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
                                             VIR_DOMAIN_XML_INACTIVE)))
             goto cleanup;
 
-        if (STRNEQ(def->name, vm->def->name) &&
-            STRNEQ_NULLABLE(def->name, dname)) {
+        if (STRNEQ(def->name, vm->def->name)) {
             qemuReportError(VIR_ERR_INVALID_ARG, "%s",
-                            _("target domain name doesn't match source name"
-                              " nor destination name"));
+                            _("target domain name doesn't match source name"));
             goto cleanup;
         }