[libvirt] [PATCH] Clarify semantics of virDomainMigrate{,ToURI}2

Jiri Denemark jdenemar at redhat.com
Mon Jan 16 10:19:44 UTC 2012


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             |    4 ++--
 src/qemu/qemu_migration.c |    6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index a540424..7b8adf7 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -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
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 92d6008..8453a47 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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;
         }
 
-- 
1.7.8.3




More information about the libvir-list mailing list