From nobody Sun Feb 8 10:30:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571438285; cv=none; d=zoho.com; s=zohoarc; b=WDLrZTgKaBz7zojKTPVlRYtlBu996WNRQoLDn41fzDNFTrVUBzdhLn6Ra5B0SADjsBX7zlSxolqRUPnYplu0k06pVjpcgFdvocpPP5ghmqC2/wBwP+iq/f9Do/SSq/ORZGAz3cvxHZeZj2daazuSiY2UfPK8Vdbqhh//5swNiA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571438285; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mDO1NgtSiHOrVV9FePNqSpn8f+xIYHY7oEOmqO/8rlw=; b=WJk+GsE91nxKa7weRftmZUhPlvRwIeRyXb/bdeSpUXGmLmvq1bzENyvzvSmDFSBu+P8bsLtJO/kGHJVET/jh0S/lrLmJexTqFCMv7yU15l/2hlf2HoUDP34Q2Y0eK2LzE2DbWN0OZuEWzKALogLVjPnciqNbvagHtiJU/FlR/L4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571438285442396.06945713931316; Fri, 18 Oct 2019 15:38:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D306F300BC7E; Fri, 18 Oct 2019 22:38:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6F305EE1D; Fri, 18 Oct 2019 22:38:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 629A64EE7E; Fri, 18 Oct 2019 22:38:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9IMbLx6025337 for ; Fri, 18 Oct 2019 18:37:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id F31D55D71C; Fri, 18 Oct 2019 22:37:20 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-21.brq.redhat.com [10.40.200.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id D55E65D70E for ; Fri, 18 Oct 2019 22:37:19 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 19 Oct 2019 00:37:53 +0200 Message-Id: <366fad0bfa4d3e7c54706315024d962eba730cbd.1571438247.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/10] tools: prefer g_strdup to vshStrdup X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 18 Oct 2019 22:38:04 +0000 (UTC) Remove all the uses of vshStrdup in favor of GLib's g_strdup. Signed-off-by: J=C3=A1n Tomko --- tools/virsh-checkpoint.c | 4 ++-- tools/virsh-domain-monitor.c | 6 +++--- tools/virsh-domain.c | 4 ++-- tools/virsh-nodedev.c | 5 ++--- tools/virsh-pool.c | 30 ++++++++++++++---------------- tools/virsh-snapshot.c | 6 +++--- tools/virsh-volume.c | 11 +++++------ tools/virsh.c | 9 ++++----- tools/virt-admin.c | 6 +++--- tools/vsh.c | 30 +++++++++++++++--------------- 10 files changed, 53 insertions(+), 58 deletions(-) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index 08f8fded86..7fd3914ef2 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -127,7 +127,7 @@ cmdCheckpointCreate(vshControl *ctl, if (vshCommandOptStringReq(ctl, cmd, "xmlfile", &from) < 0) goto cleanup; if (!from) { - buffer =3D vshStrdup(ctl, ""); + buffer =3D g_strdup(""); } else { if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0) { vshSaveLibvirtError(); @@ -426,7 +426,7 @@ virshGetCheckpointParent(vshControl *ctl, parent =3D virDomainCheckpointGetParent(checkpoint, 0); if (parent) { /* API works, and virDomainCheckpointGetName will succeed */ - *parent_name =3D vshStrdup(ctl, virDomainCheckpointGetName(parent)= ); + *parent_name =3D g_strdup(virDomainCheckpointGetName(parent)); ret =3D 0; } else if (last_error->code =3D=3D VIR_ERR_NO_DOMAIN_CHECKPOINT) { /* API works, and we found a root with no parent */ diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 739c8df381..bfff08b0f6 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -73,7 +73,7 @@ virshGetDomainDescription(vshControl *ctl, virDomainPtr d= om, bool title, int errCode =3D virGetLastErrorCode(); =20 if (errCode =3D=3D VIR_ERR_NO_DOMAIN_METADATA) { - desc =3D vshStrdup(ctl, ""); + desc =3D g_strdup(""); vshResetLibvirtError(); return desc; } @@ -92,7 +92,7 @@ virshGetDomainDescription(vshControl *ctl, virDomainPtr d= om, bool title, desc =3D virXPathString("string(./description[1])", ctxt); =20 if (!desc) - desc =3D vshStrdup(ctl, ""); + desc =3D g_strdup(""); =20 cleanup: xmlXPathFreeContext(ctxt); @@ -2419,7 +2419,7 @@ cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd) ip_addr_str =3D virBufferContentAndReset(&buf); =20 if (!ip_addr_str) - ip_addr_str =3D vshStrdup(ctl, ""); + ip_addr_str =3D g_strdup(""); =20 /* Don't repeat interface name */ if (full || !j) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index b1618960b1..2f3ac2d430 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -5085,7 +5085,7 @@ cmdSchedInfoUpdate(vshControl *ctl, const vshCmd *cmd, int rv; =20 while ((opt =3D vshCommandOptArgv(ctl, cmd, opt))) { - set_field =3D vshStrdup(ctl, opt->data); + set_field =3D g_strdup(opt->data); if (!(set_val =3D strchr(set_field, '=3D'))) { vshError(ctl, "%s", _("Invalid syntax for --set, " "expecting name=3Dvalue")); @@ -11481,7 +11481,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd) VIR_FREE(listen_addr); =20 if (uri) { - listen_addr =3D vshStrdup(ctl, uri->server); + listen_addr =3D g_strdup(uri->server); virURIFree(uri); } } diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index 455ddedc2d..cb2fc26d1a 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -477,13 +477,12 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd= G_GNUC_UNUSED) struct virshNodeList arrays =3D { names, parents }; =20 for (i =3D 0; i < list->ndevices; i++) - names[i] =3D vshStrdup(ctl, virNodeDeviceGetName(list->devices= [i])); + names[i] =3D g_strdup(virNodeDeviceGetName(list->devices[i])); =20 for (i =3D 0; i < list->ndevices; i++) { virNodeDevicePtr dev =3D list->devices[i]; if (STRNEQ(names[i], "computer")) { - const char *parent =3D virNodeDeviceGetParent(dev); - parents[i] =3D parent ? vshStrdup(ctl, parent) : NULL; + parents[i] =3D g_strdup(virNodeDeviceGetParent(dev)); } else { parents[i] =3D NULL; } diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index bb25840943..bd876aefda 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -1247,10 +1247,9 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GNU= C_UNUSED) =20 /* Retrieve the autostart status of the pool */ if (virStoragePoolGetAutostart(list->pools[i], &autostart) < 0) - poolInfoTexts[i].autostart =3D vshStrdup(ctl, _("no autostart"= )); + poolInfoTexts[i].autostart =3D g_strdup(_("no autostart")); else - poolInfoTexts[i].autostart =3D vshStrdup(ctl, autostart ? - _("yes") : _("no")); + poolInfoTexts[i].autostart =3D g_strdup(autostart ? _("yes") := _("no")); =20 /* Retrieve the persistence status of the pool */ if (details) { @@ -1258,28 +1257,27 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GN= UC_UNUSED) vshDebug(ctl, VSH_ERR_DEBUG, "Persistent flag value: %d\n", persistent); if (persistent < 0) - poolInfoTexts[i].persistent =3D vshStrdup(ctl, _("unknown"= )); + poolInfoTexts[i].persistent =3D g_strdup(_("unknown")); else - poolInfoTexts[i].persistent =3D vshStrdup(ctl, persistent ? - _("yes") : _("no"= )); + poolInfoTexts[i].persistent =3D g_strdup(persistent ? _("y= es") : _("no")); } =20 /* Collect further extended information about the pool */ if (virStoragePoolGetInfo(list->pools[i], &info) !=3D 0) { /* Something went wrong retrieving pool info, cope with it */ vshError(ctl, "%s", _("Could not retrieve pool information")); - poolInfoTexts[i].state =3D vshStrdup(ctl, _("unknown")); + poolInfoTexts[i].state =3D g_strdup(_("unknown")); if (details) { - poolInfoTexts[i].capacity =3D vshStrdup(ctl, _("unknown")); - poolInfoTexts[i].allocation =3D vshStrdup(ctl, _("unknown"= )); - poolInfoTexts[i].available =3D vshStrdup(ctl, _("unknown")= ); + poolInfoTexts[i].capacity =3D g_strdup(_("unknown")); + poolInfoTexts[i].allocation =3D g_strdup(_("unknown")); + poolInfoTexts[i].available =3D g_strdup(_("unknown")); } } else { /* Decide which state string to display */ if (details) { const char *state =3D virshStoragePoolStateToString(info.s= tate); =20 - poolInfoTexts[i].state =3D vshStrdup(ctl, state); + poolInfoTexts[i].state =3D g_strdup(state); =20 /* Create the pool size related strings */ if (info.state =3D=3D VIR_STORAGE_POOL_RUNNING || @@ -1303,17 +1301,17 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GN= UC_UNUSED) goto cleanup; } else { /* Capacity related information isn't available */ - poolInfoTexts[i].capacity =3D vshStrdup(ctl, _("-")); - poolInfoTexts[i].allocation =3D vshStrdup(ctl, _("-")); - poolInfoTexts[i].available =3D vshStrdup(ctl, _("-")); + poolInfoTexts[i].capacity =3D g_strdup(_("-")); + poolInfoTexts[i].allocation =3D g_strdup(_("-")); + poolInfoTexts[i].available =3D g_strdup(_("-")); } } else { /* --details option was not specified, only active/inactive * state strings are used */ if (virStoragePoolIsActive(list->pools[i])) - poolInfoTexts[i].state =3D vshStrdup(ctl, _("active")); + poolInfoTexts[i].state =3D g_strdup(_("active")); else - poolInfoTexts[i].state =3D vshStrdup(ctl, _("inactive"= )); + poolInfoTexts[i].state =3D g_strdup(_("inactive")); } } } diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index eae19ecd27..751186ebf8 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -197,7 +197,7 @@ cmdSnapshotCreate(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptStringReq(ctl, cmd, "xmlfile", &from) < 0) goto cleanup; if (!from) { - buffer =3D vshStrdup(ctl, ""); + buffer =3D g_strdup(""); } else { if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0) { vshSaveLibvirtError(); @@ -755,7 +755,7 @@ virshGetSnapshotParent(vshControl *ctl, virDomainSnapsh= otPtr snapshot, parent =3D virDomainSnapshotGetParent(snapshot, 0); if (parent) { /* API works, and virDomainSnapshotGetName will succeed */ - *parent_name =3D vshStrdup(ctl, virDomainSnapshotGetName(paren= t)); + *parent_name =3D g_strdup(virDomainSnapshotGetName(parent)); ret =3D 0; goto cleanup; } @@ -1236,7 +1236,7 @@ virshSnapshotListCollect(vshControl *ctl, virDomainPt= r dom, count - 1, flags); if (count >=3D 0) { count++; - names[0] =3D vshStrdup(ctl, fromname); + names[0] =3D g_strdup(fromname); } } else { count =3D virDomainSnapshotListChildrenNames(from, names, diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 702d0109ad..d09d4435ad 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -1413,22 +1413,21 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd G_GNU= C_UNUSED) /* Retrieve the volume path */ if ((volInfoTexts[i].path =3D virStorageVolGetPath(vol)) =3D=3D NU= LL) { /* Something went wrong retrieving a volume path, cope with it= */ - volInfoTexts[i].path =3D vshStrdup(ctl, _("unknown")); + volInfoTexts[i].path =3D g_strdup(_("unknown")); } =20 /* If requested, retrieve volume type and sizing information */ if (details) { if (virStorageVolGetInfo(vol, &volumeInfo) !=3D 0) { /* Something went wrong retrieving volume info, cope with = it */ - volInfoTexts[i].allocation =3D vshStrdup(ctl, _("unknown")= ); - volInfoTexts[i].capacity =3D vshStrdup(ctl, _("unknown")); - volInfoTexts[i].type =3D vshStrdup(ctl, _("unknown")); + volInfoTexts[i].allocation =3D g_strdup(_("unknown")); + volInfoTexts[i].capacity =3D g_strdup(_("unknown")); + volInfoTexts[i].type =3D g_strdup(_("unknown")); } else { /* Convert the returned volume info into output strings */ =20 /* Volume type */ - volInfoTexts[i].type =3D vshStrdup(ctl, - virshVolumeTypeToString(v= olumeInfo.type)); + volInfoTexts[i].type =3D g_strdup(virshVolumeTypeToString(= volumeInfo.type)); =20 val =3D vshPrettyCapacity(volumeInfo.capacity, &unit); if (virAsprintf(&volInfoTexts[i].capacity, diff --git a/tools/virsh.c b/tools/virsh.c index a3553ddd36..8c0e9d960d 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -236,7 +236,7 @@ virshReconnect(vshControl *ctl, const char *name, bool = readonly, bool force) } else { if (name) { VIR_FREE(ctl->connname); - ctl->connname =3D vshStrdup(ctl, name); + ctl->connname =3D g_strdup(name); } =20 priv->readonly =3D readonly; @@ -677,7 +677,7 @@ virshParseArgv(vshControl *ctl, int argc, char **argv) switch (arg) { case 'c': VIR_FREE(ctl->connname); - ctl->connname =3D vshStrdup(ctl, optarg); + ctl->connname =3D g_strdup(optarg); break; case 'd': if (virStrToLong_i(optarg, NULL, 10, &debug) < 0) { @@ -742,7 +742,7 @@ virshParseArgv(vshControl *ctl, int argc, char **argv) break; case 'l': vshCloseLogFile(ctl); - ctl->logfile =3D vshStrdup(ctl, optarg); + ctl->logfile =3D g_strdup(optarg); vshOpenLogFile(ctl); break; case 'q': @@ -906,8 +906,7 @@ main(int argc, char **argv) } =20 if (!ctl->connname) - ctl->connname =3D vshStrdup(ctl, - getenv("VIRSH_DEFAULT_CONNECT_URI")); + ctl->connname =3D g_strdup(getenv("VIRSH_DEFAULT_CONNECT_URI")); =20 if (!ctl->imode) { ret =3D vshCommandRun(ctl, ctl->cmd); diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 3aada5f963..f3ae011cf4 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -343,7 +343,7 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd) =20 if (name) { VIR_FREE(ctl->connname); - ctl->connname =3D vshStrdup(ctl, name); + ctl->connname =3D g_strdup(name); } =20 vshAdmReconnect(ctl); @@ -1295,7 +1295,7 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **arg= v) switch (arg) { case 'c': VIR_FREE(ctl->connname); - ctl->connname =3D vshStrdup(ctl, optarg); + ctl->connname =3D g_strdup(optarg); break; case 'd': if (virStrToLong_i(optarg, NULL, 10, &debug) < 0) { @@ -1315,7 +1315,7 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **arg= v) break; case 'l': vshCloseLogFile(ctl); - ctl->logfile =3D vshStrdup(ctl, optarg); + ctl->logfile =3D g_strdup(optarg); vshOpenLogFile(ctl); break; case 'q': diff --git a/tools/vsh.c b/tools/vsh.c index 9ee3f99ff3..baba5ec314 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -176,7 +176,7 @@ int vshStringToArray(const char *str, char ***array) { - char *str_copied =3D vshStrdup(NULL, str); + char *str_copied =3D g_strdup(str); char *str_tok =3D NULL; char *tmp; unsigned int nstr_tokens =3D 0; @@ -214,10 +214,10 @@ vshStringToArray(const char *str, continue; } *tmp++ =3D '\0'; - arr[nstr_tokens++] =3D vshStrdup(NULL, str_tok); + arr[nstr_tokens++] =3D g_strdup(str_tok); str_tok =3D tmp; } - arr[nstr_tokens++] =3D vshStrdup(NULL, str_tok); + arr[nstr_tokens++] =3D g_strdup(str_tok); =20 *array =3D arr; VIR_FREE(str_copied); @@ -1451,7 +1451,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *pa= rser, vshCmd **partial) /* aliases need to be resolved to the actual commands */ if (cmd->flags & VSH_CMD_FLAG_ALIAS) { VIR_FREE(tkdata); - tkdata =3D vshStrdup(ctl, cmd->alias); + tkdata =3D g_strdup(cmd->alias); cmd =3D vshCmddefSearch(tkdata); } if (vshCmddefOptParse(cmd, &opts_need_arg, @@ -1472,7 +1472,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *pa= rser, vshCmd **partial) =20 if (optstr) { *optstr =3D '\0'; /* convert the '=3D' to '\0' */ - optstr =3D vshStrdup(ctl, optstr + 1); + optstr =3D g_strdup(optstr + 1); } /* Special case 'help' to ignore all spurious options */ if (!(opt =3D vshCmddefGetOption(ctl, cmd, tkdata + 2, @@ -1582,7 +1582,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *pa= rser, vshCmd **partial) vshCommandOptFree(first); first =3D vshMalloc(ctl, sizeof(vshCmdOpt)); first->def =3D help->opts; - first->data =3D vshStrdup(ctl, cmd->name); + first->data =3D g_strdup(cmd->name); first->next =3D NULL; =20 cmd =3D help; @@ -1686,7 +1686,7 @@ vshCommandStringGetArg(vshControl *ctl, vshCommandPar= ser *parser, char **res, bool double_quote =3D false; int sz =3D 0; char *p =3D parser->pos; - char *q =3D vshStrdup(ctl, p); + char *q =3D g_strdup(p); =20 *res =3D q; =20 @@ -1834,11 +1834,11 @@ vshGetTypedParamValue(vshControl *ctl, virTypedPara= meterPtr item) break; =20 case VIR_TYPED_PARAM_BOOLEAN: - str =3D vshStrdup(ctl, item->value.b ? _("yes") : _("no")); + str =3D g_strdup(item->value.b ? _("yes") : _("no")); break; =20 case VIR_TYPED_PARAM_STRING: - str =3D vshStrdup(ctl, item->value.s); + str =3D g_strdup(item->value.s); break; =20 default: @@ -2668,7 +2668,7 @@ vshReadlineCommandGenerator(const char *text) virStringListFree(ret); return NULL; } - ret[ret_size] =3D vshStrdup(NULL, name); + ret[ret_size] =3D g_strdup(name); ret_size++; /* Terminate the string list properly. */ ret[ret_size] =3D NULL; @@ -2820,7 +2820,7 @@ vshReadlineParse(const char *text, int state) char *ret =3D NULL; =20 if (!state) { - char *buf =3D vshStrdup(NULL, rl_line_buffer); + char *buf =3D g_strdup(rl_line_buffer); =20 vshCommandFree(partial); partial =3D NULL; @@ -2882,7 +2882,7 @@ vshReadlineParse(const char *text, int state) } =20 if (list) { - ret =3D vshStrdup(NULL, list[list_index]); + ret =3D g_strdup(list[list_index]); list_index++; } =20 @@ -3055,7 +3055,7 @@ vshReadline(vshControl *ctl, const char *prompt) if (len > 0 && r[len-1] =3D=3D '\n') r[len-1] =3D '\0'; =20 - return vshStrdup(ctl, r); + return g_strdup(r); } =20 #endif /* !WITH_READLINE */ @@ -3095,7 +3095,7 @@ vshInitDebug(vshControl *ctl) /* log file not set from cmdline */ debugEnv =3D getenv(env); if (debugEnv && *debugEnv) { - ctl->logfile =3D vshStrdup(ctl, debugEnv); + ctl->logfile =3D g_strdup(debugEnv); vshOpenLogFile(ctl); } VIR_FREE(env); @@ -3345,7 +3345,7 @@ cmdEcho(vshControl *ctl, const vshCmd *cmd) } str =3D virBufferContentAndReset(&xmlbuf); } else { - str =3D vshStrdup(ctl, arg); + str =3D g_strdup(arg); } =20 if (shell) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list