[libvirt PATCH 0/2] Fix some typos and spelling mistakes

Found by codespell [1]. It would be nice to automate this, but I could not get codespell to also check code comments, and ran into a known issue [2] with codespell that prevents putting some terms with mixed letter cases on the skip list. [1] https://github.com/codespell-project/codespell [2] https://github.com/codespell-project/codespell/issues/1860 Tim Wiederhake (2): Fix spelling virlog: Remove stray "todo" in comment NEWS.rst | 12 ++++++------ docs/formatdomain.rst | 6 +++--- docs/glib-adoption.rst | 2 +- docs/kbase/launch_security_sev.rst | 2 +- docs/manpages/virtproxyd.rst | 2 +- docs/pci-addresses.rst | 2 +- src/hyperv/hyperv_wmi.c | 2 +- src/libvirt-domain.c | 2 +- src/libxl/libxl_logger.c | 2 +- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_domain.c | 4 ++-- src/qemu/qemu_domain.h | 4 ++-- src/qemu/qemu_interface.c | 2 +- src/qemu/qemu_snapshot.c | 4 ++-- src/util/virerror.c | 3 ++- src/util/virhash.c | 2 +- src/util/virlog.c | 2 +- src/util/virnetdev.c | 2 +- src/util/virpci.c | 2 +- src/util/virpci.h | 2 +- tests/meson.build | 2 +- tools/meson.build | 2 +- 23 files changed, 34 insertions(+), 33 deletions(-) -- 2.26.2

