c313de
From a4ed662c80b9241f4bc599fded59ace585db25c9 Mon Sep 17 00:00:00 2001
c313de
Message-Id: <a4ed662c80b9241f4bc599fded59ace585db25c9@dist-git>
c313de
From: Pavel Hrdina <phrdina@redhat.com>
c313de
Date: Mon, 1 Jul 2019 17:05:51 +0200
c313de
Subject: [PATCH] vircgroup: Remove unused function virCgroupKill()
c313de
MIME-Version: 1.0
c313de
Content-Type: text/plain; charset=UTF-8
c313de
Content-Transfer-Encoding: 8bit
c313de
c313de
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c313de
(cherry picked from commit c8b1ae607d638b958dc51ba2041bd87ea72683de)
c313de
c313de
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
c313de
c313de
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c313de
Message-Id: <9f04fae641e673c68253864c858e2123c2252296.1561993099.git.phrdina@redhat.com>
c313de
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c313de
---
c313de
 src/libvirt_private.syms |  1 -
c313de
 src/util/vircgroup.c     | 37 -------------------------------------
c313de
 src/util/vircgroup.h     |  1 -
c313de
 3 files changed, 39 deletions(-)
c313de
c313de
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
c313de
index f158a17b49..3117c8009a 100644
c313de
--- a/src/libvirt_private.syms
c313de
+++ b/src/libvirt_private.syms
c313de
@@ -1558,7 +1558,6 @@ virCgroupGetMemSwapUsage;
c313de
 virCgroupGetPercpuStats;
c313de
 virCgroupHasController;
c313de
 virCgroupHasEmptyTasks;
c313de
-virCgroupKill;
c313de
 virCgroupKillPainfully;
c313de
 virCgroupKillRecursive;
c313de
 virCgroupNewDetect;
c313de
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
c313de
index 8ddedbfe7c..5f949edec8 100644
c313de
--- a/src/util/vircgroup.c
c313de
+++ b/src/util/vircgroup.c
c313de
@@ -3510,33 +3510,6 @@ virCgroupPidCopy(const void *name)
c313de
 }
c313de
 
c313de
 
c313de
-/*
c313de
- * Returns 1 if some PIDs are killed, 0 if none are killed, or -1 on error
c313de
- */
c313de
-int
c313de
-virCgroupKill(virCgroupPtr group, int signum)
c313de
-{
c313de
-    VIR_DEBUG("group=%p path=%s signum=%d", group, group->path, signum);
c313de
-    int ret;
c313de
-    /* The 'tasks' file in cgroups can contain duplicated
c313de
-     * pids, so we use a hash to track which we've already
c313de
-     * killed.
c313de
-     */
c313de
-    virHashTablePtr pids = virHashCreateFull(100,
c313de
-                                             NULL,
c313de
-                                             virCgroupPidCode,
c313de
-                                             virCgroupPidEqual,
c313de
-                                             virCgroupPidCopy,
c313de
-                                             NULL);
c313de
-
c313de
-    ret = virCgroupKillInternal(group, signum, pids);
c313de
-
c313de
-    virHashFree(pids);
c313de
-
c313de
-    return ret;
c313de
-}
c313de
-
c313de
-
c313de
 static int
c313de
 virCgroupKillRecursiveInternal(virCgroupPtr group,
c313de
                                int signum,
c313de
@@ -4585,16 +4558,6 @@ virCgroupRemove(virCgroupPtr group ATTRIBUTE_UNUSED)
c313de
 }
c313de
 
c313de
 
c313de
-int
c313de
-virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED,
c313de
-              int signum ATTRIBUTE_UNUSED)
c313de
-{
c313de
-    virReportSystemError(ENOSYS, "%s",
c313de
-                         _("Control groups not supported on this platform"));
c313de
-    return -1;
c313de
-}
c313de
-
c313de
-
c313de
 int
c313de
 virCgroupKillRecursive(virCgroupPtr group ATTRIBUTE_UNUSED,
c313de
                        int signum ATTRIBUTE_UNUSED)
c313de
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
c313de
index af93316197..a23a491d95 100644
c313de
--- a/src/util/vircgroup.h
c313de
+++ b/src/util/vircgroup.h
c313de
@@ -280,7 +280,6 @@ int virCgroupGetCpusetCpus(virCgroupPtr group, char **cpus);
c313de
 int virCgroupRemoveRecursively(char *grppath);
c313de
 int virCgroupRemove(virCgroupPtr group);
c313de
 
c313de
-int virCgroupKill(virCgroupPtr group, int signum);
c313de
 int virCgroupKillRecursive(virCgroupPtr group, int signum);
c313de
 int virCgroupKillPainfully(virCgroupPtr group);
c313de
 
c313de
-- 
c313de
2.22.0
c313de