[libvirt PATCH 0/4] move virParseVersionString to virstring.c

And clean up some includes while doing it. Ján Tomko (4): maint: add required includes util: virParseVersionString: move to virstring.c virParseVersionString: rename to virStringParseVersion maint: remove unnecessary virutil.h includes src/bhyve/bhyve_driver.c | 2 +- src/ch/ch_conf.c | 2 +- src/esx/esx_vi.c | 9 ++--- src/libvirt_private.syms | 2 +- src/lxc/lxc_driver.c | 2 +- src/nwfilter/nwfilter_ebiptables_driver.c | 6 +-- src/openvz/openvz_conf.c | 3 +- src/util/virdnsmasq.c | 3 +- src/util/virfirewalld.c | 4 +- src/util/virstring.c | 48 +++++++++++++++++++++++ src/util/virstring.h | 4 ++ src/util/virutil.c | 46 ---------------------- src/util/virutil.h | 3 -- src/vbox/vbox_common.c | 2 +- src/vmware/vmware_conf.c | 3 +- src/vz/vz_utils.c | 2 +- tests/testutilsqemu.c | 3 +- tests/utiltest.c | 2 +- tools/virt-host-validate-common.c | 2 +- 19 files changed, 73 insertions(+), 75 deletions(-) -- 2.34.1

