[libvirt PATCH 3/4] virsh: delete vsh[CM]alloc

Ján Tomko jtomko at redhat.com
Mon Oct 5 17:02:38 UTC 2020


Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 tools/vsh.c | 18 ------------------
 tools/vsh.h |  6 ------
 2 files changed, 24 deletions(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index 98066d17bf..ca92bcd78c 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -100,24 +100,6 @@ vshPrettyCapacity(unsigned long long val, const char **unit)
 }
 
 
-void *
-_vshMalloc(vshControl *ctl, size_t size, const char *filename, int line)
-{
-    char *x;
-
-    if (VIR_ALLOC_N(x, size) == 0)
-        return x;
-    vshError(ctl, _("%s: %d: failed to allocate %d bytes"),
-             filename, line, (int) size);
-    exit(EXIT_FAILURE);
-}
-
-void *
-vshCalloc(vshControl *ctl G_GNUC_UNUSED, size_t nmemb, size_t size)
-{
-    return g_malloc0_n(nmemb, size);
-}
-
 int
 vshNameSorter(const void *a, const void *b)
 {
diff --git a/tools/vsh.h b/tools/vsh.h
index 0a40995bf5..5583fef9cc 100644
--- a/tools/vsh.h
+++ b/tools/vsh.h
@@ -465,12 +465,6 @@ char * vshReadline(vshControl *ctl, const char *prompt);
 
 void vshReadlineHistoryAdd(const char *cmd);
 
-/* allocation wrappers */
-void *_vshMalloc(vshControl *ctl, size_t sz, const char *filename, int line);
-#define vshMalloc(_ctl, _sz)    _vshMalloc(_ctl, _sz, __FILE__, __LINE__)
-
-void *vshCalloc(vshControl *ctl, size_t nmemb, size_t sz);
-
 /* Macros to help dealing with mutually exclusive options. */
 
 /* VSH_EXCLUSIVE_OPTIONS_EXPR:
-- 
2.26.2




More information about the libvir-list mailing list