tools: prefer g_strdup to vshStrdup

Remove all the uses of vshStrdup in favor of GLib's g_strdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Ján Tomko
2019-10-18 17:24:02 +02:00
parent 7863f1547a
commit c937c1d23d
10 changed files with 53 additions and 58 deletions

View File

@@ -477,13 +477,12 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
struct virshNodeList arrays = { names, parents };
for (i = 0; i < list->ndevices; i++)
names[i] = vshStrdup(ctl, virNodeDeviceGetName(list->devices[i]));
names[i] = g_strdup(virNodeDeviceGetName(list->devices[i]));
for (i = 0; i < list->ndevices; i++) {
virNodeDevicePtr dev = list->devices[i];
if (STRNEQ(names[i], "computer")) {
const char *parent = virNodeDeviceGetParent(dev);
parents[i] = parent ? vshStrdup(ctl, parent) : NULL;
parents[i] = g_strdup(virNodeDeviceGetParent(dev));
} else {
parents[i] = NULL;
}