Some files do not include what they use and rely on virutil.h to pull in the necessary header files. Fix it. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/nwfilter/nwfilter_ebiptables_driver.c | 1 + src/util/virfirewalld.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 63ba69f794..0c420dd91f 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -22,6 +22,7 @@ #include <config.h> +#include <unistd.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/utsname.h> diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index 4795bf7925..5a0a45f324 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -32,6 +32,7 @@ #include "virlog.h" #include "virgdbus.h" #include "virenum.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_FIREWALLD -- 2.34.1

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/libvirt_private.syms | 2 +- src/util/virstring.c | 47 ++++++++++++++++++++++++++++++++++++++++ src/util/virstring.h | 4 ++++ src/util/virutil.c | 46 --------------------------------------- src/util/virutil.h | 3 --- 5 files changed, 52 insertions(+), 50 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index bc6fa191bf..38506c52c6 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3302,6 +3302,7 @@ virStorageFileParseBackingStoreStr; # util/virstring.h +virParseVersionString; virSkipSpaces; virSkipSpacesAndBackslash; virSkipSpacesBackwards; @@ -3546,7 +3547,6 @@ virMemoryLimitIsSet; virMemoryLimitTruncate; virMemoryMaxValue; virParseOwnershipIds; -virParseVersionString; virPipe; virPipeNonBlock; virPipeQuiet; diff --git a/src/util/virstring.c b/src/util/virstring.c index cee56debca..a7ce566963 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -1019,3 +1019,50 @@ int virStringParseYesNo(const char *str, bool *result) return 0; } + + +/** + * virParseVersionString: + * @str: const char pointer to the version string + * @version: unsigned long pointer to output the version number + * @allowMissing: true to treat 3 like 3.0.0, false to error out on + * missing minor or micro + * + * Parse an unsigned version number from a version string. Expecting + * 'major.minor.micro' format, ignoring an optional suffix. + * + * The major, minor and micro numbers are encoded into a single version number: + * + * 1000000 * major + 1000 * minor + micro + * + * Returns the 0 for success, -1 for error. + */ +int +virParseVersionString(const char *str, unsigned long *version, + bool allowMissing) +{ + unsigned int major, minor = 0, micro = 0; + char *tmp; + + if (virStrToLong_ui(str, &tmp, 10, &major) < 0) + return -1; + + if (!allowMissing && *tmp != '.') + return -1; + + if ((*tmp == '.') && virStrToLong_ui(tmp + 1, &tmp, 10, &minor) < 0) + return -1; + + if (!allowMissing && *tmp != '.') + return -1; + + if ((*tmp == '.') && virStrToLong_ui(tmp + 1, &tmp, 10, µ) < 0) + return -1; + + if (major > UINT_MAX / 1000000 || minor > 999 || micro > 999) + return -1; + + *version = 1000000 * major + 1000 * minor + micro; + + return 0; +} diff --git a/src/util/virstring.h b/src/util/virstring.h index 45f07ddd7a..1dbeb7445f 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -135,3 +135,7 @@ int virStringParsePort(const char *str, int virStringParseYesNo(const char *str, bool *result) G_GNUC_WARN_UNUSED_RESULT; + +int virParseVersionString(const char *str, + unsigned long *version, + bool allowMissing); diff --git a/src/util/virutil.c b/src/util/virutil.c index 8a6efd4d5c..fe5500726e 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -231,52 +231,6 @@ virScaleInteger(unsigned long long *value, const char *suffix, } -/** - * virParseVersionString: - * @str: const char pointer to the version string - * @version: unsigned long pointer to output the version number - * @allowMissing: true to treat 3 like 3.0.0, false to error out on - * missing minor or micro - * - * Parse an unsigned version number from a version string. Expecting - * 'major.minor.micro' format, ignoring an optional suffix. - * - * The major, minor and micro numbers are encoded into a single version number: - * - * 1000000 * major + 1000 * minor + micro - * - * Returns the 0 for success, -1 for error. - */ -int -virParseVersionString(const char *str, unsigned long *version, - bool allowMissing) -{ - unsigned int major, minor = 0, micro = 0; - char *tmp; - - if (virStrToLong_ui(str, &tmp, 10, &major) < 0) - return -1; - - if (!allowMissing && *tmp != '.') - return -1; - - if ((*tmp == '.') && virStrToLong_ui(tmp + 1, &tmp, 10, &minor) < 0) - return -1; - - if (!allowMissing && *tmp != '.') - return -1; - - if ((*tmp == '.') && virStrToLong_ui(tmp + 1, &tmp, 10, µ) < 0) - return -1; - - if (major > UINT_MAX / 1000000 || minor > 999 || micro > 999) - return -1; - - *version = 1000000 * major + 1000 * minor + micro; - - return 0; -} - /** * Format @val as a base-10 decimal number, in the * buffer @buf of size @buflen. To allocate a suitable diff --git a/src/util/virutil.h b/src/util/virutil.h index 6bb55918ad..6adebde242 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -44,9 +44,6 @@ int virScaleInteger(unsigned long long *value, const char *suffix, unsigned long long scale, unsigned long long limit) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virParseVersionString(const char *str, unsigned long *version, - bool allowMissing); - char *virFormatIntDecimal(char *buf, size_t buflen, int val) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -- 2.34.1

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/bhyve/bhyve_driver.c | 2 +- src/ch/ch_conf.c | 2 +- src/esx/esx_vi.c | 8 ++++---- src/libvirt_private.syms | 2 +- src/lxc/lxc_driver.c | 2 +- src/nwfilter/nwfilter_ebiptables_driver.c | 4 ++-- src/openvz/openvz_conf.c | 2 +- src/util/virdnsmasq.c | 2 +- src/util/virfirewalld.c | 2 +- src/util/virstring.c | 7 ++++--- src/util/virstring.h | 4 ++-- src/vbox/vbox_common.c | 2 +- src/vmware/vmware_conf.c | 2 +- src/vz/vz_utils.c | 2 +- tests/testutilsqemu.c | 2 +- tests/utiltest.c | 2 +- tools/virt-host-validate-common.c | 2 +- 17 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index f291f12e50..f85f879abb 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -267,7 +267,7 @@ bhyveConnectGetVersion(virConnectPtr conn, unsigned long *version) uname(&ver); - if (virParseVersionString(ver.release, version, true) < 0) { + if (virStringParseVersion(version, ver.release, true) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown release: %s"), ver.release); return -1; diff --git a/src/ch/ch_conf.c b/src/ch/ch_conf.c index be12934dcd..88a23a59cd 100644 --- a/src/ch/ch_conf.c +++ b/src/ch/ch_conf.c @@ -204,7 +204,7 @@ chExtractVersion(virCHDriver *driver) return -1; } - if (virParseVersionString(tmp, &version, true) < 0) { + if (virStringParseVersion(&version, tmp, true) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unable to parse cloud-hypervisor version: %s"), tmp); return -1; diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 80ed6199e3..bc43fa0af1 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -869,8 +869,8 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url, return -1; } - if (virParseVersionString(ctx->service->about->apiVersion, - &ctx->apiVersion, true) < 0) { + if (virStringParseVersion(&ctx->apiVersion, + ctx->service->about->apiVersion, true) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not parse VI API version '%s'"), ctx->service->about->apiVersion); @@ -884,8 +884,8 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url, return -1; } - if (virParseVersionString(ctx->service->about->version, - &ctx->productVersion, true) < 0) { + if (virStringParseVersion(&ctx->productVersion, + ctx->service->about->version, true) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not parse product version '%s'"), ctx->service->about->version); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 38506c52c6..2d1896a995 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3302,7 +3302,6 @@ virStorageFileParseBackingStoreStr; # util/virstring.h -virParseVersionString; virSkipSpaces; virSkipSpacesAndBackslash; virSkipSpacesBackwards; @@ -3319,6 +3318,7 @@ virStringIsPrintable; virStringMatch; virStringMatchesNameSuffix; virStringParsePort; +virStringParseVersion; virStringParseYesNo; virStringReplace; virStringSearch; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 7bc39120ee..8000871f7a 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1656,7 +1656,7 @@ static int lxcConnectGetVersion(virConnectPtr conn, unsigned long *version) if (virConnectGetVersionEnsureACL(conn) < 0) return -1; - if (virParseVersionString(ver.release, version, true) < 0) { + if (virStringParseVersion(version, ver.release, true) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown release: %s"), ver.release); return -1; } diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 0c420dd91f..058f2ec559 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -3656,7 +3656,7 @@ ebiptablesDriverProbeCtdir(void) } /* following Linux lxr, the logic was inverted in 2.6.39 */ - if (virParseVersionString(utsname.release, &thisversion, true) < 0) { + if (virStringParseVersion(&thisversion, utsname.release, true) < 0) { VIR_ERROR(_("Could not determine kernel version from string %s"), utsname.release); return; @@ -3689,7 +3689,7 @@ ebiptablesDriverProbeStateMatchQuery(virFirewall *fw G_GNUC_UNUSED, * 'iptables v1.4.16' */ if (!(tmp = strchr(lines[0], 'v')) || - virParseVersionString(tmp + 1, version, true) < 0) { + virStringParseVersion(version, tmp + 1, true) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Cannot parse version string '%s'"), lines[0]); diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index d2acbc2606..afdd97e3c9 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -86,7 +86,7 @@ openvzExtractVersionInfo(const char *cmdstr, int *retversion) if ((tmp = STRSKIP(tmp, "vzctl version ")) == NULL) return -1; - if (virParseVersionString(tmp, &version, true) < 0) + if (virStringParseVersion(&version, tmp, true) < 0) return -1; if (retversion) diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index b5f903cfac..68aaa83b2a 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -615,7 +615,7 @@ dnsmasqCapsSetFromBuffer(dnsmasqCaps *caps, const char *buf) virSkipToDigit(&p); - if (virParseVersionString(p, &version, true) < 0) + if (virStringParseVersion(&version, p, true) < 0) goto error; if (version < DNSMASQ_MIN_MAJOR * 1000000 + DNSMASQ_MIN_MINOR * 1000) { diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index 5a0a45f324..f467756f26 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -108,7 +108,7 @@ virFirewallDGetVersion(unsigned long *version) g_variant_get(reply, "(v)", &gvar); g_variant_get(gvar, "&s", &versionStr); - if (virParseVersionString(versionStr, version, false) < 0) { + if (virStringParseVersion(version, versionStr, false) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to parse firewalld version '%s'"), versionStr); diff --git a/src/util/virstring.c b/src/util/virstring.c index a7ce566963..ad0b158ad4 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -1022,9 +1022,9 @@ int virStringParseYesNo(const char *str, bool *result) /** - * virParseVersionString: - * @str: const char pointer to the version string + * virStringParseVersion: * @version: unsigned long pointer to output the version number + * @str: const char pointer to the version string * @allowMissing: true to treat 3 like 3.0.0, false to error out on * missing minor or micro * @@ -1038,7 +1038,8 @@ int virStringParseYesNo(const char *str, bool *result) * Returns the 0 for success, -1 for error. */ int -virParseVersionString(const char *str, unsigned long *version, +virStringParseVersion(unsigned long *version, + const char *str, bool allowMissing) { unsigned int major, minor = 0, micro = 0; diff --git a/src/util/virstring.h b/src/util/virstring.h index 1dbeb7445f..ec8ceb0022 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -136,6 +136,6 @@ int virStringParseYesNo(const char *str, bool *result) G_GNUC_WARN_UNUSED_RESULT; -int virParseVersionString(const char *str, - unsigned long *version, +int virStringParseVersion(unsigned long *version, + const char *str, bool allowMissing); diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index d3251863e6..eec47a02fc 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -170,7 +170,7 @@ vboxExtractVersion(void) gVBoxAPI.UPFN.Utf16ToUtf8(vbox_driver->pFuncs, versionUtf16, &vboxVersion); - if (virParseVersionString(vboxVersion, &vbox_driver->version, false) >= 0) + if (virStringParseVersion(&vbox_driver->version, vboxVersion, false) >= 0) ret = 0; gVBoxAPI.UPFN.Utf8Free(vbox_driver->pFuncs, vboxVersion); diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index c88f11fcab..bce690bbdf 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -230,7 +230,7 @@ vmwareParseVersionStr(int type, const char *verbuf, unsigned long *version) return -1; } - if (virParseVersionString(tmp, version, false) < 0) { + if (virStringParseVersion(version, tmp, false) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("version parsing error")); return -1; diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c index 90e26091bb..fcf6d363a9 100644 --- a/src/vz/vz_utils.c +++ b/src/vz/vz_utils.c @@ -182,7 +182,7 @@ vzInitVersion(struct _vzDriver *driver) } tmp[0] = '\0'; - if (virParseVersionString(sVer, &(driver->vzVersion), true) < 0) { + if (virStringParseVersion(&(driver->vzVersion), sVer, true) < 0) { vzParseError(); goto cleanup; } diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index a77d1e6fe6..cf66c12622 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -696,7 +696,7 @@ testQemuGetLatestCapsForArch(const char *arch, if (!virStringStripSuffix(tmp, fullsuffix)) continue; - if (virParseVersionString(tmp, &ver, false) < 0) { + if (virStringParseVersion(&ver, tmp, false) < 0) { VIR_TEST_DEBUG("skipping caps file '%s'", ent->d_name); continue; } diff --git a/tests/utiltest.c b/tests/utiltest.c index 2921ae8d8c..419dfea913 100644 --- a/tests/utiltest.c +++ b/tests/utiltest.c @@ -151,7 +151,7 @@ testParseVersionString(const void *data G_GNUC_UNUSED) unsigned long version; for (i = 0; i < G_N_ELEMENTS(versions); ++i) { - result = virParseVersionString(versions[i].string, &version, + result = virStringParseVersion(&version, versions[i].string, versions[i].allowMissing); if (result != versions[i].result) { diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c index 1cb9d206b5..2ac96d1e19 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -267,7 +267,7 @@ int virHostValidateLinuxKernel(const char *hvname, return VIR_HOST_VALIDATE_FAILURE(level); } - if (virParseVersionString(uts.release, &thisversion, true) < 0) { + if (virStringParseVersion(&thisversion, uts.release, true) < 0) { virHostMsgFail(level, "%s", hint); return VIR_HOST_VALIDATE_FAILURE(level); } -- 2.34.1

