<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 18, 2018 at 5:45 PM, Pavel Hrdina <span dir="ltr"><<a href="mailto:phrdina@redhat.com" target="_blank">phrdina@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Pavel Hrdina <<a href="mailto:phrdina@redhat.com" target="_blank">phrdina@redhat.com</a>><br>
---<br>
 src/Makefile.am             |  1 +<br>
 src/libvirt_private.syms    |  3 ++<br>
 src/util/<a href="http://Makefile.inc.am" rel="noreferrer" target="_blank">Makefile.inc.am</a>    |  2 ++<br>
 src/util/vircgroupbackend.c |  2 ++<br>
 src/util/vircgroupv1.c      | 55 ++++++++++++++++++++++++++++++<wbr>+++++++<br>
 src/util/vircgroupv1.h      | 27 ++++++++++++++++++<br>
 6 files changed, 90 insertions(+)<br>
 create mode 100644 src/util/vircgroupv1.c<br>
 create mode 100644 src/util/vircgroupv1.h<br>
<br>
diff --git a/src/Makefile.am b/src/Makefile.am<br>
index 3465629005..f515569fd5 100644<br>
--- a/src/Makefile.am<br>
+++ b/src/Makefile.am<br>
@@ -674,6 +674,7 @@ libvirt_setuid_rpc_client_la_S<wbr>OURCES = \<br>
                util/virbuffer.c \<br>
                util/vircgroup.c \<br>
                util/vircgroupbackend.c \<br>
+               util/vircgroupv1.c \<br>
                util/vircommand.c \<br>
                util/virconf.c \<br>
                util/virdbus.c \<br>
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms<br>
index eb302b3559..00598b97de 100644<br>
--- a/src/libvirt_private.syms<br>
+++ b/src/libvirt_private.syms<br>
@@ -1580,6 +1580,9 @@ virCgroupTerminateMachine;<br>
 virCgroupBackendGetAll;<br>
 virCgroupBackendRegister;<br>
<br>
+# util/vircgroupv1.h<br>
+virCgroupV1Register;<br>
+<br>
 # util/virclosecallbacks.h<br>
 virCloseCallbacksGet;<br>
 virCloseCallbacksGetConn;<br>
diff --git a/src/util/<a href="http://Makefile.inc.am" rel="noreferrer" target="_blank">Makefile.inc.am</a> b/src/util/<a href="http://Makefile.inc.am" rel="noreferrer" target="_blank">Makefile.inc.am</a><br>
index 1b236ca62b..ad3be91867 100644<br>
--- a/src/util/<a href="http://Makefile.inc.am" rel="noreferrer" target="_blank">Makefile.inc.am</a><br>
+++ b/src/util/<a href="http://Makefile.inc.am" rel="noreferrer" target="_blank">Makefile.inc.am</a><br>
@@ -25,6 +25,8 @@ UTIL_SOURCES = \<br>
        util/vircgroup.h util/vircgrouppriv.h \<br>
        util/vircgroupbackend.c \<br>
        util/vircgroupbackend.h \<br>
+       util/vircgroupv1.c \<br>
+       util/vircgroupv1.h \<br>
        util/virclosecallbacks.c \<br>
        util/virclosecallbacks.h \<br>
        util/vircommand.c \<br>
diff --git a/src/util/vircgroupbackend.c b/src/util/vircgroupbackend.c<br>
index e014bfc0e6..d854c9711d 100644<br>
--- a/src/util/vircgroupbackend.c<br>
+++ b/src/util/vircgroupbackend.c<br>
@@ -20,6 +20,7 @@<br>
 #include <config.h><br>
<br>
 #include "vircgroupbackend.h"<br>
+#include "vircgroupv1.h"<br>
 #include "virerror.h"<br>
 #include "virthread.h"<br>
<br>
@@ -49,6 +50,7 @@ virCgroupBackendRegister(virCg<wbr>roupBackendPtr backend)<br>
 static void<br>
 virCgroupBackendOnceInit(<wbr>void)<br>
 {<br>
+    virCgroupV1Register();<br>
 }<br>
<br>
<br>
diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c<br>
new file mode 100644<br>
index 0000000000..711ebf1128<br>
--- /dev/null<br>
+++ b/src/util/vircgroupv1.c<br>
@@ -0,0 +1,55 @@<br>
+/*<br>
+ * vircgroupv1.c: methods for cgroups v1 backedn<br></blockquote><div><br></div><div>typo: backedn -> backend<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ *<br>
+ * Copyright (C) 2010-2015,2018 Red Hat, Inc.<br>
+ * Copyright IBM Corp. 2008<br>
+ *<br>
+ * This library is free software; you can redistribute it and/or<br>
+ * modify it under the terms of the GNU Lesser General Public<br>
+ * License as published by the Free Software Foundation; either<br>
+ * version 2.1 of the License, or (at your option) any later version.<br>
+ *<br>
+ * This library is distributed in the hope that it will be useful,<br>
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
+ * Lesser General Public License for more details.<br>
+ *<br>
+ * You should have received a copy of the GNU Lesser General Public<br>
+ * License along with this library.  If not, see<br>
+ * <<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>><wbr>.<br>
+ */<br>
+#include <config.h><br>
+<br>
+#include "internal.h"<br>
+<br>
+#define __VIR_CGROUP_ALLOW_INCLUDE_PRI<wbr>V_H__<br>
+#include "vircgrouppriv.h"<br>
+#undef __VIR_CGROUP_ALLOW_INCLUDE_PRI<wbr>V_H__<br>
+<br>
+#include "vircgroup.h"<br>
+#include "vircgroupbackend.h"<br>
+#include "vircgroupv1.h"<br>
+#include "virlog.h"<br>
+<br>
+VIR_LOG_INIT("util.cgroup");<br>
+<br>
+#define VIR_FROM_THIS VIR_FROM_CGROUP<br>
+<br>
+<br>
+VIR_ENUM_DECL(virCgroupV1Cont<wbr>roller);<br>
+VIR_ENUM_IMPL(virCgroupV1Cont<wbr>roller, VIR_CGROUP_CONTROLLER_LAST,<br>
+              "cpu", "cpuacct", "cpuset", "memory", "devices",<br>
+              "freezer", "blkio", "net_cls", "perf_event",<br>
+              "name=systemd");<br>
+<br>
+<br>
+virCgroupBackend virCgroupV1Backend = {<br>
+    .type = VIR_CGROUP_BACKEND_TYPE_V1,<br>
+};<br>
+<br>
+<br>
+void<br>
+virCgroupV1Register(void)<br>
+{<br>
+    virCgroupBackendRegister(&virC<wbr>groupV1Backend);<br>
+}<br>
diff --git a/src/util/vircgroupv1.h b/src/util/vircgroupv1.h<br>
new file mode 100644<br>
index 0000000000..e75b85a50a<br>
--- /dev/null<br>
+++ b/src/util/vircgroupv1.h<br>
@@ -0,0 +1,27 @@<br>
+/*<br>
+ * vircgroupv1.h: methods for cgroups v1 backedn<br></blockquote><div><br></div><div>typo: backedn -> backend<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ *<br>
+ * Copyright (C) 2018 Red Hat, Inc.<br>
+ *<br>
+ * This library is free software; you can redistribute it and/or<br>
+ * modify it under the terms of the GNU Lesser General Public<br>
+ * License as published by the Free Software Foundation; either<br>
+ * version 2.1 of the License, or (at your option) any later version.<br>
+ *<br>
+ * This library is distributed in the hope that it will be useful,<br>
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
+ * Lesser General Public License for more details.<br>
+ *<br>
+ * You should have received a copy of the GNU Lesser General Public<br>
+ * License along with this library.  If not, see<br>
+ * <<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>><wbr>.<br>
+ */<br>
+<br>
+#ifndef __VIR_CGROUP_V1_H__<br>
+# define __VIR_CGROUP_V1_H__<br>
+<br>
+void<br>
+virCgroupV1Register(void);<br>
+<br>
+#endif /* __VIR_CGROUP_V1_H__ */<br>
<span class="m_1348691235650911123HOEnZb"><font color="#888888">-- <br>
2.17.1<br>
<br>
--<br>
libvir-list mailing list<br>
<a href="mailto:libvir-list@redhat.com" target="_blank">libvir-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvir-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/libvir-list</a><br></font></span></blockquote><div><br></div><div>Reviewed-by: Fabiano Fidêncio <<a href="mailto:fidencio@redhat.com" target="_blank">fidencio@redhat.com</a>> </div></div><br></div></div>