Signed-off-by: Tim Wiederhake <twiederh@redhat.com> --- NEWS.rst | 12 ++++++------ docs/formatdomain.rst | 6 +++--- docs/glib-adoption.rst | 2 +- docs/kbase/launch_security_sev.rst | 2 +- docs/manpages/virtproxyd.rst | 2 +- docs/pci-addresses.rst | 2 +- src/hyperv/hyperv_wmi.c | 2 +- src/libvirt-domain.c | 2 +- src/libxl/libxl_logger.c | 2 +- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_domain.c | 4 ++-- src/qemu/qemu_domain.h | 4 ++-- src/qemu/qemu_interface.c | 2 +- src/qemu/qemu_snapshot.c | 4 ++-- src/util/virerror.c | 3 ++- src/util/virhash.c | 2 +- src/util/virnetdev.c | 2 +- src/util/virpci.c | 2 +- src/util/virpci.h | 2 +- tests/meson.build | 2 +- tools/meson.build | 2 +- 22 files changed, 33 insertions(+), 32 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 0a34798483..488e4a63a1 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -221,7 +221,7 @@ v7.0.0 (2021-01-15) Starting from libvirt-6.6 the release tarballs are signed by Jiří Denemark. Releases starting with 7.0 contain a note from the previous maintainer - Daniel Veillard offically handing over the signing of packages so that the + Daniel Veillard officially handing over the signing of packages so that the transition can be verified. * **New features** @@ -268,7 +268,7 @@ v7.0.0 (2021-01-15) interface name was adapted to new versions of OpenVSwitch and thus can detect name more reliably. - * qemu: Report guest disks informations in ``virDomainGetGuestInfo`` + * qemu: Report guest disks information in ``virDomainGetGuestInfo`` Libvirt is now able to report disks and filesystems from the guest's perspective (using guest agent). And with sufficiently new guest agent @@ -513,7 +513,7 @@ v6.8.0 (2020-10-01) * qemu: Preserve qcow2 cluster size after external snapshots The new overlay image which is installed on top of the current chain when - taking an external snapshot now preserves the cluser size of the original + taking an external snapshot now preserves the cluster size of the original top image to preserve any performance tuning done on the original image. * **Bug fixes** @@ -1900,7 +1900,7 @@ v5.3.0 (2019-05-04) * virsh: various completers fixes - There were some possible crashers, memory leaks, etc. which are now fixed. + There were some possible crashes, memory leaks, etc. which are now fixed. * qemu: Make hugepages work with memfd backend @@ -2487,8 +2487,8 @@ v4.6.0 (2018-08-06) * qemu: Enable VNC console for mediated devices - Host devices now support a new atribute 'display' which can be used to turn - on frame buffer rendering on a vgpu mediated device instead of on an + Host devices now support a new attribute 'display' which can be used to + turn on frame buffer rendering on a vgpu mediated device instead of on an emulated GPU, like QXL. * **Improvements** diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 29d2e02da1..d2344c894a 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6921,7 +6921,7 @@ elements * ``fixedSettings`` Control whether the mixing engine can dynamically choose settings - to mimimize format conversion. This is only valid when the + to minimize format conversion. This is only valid when the mixing engine is explicitly enabled. * ``voices`` @@ -6951,7 +6951,7 @@ is permitted with the following attributes. * ``format`` The audio format, one of ``s8``, ``u8``, ``s16``, ``u16``, - ``s32``, ``u32``, ``f32``. The defalt is hypervisor specific. + ``s32``, ``u32``, ``f32``. The default is hypervisor specific. None audio backend ^^^^^^^^^^^^^^^^^^ @@ -7064,7 +7064,7 @@ element Set the timing policy of the device, values between -1 and 10. Smaller numbers result in lower latency but higher CPU usage. - A negatve value requests use of fragment mode. + A negative value requests use of fragment mode. The following additional attributes are permitted on the ``<input>`` and ``<output>`` elements diff --git a/docs/glib-adoption.rst b/docs/glib-adoption.rst index f969ac80a1..c2cec80eea 100644 --- a/docs/glib-adoption.rst +++ b/docs/glib-adoption.rst @@ -32,7 +32,7 @@ Array operations https://developer.gnome.org/glib/stable/glib-Arrays.html - Instead of using plain C arrays, it is preferrable to use one of + Instead of using plain C arrays, it is preferable to use one of the GLib types, ``GArray``, ``GPtrArray`` or ``GByteArray``. These all use a struct to track the array memory and size together and efficiently resize. diff --git a/docs/kbase/launch_security_sev.rst b/docs/kbase/launch_security_sev.rst index e65dcd6824..edd819ad5a 100644 --- a/docs/kbase/launch_security_sev.rst +++ b/docs/kbase/launch_security_sev.rst @@ -85,7 +85,7 @@ kernel: Checking SEV support in the virt stack ====================================== -**Note: All of the commands bellow need to be run with root +**Note: All of the commands below need to be run with root privileges.** First make sure you have the following packages in the specified diff --git a/docs/manpages/virtproxyd.rst b/docs/manpages/virtproxyd.rst index 86ece28980..0366935b9a 100644 --- a/docs/manpages/virtproxyd.rst +++ b/docs/manpages/virtproxyd.rst @@ -43,7 +43,7 @@ configuration file can be used to instruct it to also listen on TCP socket(s). Systemd socket activation is also supported to allow it to receive pre-opened listener sockets on startup. -Since ``virtproxyd`` merely forwards RPC mesages, it has no important state, +Since ``virtproxyd`` merely forwards RPC messages, it has no important state, and can be restarted at any time. Clients should expect to reconnect after the restart. diff --git a/docs/pci-addresses.rst b/docs/pci-addresses.rst index d7292f499d..eb4945f169 100644 --- a/docs/pci-addresses.rst +++ b/docs/pci-addresses.rst @@ -242,7 +242,7 @@ Reserved addresses Due to some historical reasons hypervisors might expect some PCI devices to appear at certain addresses instead of 'random' ones. -For QEMU this is machine type and guest architecture dependant. +For QEMU this is machine type and guest architecture dependent. But to give you at least a gist here is list of reserved PCI addresses: diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 6271e85cc6..00c250e364 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -331,7 +331,7 @@ hypervSetEmbeddedProperty(GHashTable *table, * Add a GHashTable containing object properties as an embedded param to * an invocation list. * - * Upon successfull return the @table is consumed and the pointer is cleared out. + * Upon successful return the @table is consumed and the pointer is cleared out. * * Returns -1 on failure, 0 on success. */ diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 83ff7df9fe..bd219dda7e 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -13136,7 +13136,7 @@ virDomainAuthorizedSSHKeysSet(virDomainPtr domain, * virDomainMessageType constants can be used to restrict * results to certain types of message. * - * Note it is hypervisor dependant whether messages are + * Note it is hypervisor dependent whether messages are * available for shutoff guests, or running guests, or * both. Thus a client should be prepared to re-fetch * messages when a guest transitions between running diff --git a/src/libxl/libxl_logger.c b/src/libxl/libxl_logger.c index 1da3357c6d..a0e4dd40c3 100644 --- a/src/libxl/libxl_logger.c +++ b/src/libxl/libxl_logger.c @@ -117,7 +117,7 @@ libvirt_progress(xentoollog_logger *logger_in G_GNUC_UNUSED, unsigned long done G_GNUC_UNUSED, unsigned long total G_GNUC_UNUSED) { - /* This function purposedly does nothing: it's no logging info */ + /* This function purposely does nothing: it's no logging info */ } static void diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ba1432c7e3..dd1b6bf3e3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1337,7 +1337,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { /* * We don't probe 'esp' directly, because it is often reported * as present for all QEMU binaries, due to it being enabled - * for built as a dependancy of dc390/am53c974 PCI SCSI + * for built as a dependency of dc390/am53c974 PCI SCSI * controllers. * * The base 'esp' device is only used as a built-in device diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 45eb0dc976..a7c23c9ff1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3254,7 +3254,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, * idea). This is because of create_default_memdev() in QEMU sets * 'x-use-canonical-path-for-ramblock-id' attribute to false and is * documented in QEMU in qemu-options.hx under 'memory-backend'. Note - * that QEMU consideres 'x-use-canonical-path-for-ramblock-id' stable + * that QEMU considers 'x-use-canonical-path-for-ramblock-id' stable * and supported despite the 'x-' prefix. * See QEMU commit 8db0b20415c129cf5e577a593a4a0372d90b7cc9. */ diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c3d85209bb..b431e64f7d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4885,13 +4885,13 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src, if (src->metadataCacheMaxSize > 0) { if (src->format != VIR_STORAGE_FILE_QCOW2) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("metdata cache max size control is supported only with qcow2 images")); + _("metadata cache max size control is supported only with qcow2 images")); return -1; } if (!blockdev) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("metdata cache max size control is not supported with this QEMU binary")); + _("metadata cache max size control is not supported with this QEMU binary")); return -1; } } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 1c80b8cfaa..0526f7fc9f 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -265,7 +265,7 @@ struct _qemuDomainObjPrivate { bool dbusVMState; /* prevent deletion of <transient> disk overlay files between startup and - * succesful setup of the overlays */ + * successful setup of the overlays */ bool inhibitDiskTransientDelete; }; @@ -486,7 +486,7 @@ struct _qemuDomainXmlNsDef { size_t ncapsdel; char **capsdel; - /* We deliberatly keep this as a string so that it's parsed only when + /* We deliberately keep this as a string so that it's parsed only when * starting the VM to avoid any form of errors in the parser or when * changing qemu versions. The knob is mainly for development/CI purposes */ char *deprecationBehavior; diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index be2f53945c..33d2388a00 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -652,7 +652,7 @@ qemuInterfaceVDPAConnect(virDomainNetDefPtr net) /* - * Returns: -1 on error, 0 if slirp isn't available, 1 on succcess + * Returns: -1 on error, 0 if slirp isn't available, 1 on success */ int qemuInterfacePrepareSlirp(virQEMUDriverPtr driver, diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 93b74b035a..b5a0d9ae30 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -726,13 +726,13 @@ qemuSnapshotPrepare(virDomainObjPtr vm, if (disk->src->metadataCacheMaxSize > 0) { if (disk->src->format != VIR_STORAGE_FILE_QCOW2) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("metdata cache max size control is supported only with qcow2 images")); + _("metadata cache max size control is supported only with qcow2 images")); return -1; } if (!blockdev) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("metdata cache max size control is not supported with this QEMU binary")); + _("metadata cache max size control is not supported with this QEMU binary")); return -1; } } diff --git a/src/util/virerror.c b/src/util/virerror.c index 220fc362c1..1746487f7d 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -804,7 +804,8 @@ virRaiseErrorInternal(const char *filename, if (!msg) msg = g_strdup(_("No error message provided")); - /* Deliberately not setting conn, dom & net fields sincethey're utterly unsafe. */ + /* Deliberately not setting conn, dom & net fields since + * they are utterly unsafe. */ to->domain = domain; to->code = code; to->message = g_steal_pointer(&msg); diff --git a/src/util/virhash.c b/src/util/virhash.c index 5d5b6389b5..f2490bfb8b 100644 --- a/src/util/virhash.c +++ b/src/util/virhash.c @@ -51,7 +51,7 @@ VIR_ONCE_GLOBAL_INIT(virHashAtomic); /** - * Our hash function uses a random seed to provide uncertainity from run to run + * Our hash function uses a random seed to provide uncertainty from run to run * to prevent pre-crafting of colliding hash keys. */ static uint32_t virHashTableSeed; diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 90d583ad96..6d88b5f9ae 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1709,7 +1709,7 @@ virNetDevSetVfConfig(const char *ifname, int vf, /** * virNetDevParseVfInfo: - * Get the VF interface infomation from kernel by netlink, To make netlink + * Get the VF interface information from kernel by netlink, To make netlink * parsing logic easy to maintain, extending this function to get some new * data is better than add a new function. */ diff --git a/src/util/virpci.c b/src/util/virpci.c index 5da74d5e9f..1a333014d3 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -360,7 +360,7 @@ virPCIDeviceRead(virPCIDevicePtr dev, * function. * * Returns the value at @pos in the file, or 0 if there was an - * error. NB: since 0 could be a valid value, occurence of an error + * error. NB: since 0 could be a valid value, occurrence of an error * must be determined by examining errno. errno is always reset to 0 * before the seek/read is attempted (see virPCIDeviceRead()), so if * errno != 0 on return from one of these functions, then either the diff --git a/src/util/virpci.h b/src/util/virpci.h index 9b37a12883..40ac7303e2 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -56,7 +56,7 @@ struct _virZPCIDeviceAddress { #define VIR_PCI_DEVICE_ADDRESS_FMT "%04x:%02x:%02x.%d" /* Represents format of PF's phys_port_name in switchdev mode: - * 'p%u' or 'p%us%u'. New line checked since value is readed from sysfs file. + * 'p%u' or 'p%us%u'. New line checked since value is read from sysfs file. */ #define VIR_PF_PHYS_PORT_NAME_REGEX "(p[0-9]+$)|(p[0-9]+s[0-9]+$)" diff --git a/tests/meson.build b/tests/meson.build index b9b2255666..3f66861332 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -599,7 +599,7 @@ helpers = [] if conf.has('WITH_NSS') helpers += [ - # Intentionaly not linking with anything else. + # Intentionally not linking with anything else. # See the test source for more detailed explanation. { 'name': 'nsslinktest', diff --git a/tools/meson.build b/tools/meson.build index 42dc609439..2acf7b0aaf 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -81,7 +81,7 @@ endif if conf.has('WITH_LOGIN_SHELL') # virt-login-shell will be setuid, and must not link to anything - # except glibc. It wil scrub the environment and then invoke the + # except glibc. It will scrub the environment and then invoke the # real virt-login-shell-helper binary. executable( 'virt-login-shell', -- 2.26.2

On a Wednesday in 2021, Tim Wiederhake wrote:
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> --- NEWS.rst | 12 ++++++------ docs/formatdomain.rst | 6 +++--- docs/glib-adoption.rst | 2 +- docs/kbase/launch_security_sev.rst | 2 +- docs/manpages/virtproxyd.rst | 2 +- docs/pci-addresses.rst | 2 +- src/hyperv/hyperv_wmi.c | 2 +- src/libvirt-domain.c | 2 +- src/libxl/libxl_logger.c | 2 +- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_domain.c | 4 ++-- src/qemu/qemu_domain.h | 4 ++-- src/qemu/qemu_interface.c | 2 +- src/qemu/qemu_snapshot.c | 4 ++-- src/util/virerror.c | 3 ++- src/util/virhash.c | 2 +- src/util/virnetdev.c | 2 +- src/util/virpci.c | 2 +- src/util/virpci.h | 2 +- tests/meson.build | 2 +- tools/meson.build | 2 +- 22 files changed, 33 insertions(+), 32 deletions(-)
diff --git a/NEWS.rst b/NEWS.rst index 0a34798483..488e4a63a1 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1900,7 +1900,7 @@ v5.3.0 (2019-05-04)
* virsh: various completers fixes
- There were some possible crashers, memory leaks, etc. which are now fixed. + There were some possible crashes, memory leaks, etc. which are now fixed.
I believe 'crasher' here was intentional, as in: a bug that causes a crash.
* qemu: Make hugepages work with memfd backend
diff --git a/docs/glib-adoption.rst b/docs/glib-adoption.rst index f969ac80a1..c2cec80eea 100644 --- a/docs/glib-adoption.rst +++ b/docs/glib-adoption.rst @@ -32,7 +32,7 @@ Array operations
https://developer.gnome.org/glib/stable/glib-Arrays.html
- Instead of using plain C arrays, it is preferrable to use one of + Instead of using plain C arrays, it is preferable to use one of
Collins Dictionary lists 'preferrable' as a less used alternative: https://www.collinsdictionary.com/dictionary/english/preferrable so I would not call the original wrong either.
the GLib types, ``GArray``, ``GPtrArray`` or ``GByteArray``. These all use a struct to track the array memory and size together and efficiently resize. diff --git a/src/libxl/libxl_logger.c b/src/libxl/libxl_logger.c index 1da3357c6d..a0e4dd40c3 100644 --- a/src/libxl/libxl_logger.c +++ b/src/libxl/libxl_logger.c @@ -117,7 +117,7 @@ libvirt_progress(xentoollog_logger *logger_in G_GNUC_UNUSED, unsigned long done G_GNUC_UNUSED, unsigned long total G_GNUC_UNUSED) { - /* This function purposedly does nothing: it's no logging info */ + /* This function purposely does nothing: it's no logging info */
purposedly also looks like a valid word: https://www.merriam-webster.com/dictionary/purposedly
}
static void
To the rest: Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Signed-off-by: Tim Wiederhake <twiederh@redhat.com> --- src/util/virlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index 7778724d58..73a2d6734f 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -1315,7 +1315,7 @@ virLogFilterNew(const char *match, ret->priority = priority; /* We must treat 'foo' as equiv to '*foo*' for g_pattern_match - * todo substring matches, so add 2 extra bytes + * substring matches, so add 2 extra bytes */ ret->match = g_new0(char, mlen + 3); ret->match[0] = '*'; -- 2.26.2

On a Wednesday in 2021, Tim Wiederhake wrote:
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> ---
Fixes: 8fe30b2167b5b56461b11dbf02aca83030070caf
src/util/virlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virlog.c b/src/util/virlog.c index 7778724d58..73a2d6734f 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -1315,7 +1315,7 @@ virLogFilterNew(const char *match, ret->priority = priority;
/* We must treat 'foo' as equiv to '*foo*' for g_pattern_match - * todo substring matches, so add 2 extra bytes + * substring matches, so add 2 extra bytes */ ret->match = g_new0(char, mlen + 3); ret->match[0] = '*';
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

On a Wednesday in 2021, Tim Wiederhake wrote:
Found by codespell [1].
It would be nice to automate this, but I could not get codespell to also check code comments,
You can automate the spellchecking, but sometimes typos are included in sentences that should be rewritten completely - you cannot (yet?) automatically check for that. Also, checking comments outside of public APIs is not that important - the code will usually be harder to read than the comment with a typo.
and ran into a known issue [2] with codespell that prevents putting some terms with mixed letter cases on the skip list.
With false positives and no way to silence the warnings, I'm afraid the automation would not be useful. Jano
[1] https://github.com/codespell-project/codespell [2] https://github.com/codespell-project/codespell/issues/1860
Tim Wiederhake (2): Fix spelling virlog: Remove stray "todo" in comment
participants (2)
-
Ján Tomko
-
Tim Wiederhake