On Fri, Jan 28, 2022 at 09:58:45PM +0100, Ján Tomko wrote:
-int virParseVersionString(const char *str, - unsigned long *version, +int virStringParseVersion(unsigned long *version, + const char *str, bool allowMissing);
While I agree with renaming the function and moving it to util/virstring, I think changing the order of arguments the way you did goes against existing best practices. Compare with the following signatures: int virStrToLong_i(char const *s, char **end_ptr, int base, int *result); int virStringParsePort(const char *str, unsigned int *port); int virStringParseYesNo(const char *str, bool *result); So if anything the new signature should look like int virStrinParseVersion(const char *str, bool allowMissing, unsigned long *version); with all input arguments first and the single output argument last. -- Andrea Bolognani / Red Hat / Virtualization

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/esx/esx_vi.c | 1 - src/nwfilter/nwfilter_ebiptables_driver.c | 1 - src/openvz/openvz_conf.c | 1 - src/util/virdnsmasq.c | 1 - src/util/virfirewalld.c | 1 - src/vmware/vmware_conf.c | 1 - tests/testutilsqemu.c | 1 - 7 files changed, 7 deletions(-) diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index bc43fa0af1..96ce827555 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -35,7 +35,6 @@ #include "esx_vi_methods.h" #include "esx_util.h" #include "virstring.h" -#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_ESX diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 058f2ec559..54065a0f75 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -43,7 +43,6 @@ #include "configmake.h" #include "virstring.h" #include "virfirewall.h" -#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_NWFILTER diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index afdd97e3c9..191c79e1e2 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -40,7 +40,6 @@ #include "vircommand.h" #include "virstring.h" #include "virhostcpu.h" -#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_OPENVZ diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index 68aaa83b2a..fd4efa802c 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -34,7 +34,6 @@ #include "datatypes.h" #include "virbitmap.h" #include "virdnsmasq.h" -#include "virutil.h" #include "vircommand.h" #include "viralloc.h" #include "virerror.h" diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index f467756f26..c909901833 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -28,7 +28,6 @@ #include "virfirewalldpriv.h" #include "viralloc.h" #include "virerror.h" -#include "virutil.h" #include "virlog.h" #include "virgdbus.h" #include "virenum.h" diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index bce690bbdf..ebba435cc4 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -32,7 +32,6 @@ #include "vmware_conf.h" #include "virstring.h" #include "virlog.h" -#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_VMWARE diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index cf66c12622..646ef415d1 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -12,7 +12,6 @@ # include "qemu/qemu_capspriv.h" # include "virstring.h" # include "virfilecache.h" -# include "virutil.h" # define VIR_FROM_THIS VIR_FROM_QEMU -- 2.34.1

On 1/28/22 3:58 PM, Ján Tomko wrote:
And clean up some includes while doing it.
Ján Tomko (4): maint: add required includes util: virParseVersionString: move to virstring.c virParseVersionString: rename to virStringParseVersion maint: remove unnecessary virutil.h includes
Reviewed-by: Laine Stump <laine@redhat.com> but beware the slippery slope (e.g. - if you're going to move this one, then what about virIndexToDiskName and virDiskNameToIndex - they just operate on a string too...). Do we really want such specific functions in a file made for generally useful string functions? (Maybe we do, I don't have a strong opinion one way or the other, just thought I'd bring it up)
src/bhyve/bhyve_driver.c | 2 +- src/ch/ch_conf.c | 2 +- src/esx/esx_vi.c | 9 ++--- src/libvirt_private.syms | 2 +- src/lxc/lxc_driver.c | 2 +- src/nwfilter/nwfilter_ebiptables_driver.c | 6 +-- src/openvz/openvz_conf.c | 3 +- src/util/virdnsmasq.c | 3 +- src/util/virfirewalld.c | 4 +- src/util/virstring.c | 48 +++++++++++++++++++++++ src/util/virstring.h | 4 ++ src/util/virutil.c | 46 ---------------------- src/util/virutil.h | 3 -- src/vbox/vbox_common.c | 2 +- src/vmware/vmware_conf.c | 3 +- src/vz/vz_utils.c | 2 +- tests/testutilsqemu.c | 3 +- tests/utiltest.c | 2 +- tools/virt-host-validate-common.c | 2 +- 19 files changed, 73 insertions(+), 75 deletions(-)
participants (3)
-
Andrea Bolognani
-
Ján Tomko
-
Laine Stump