[libvirt] [PATCH] correct typo: s/VIR_MIGRATE_TUNNELLED/VIR_MIGRATE_TUNNELED/, ...

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@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

On Tue, May 18, 2010 at 06:30:34PM +0200, Jim Meyering wrote:
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.)
I don't think we should make this kind of change. It has no functional gain for app developers, but adds the downside that anyone using this new symbol has needlessly made their code incompatible with libvirt 0.7.5, 0.8.0, 0.8.1, etc, etc Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Tue, May 18, 2010 at 06:30:34PM +0200, Jim Meyering wrote:
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.)
I don't think we should make this kind of change. It has no functional gain for app developers, but adds the downside that anyone using this new symbol has needlessly made their code incompatible with libvirt 0.7.5, 0.8.0, 0.8.1, etc, etc
There are plenty of new features that people will be using that will render their code incompatible with previous releases. However, if you insist, let's at least mark it as a known error so that searches for the properly spelled symbol will turn up the misspelled one:
From 8ae4cc7d25efaab531f5045940c13ec3bb36497f Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 18 May 2010 19:13:20 +0200 Subject: [PATCH] note a typo: VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED,
so that searches for properly spelled "TUNNELED" will turn up the misspelled symbol name. * include/libvirt/libvirt.h.in: Add a comment. --- include/libvirt/libvirt.h.in | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 838028d..5cb23b3 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,6 +407,8 @@ typedef enum { typedef enum { VIR_MIGRATE_LIVE = (1 << 0), /* live migration */ VIR_MIGRATE_PEER2PEER = (1 << 1), /* direct source -> dest host control channel */ + /* note the spelling error that we're stuck with: + VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED */ VIR_MIGRATE_TUNNELLED = (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 */ -- 1.7.1.250.g7d1e8

On 05/18/2010 01:15 PM, Jim Meyering wrote:
Daniel P. Berrange wrote:
On Tue, May 18, 2010 at 06:30:34PM +0200, Jim Meyering wrote:
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.)
I don't think we should make this kind of change. It has no functional gain for app developers, but adds the downside that anyone using this new symbol has needlessly made their code incompatible with libvirt 0.7.5, 0.8.0, 0.8.1, etc, etc
There are plenty of new features that people will be using that will render their code incompatible with previous releases.
However, if you insist, let's at least mark it as a known error so that searches for the properly spelled symbol will turn up the misspelled one:
From 8ae4cc7d25efaab531f5045940c13ec3bb36497f Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 18 May 2010 19:13:20 +0200 Subject: [PATCH] note a typo: VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED,
so that searches for properly spelled "TUNNELED" will turn up the misspelled symbol name. * include/libvirt/libvirt.h.in: Add a comment. --- include/libvirt/libvirt.h.in | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 838028d..5cb23b3 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,6 +407,8 @@ typedef enum { typedef enum { VIR_MIGRATE_LIVE = (1 << 0), /* live migration */ VIR_MIGRATE_PEER2PEER = (1 << 1), /* direct source -> dest host control channel */ + /* note the spelling error that we're stuck with: + VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED */
TUNNELLED is not wrong: http://www.thefreedictionary.com/tunnelled It's an acceptable alternate spelling. -- Chris Lalancette

Chris Lalancette wrote:
On 05/18/2010 01:15 PM, Jim Meyering wrote:
Daniel P. Berrange wrote:
On Tue, May 18, 2010 at 06:30:34PM +0200, Jim Meyering wrote:
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.)
I don't think we should make this kind of change. It has no functional gain for app developers, but adds the downside that anyone using this new symbol has needlessly made their code incompatible with libvirt 0.7.5, 0.8.0, 0.8.1, etc, etc
There are plenty of new features that people will be using that will render their code incompatible with previous releases.
However, if you insist, let's at least mark it as a known error so that searches for the properly spelled symbol will turn up the misspelled one:
From 8ae4cc7d25efaab531f5045940c13ec3bb36497f Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 18 May 2010 19:13:20 +0200 Subject: [PATCH] note a typo: VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED,
so that searches for properly spelled "TUNNELED" will turn up the misspelled symbol name. * include/libvirt/libvirt.h.in: Add a comment. ... + /* note the spelling error that we're stuck with: + VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED */
TUNNELLED is not wrong:
http://www.thefreedictionary.com/tunnelled
It's an acceptable alternate spelling.
"tunnelled" is not acceptable to spelling checkers (spell, aspell, hunspell). It is by far the less-common of those two spellings, so libvirt should avoid using it. Adding the shim of a comment is the least we can do. I've adjusted the comment and the log not to call it an "error" and pushed this:
From 8a8c257bf0601eba64f285c33ce70055e72b4d44 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 18 May 2010 19:13:20 +0200 Subject: [PATCH] note a typo: VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED,
so that searches for properly spelled "TUNNELED" turn up the less common spelling. * include/libvirt/libvirt.h.in: Add a comment. --- include/libvirt/libvirt.h.in | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 838028d..1ff7df0 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,6 +407,8 @@ typedef enum { typedef enum { VIR_MIGRATE_LIVE = (1 << 0), /* live migration */ VIR_MIGRATE_PEER2PEER = (1 << 1), /* direct source -> dest host control channel */ + /* Note the less-common spelling that we're stuck with: + VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED */ VIR_MIGRATE_TUNNELLED = (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 */ -- 1.7.1.250.g7d1e8
participants (3)
-
Chris Lalancette
-
Daniel P. Berrange
-
Jim Meyering