]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: delete vsh[CM]alloc
authorJán Tomko <jtomko@redhat.com>
Mon, 5 Oct 2020 16:43:25 +0000 (18:43 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 6 Oct 2020 07:01:46 +0000 (09:01 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
tools/vsh.c
tools/vsh.h

index 98066d17bf6152a8c6d19d9bff8fac12e417f04e..ca92bcd78cf196cad89705c9a07c683dd31bf5ab 100644 (file)
@@ -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)
 {
index 0a40995bf5d1921748f9a3bc264270f7e6431d9c..5583fef9cc2336d3f3f9ccd19965ab72f8fec58c 100644 (file)
@@ -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: