I noticed a typo in a public interface.
IMHO it's well worth fixing, so propose this:
(imagine someone searching for all occurrences of "tunneled"
with the proper spelling. They would miss this symbol.)
From b9a1ea6c9e3d4e5150c39868b430f184c10b2660 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 18 May 2010 18:28:17 +0200
Subject: [PATCH] correct typo: s/VIR_MIGRATE_TUNNELLED/VIR_MIGRATE_TUNNELED/, ...
in public interface, but retain the original name for compatibility
Correct all uses.
* include/libvirt/libvirt.h.in [enum virDomainMigrateFlags]
(VIR_MIGRATE_TUNNELED): Rename from spelling-error VIR_MIGRATE_TUNNELLED.
(VIR_MIGRATE_TUNNELLED): Define, to map misspelled name to the new name.
* src/libvirt.c (virDomainMigrate): Use correct spelling.
* src/qemu/qemu_driver.c: Likewise.
* tools/virsh.c (cmdMigrate): Likewise.
---
include/libvirt/libvirt.h.in | 7 +++++--
src/libvirt.c | 10 +++++-----
src/qemu/qemu_driver.c | 10 +++++-----
tools/virsh.c | 2 +-
4 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 838028d..6e8e52e 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -4,7 +4,7 @@
* Description: Provides the interfaces of the libvirt library to handle
* virtualized domains
*
- * Copy: Copyright (C) 2005,2006 Red Hat, Inc.
+ * Copy: Copyright (C) 2005,2006,2010 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
@@ -407,7 +407,7 @@ typedef enum {
typedef enum {
VIR_MIGRATE_LIVE = (1 << 0), /* live migration */
VIR_MIGRATE_PEER2PEER = (1 << 1), /* direct source -> dest host
control channel */
- VIR_MIGRATE_TUNNELLED = (1 << 2), /* tunnel migration data over
libvirtd connection */
+ VIR_MIGRATE_TUNNELED = (1 << 2), /* tunnel migration data over
libvirtd connection */
VIR_MIGRATE_PERSIST_DEST = (1 << 3), /* persist the VM on the destination
*/
VIR_MIGRATE_UNDEFINE_SOURCE = (1 << 4), /* undefine the VM on the source */
VIR_MIGRATE_PAUSED = (1 << 5), /* pause on remote side */
@@ -417,6 +417,9 @@ typedef enum {
} virDomainMigrateFlags;
+/* Legacy typo. */
+#define VIR_MIGRATE_TUNNELLED VIR_MIGRATE_TUNNELED
+
/* Domain migration. */
virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn,
unsigned long flags, const char *dname,
diff --git a/src/libvirt.c b/src/libvirt.c
index eb05337..c10db19 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -3421,14 +3421,14 @@ virDomainMigrateDirect (virDomainPtr domain,
* Flags may be one of more of the following:
* VIR_MIGRATE_LIVE Do not pause the VM during migration
* VIR_MIGRATE_PEER2PEER Direct connection between source & destination hosts
- * VIR_MIGRATE_TUNNELLED Tunnel migration data over the libvirt RPC channel
+ * VIR_MIGRATE_TUNNELED Tunnel migration data over the libvirt RPC channel
* VIR_MIGRATE_PERSIST_DEST If the migration is successful, persist the domain
* on the destination host.
* VIR_MIGRATE_UNDEFINE_SOURCE If the migration is successful, undefine the
* domain on the source host.
* VIR_MIGRATE_PAUSED Leave the domain suspended on the remote side.
*
- * VIR_MIGRATE_TUNNELLED requires that VIR_MIGRATE_PEER2PEER be set.
+ * VIR_MIGRATE_TUNNELED requires that VIR_MIGRATE_PEER2PEER be set.
* Applications using the VIR_MIGRATE_PEER2PEER flag will probably
* prefer to invoke virDomainMigrateToURI, avoiding the need to
* open connection to the destination host themselves.
@@ -3530,7 +3530,7 @@ virDomainMigrate (virDomainPtr domain,
goto error;
}
} else {
- if (flags & VIR_MIGRATE_TUNNELLED) {
+ if (flags & VIR_MIGRATE_TUNNELED) {
virLibConnError(domain->conn, VIR_ERR_OPERATION_INVALID,
_("cannot perform tunnelled migration without using
peer2peer flag"));
goto error;
@@ -3579,7 +3579,7 @@ error:
* Flags may be one of more of the following:
* VIR_MIGRATE_LIVE Do not pause the VM during migration
* VIR_MIGRATE_PEER2PEER Direct connection between source & destination hosts
- * VIR_MIGRATE_TUNNELLED Tunnel migration data over the libvirt RPC channel
+ * VIR_MIGRATE_TUNNELED Tunnel migration data over the libvirt RPC channel
* VIR_MIGRATE_PERSIST_DEST If the migration is successful, persist the domain
* on the destination host.
* VIR_MIGRATE_UNDEFINE_SOURCE If the migration is successful, undefine the
@@ -3598,7 +3598,7 @@ error:
* must be a valid libvirt connection URI, by which the source
* libvirt driver can connect to the destination libvirt.
*
- * VIR_MIGRATE_TUNNELLED requires that VIR_MIGRATE_PEER2PEER be set.
+ * VIR_MIGRATE_TUNNELED requires that VIR_MIGRATE_PEER2PEER be set.
*
* If a hypervisor supports renaming domains during migration,
* the dname parameter specifies the new name for the domain.
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 609fabe..246ad9e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9880,7 +9880,7 @@ qemudDomainMigratePrepareTunnel(virConnectPtr dconn,
"%s", _("no domain XML passed"));
goto cleanup;
}
- if (!(flags & VIR_MIGRATE_TUNNELLED)) {
+ if (!(flags & VIR_MIGRATE_TUNNELED)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("PrepareTunnel called but no TUNNELLED
flag set"));
goto cleanup;
@@ -10038,9 +10038,9 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn,
*uri_out = NULL;
qemuDriverLock(driver);
- if (flags & VIR_MIGRATE_TUNNELLED) {
+ if (flags & VIR_MIGRATE_TUNNELED) {
/* this is a logical error; we never should have gotten here with
- * VIR_MIGRATE_TUNNELLED set
+ * VIR_MIGRATE_TUNNELED set
*/
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Tunnelled migration requested but invalid
RPC method called"));
@@ -10604,7 +10604,7 @@ static int doPeer2PeerMigrate(virDomainPtr dom,
goto cleanup;
}
- if (flags & VIR_MIGRATE_TUNNELLED)
+ if (flags & VIR_MIGRATE_TUNNELED)
ret = doTunnelMigrate(dom, driver, dconn, vm, dom_xml, uri, flags, dname,
resource);
else
ret = doNonTunnelMigrate(dom, driver, dconn, vm, dom_xml, uri, flags, dname,
resource);
@@ -10665,7 +10665,7 @@ qemudDomainMigratePerform (virDomainPtr dom,
goto endjob;
}
- if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
+ if ((flags & (VIR_MIGRATE_TUNNELED | VIR_MIGRATE_PEER2PEER))) {
if (doPeer2PeerMigrate(dom, driver, vm, uri, flags, dname, resource) < 0)
/* doPeer2PeerMigrate already set the error, so just get out */
goto endjob;
diff --git a/tools/virsh.c b/tools/virsh.c
index 4930ad7..9d9cf5d 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2898,7 +2898,7 @@ cmdMigrate (vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptBool (cmd, "p2p"))
flags |= VIR_MIGRATE_PEER2PEER;
if (vshCommandOptBool (cmd, "tunnelled"))
- flags |= VIR_MIGRATE_TUNNELLED;
+ flags |= VIR_MIGRATE_TUNNELED;
if (vshCommandOptBool (cmd, "persistent"))
flags |= VIR_MIGRATE_PERSIST_DEST;
--
1.7.1.250.g7d1e8