render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From a4ed662c80b9241f4bc599fded59ace585db25c9 Mon Sep 17 00:00:00 2001
Message-Id: <a4ed662c80b9241f4bc599fded59ace585db25c9@dist-git>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Mon, 1 Jul 2019 17:05:51 +0200
Subject: [PATCH] vircgroup: Remove unused function virCgroupKill()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
(cherry picked from commit c8b1ae607d638b958dc51ba2041bd87ea72683de)

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Message-Id: <9f04fae641e673c68253864c858e2123c2252296.1561993099.git.phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/libvirt_private.syms |  1 -
 src/util/vircgroup.c     | 37 -------------------------------------
 src/util/vircgroup.h     |  1 -
 3 files changed, 39 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index f158a17b49..3117c8009a 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1558,7 +1558,6 @@ virCgroupGetMemSwapUsage;
 virCgroupGetPercpuStats;
 virCgroupHasController;
 virCgroupHasEmptyTasks;
-virCgroupKill;
 virCgroupKillPainfully;
 virCgroupKillRecursive;
 virCgroupNewDetect;
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 8ddedbfe7c..5f949edec8 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -3510,33 +3510,6 @@ virCgroupPidCopy(const void *name)
 }
 
 
-/*
- * Returns 1 if some PIDs are killed, 0 if none are killed, or -1 on error
- */
-int
-virCgroupKill(virCgroupPtr group, int signum)
-{
-    VIR_DEBUG("group=%p path=%s signum=%d", group, group->path, signum);
-    int ret;
-    /* The 'tasks' file in cgroups can contain duplicated
-     * pids, so we use a hash to track which we've already
-     * killed.
-     */
-    virHashTablePtr pids = virHashCreateFull(100,
-                                             NULL,
-                                             virCgroupPidCode,
-                                             virCgroupPidEqual,
-                                             virCgroupPidCopy,
-                                             NULL);
-
-    ret = virCgroupKillInternal(group, signum, pids);
-
-    virHashFree(pids);
-
-    return ret;
-}
-
-
 static int
 virCgroupKillRecursiveInternal(virCgroupPtr group,
                                int signum,
@@ -4585,16 +4558,6 @@ virCgroupRemove(virCgroupPtr group ATTRIBUTE_UNUSED)
 }
 
 
-int
-virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED,
-              int signum ATTRIBUTE_UNUSED)
-{
-    virReportSystemError(ENOSYS, "%s",
-                         _("Control groups not supported on this platform"));
-    return -1;
-}
-
-
 int
 virCgroupKillRecursive(virCgroupPtr group ATTRIBUTE_UNUSED,
                        int signum ATTRIBUTE_UNUSED)
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index af93316197..a23a491d95 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -280,7 +280,6 @@ int virCgroupGetCpusetCpus(virCgroupPtr group, char **cpus);
 int virCgroupRemoveRecursively(char *grppath);
 int virCgroupRemove(virCgroupPtr group);
 
-int virCgroupKill(virCgroupPtr group, int signum);
 int virCgroupKillRecursive(virCgroupPtr group, int signum);
 int virCgroupKillPainfully(virCgroupPtr group);
 
-- 
2.22.0