forked from pool/libvirt
This commit is contained in:
parent
a7c01f6406
commit
26f8e50881
55
cgmajor.patch
Normal file
55
cgmajor.patch
Normal file
@ -0,0 +1,55 @@
|
||||
Index: libvirt-0.4.6/src/cgroup.c
|
||||
===================================================================
|
||||
--- libvirt-0.4.6.orig/src/cgroup.c
|
||||
+++ libvirt-0.4.6/src/cgroup.c
|
||||
@@ -761,6 +761,36 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * virCgroupAllowDeviceMajor:
|
||||
+ *
|
||||
+ * @group: The cgroup to allow an entire device major type for
|
||||
+ * @type: The device type (i.e., 'c' or 'b')
|
||||
+ * @major: The major number of the device type
|
||||
+ *
|
||||
+ * Returns: 0 on success
|
||||
+ */
|
||||
+int virCgroupAllowDeviceMajor(virCgroupPtr group,
|
||||
+ char type,
|
||||
+ int major)
|
||||
+{
|
||||
+ int rc;
|
||||
+ char *devstr = NULL;
|
||||
+
|
||||
+ if (asprintf(&devstr, "%c %i:* rwm", type, major) == -1) {
|
||||
+ rc = -ENOMEM;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ rc = virCgroupSetValueStr(group,
|
||||
+ "devices.allow",
|
||||
+ devstr);
|
||||
+ out:
|
||||
+ VIR_FREE(devstr);
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
int virCgroupSetCpuShares(virCgroupPtr group, unsigned long shares)
|
||||
{
|
||||
return virCgroupSetValueU64(group, "cpu.shares", (uint64_t)shares);
|
||||
Index: libvirt-0.4.6/src/cgroup.h
|
||||
===================================================================
|
||||
--- libvirt-0.4.6.orig/src/cgroup.h
|
||||
+++ libvirt-0.4.6/src/cgroup.h
|
||||
@@ -35,6 +35,9 @@ int virCgroupAllowDevice(virCgroupPtr gr
|
||||
char type,
|
||||
int major,
|
||||
int minor);
|
||||
+int virCgroupAllowDeviceMajor(virCgroupPtr group,
|
||||
+ char type,
|
||||
+ int major);
|
||||
|
||||
int virCgroupSetCpuShares(virCgroupPtr group, unsigned long shares);
|
||||
int virCgroupGetCpuShares(virCgroupPtr group, unsigned long *shares);
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 23 16:33:37 MDT 2008 - jfehlig@novell.com
|
||||
|
||||
- Add upstream patches to fix ordering problem with setting up
|
||||
cgroup containment on LXC domains.
|
||||
bnc#437816
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 20 15:00:11 MDT 2008 - jfehlig@novell.com
|
||||
|
||||
|
10
libvirt.spec
10
libvirt.spec
@ -49,7 +49,7 @@ License: LGPL v2.1 or later
|
||||
Group: Development/Libraries/C and C++
|
||||
AutoReqProv: yes
|
||||
Version: 0.4.6
|
||||
Release: 3
|
||||
Release: 4
|
||||
Summary: A C toolkit to interract with the virtualization capabilities of Linux
|
||||
Requires: readline
|
||||
Requires: ncurses
|
||||
@ -77,6 +77,8 @@ Patch7: lxc_res_mem.patch
|
||||
Patch8: cgshares.patch
|
||||
Patch9: lxcsched.patch
|
||||
Patch10: lxcvirsh.patch
|
||||
Patch11: cgmajor.patch
|
||||
Patch12: lxcpty.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -178,6 +180,8 @@ Authors:
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
rm po/no.*
|
||||
|
||||
%build
|
||||
@ -310,6 +314,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{py_sitedir}/libvirtmod*
|
||||
|
||||
%changelog
|
||||
* Thu Oct 23 2008 jfehlig@novell.com
|
||||
- Add upstream patches to fix ordering problem with setting up
|
||||
cgroup containment on LXC domains.
|
||||
bnc#437816
|
||||
* Mon Oct 20 2008 jfehlig@novell.com
|
||||
- Remove IA64 from list of architectures supporting Xen.
|
||||
* Fri Oct 10 2008 jfehlig@novell.com
|
||||
|
48
lxcpty.patch
Normal file
48
lxcpty.patch
Normal file
@ -0,0 +1,48 @@
|
||||
Index: libvirt-0.4.6/src/lxc_container.h
|
||||
===================================================================
|
||||
--- libvirt-0.4.6.orig/src/lxc_container.h
|
||||
+++ libvirt-0.4.6/src/lxc_container.h
|
||||
@@ -40,6 +40,8 @@ enum {
|
||||
#define LXC_DEV_MAJ_TTY 5
|
||||
#define LXC_DEV_MIN_CONSOLE 1
|
||||
|
||||
+#define LXC_DEV_MAJ_PTY 136
|
||||
+
|
||||
int lxcContainerSendContinue(int control);
|
||||
|
||||
int lxcContainerStart(virDomainDefPtr def,
|
||||
Index: libvirt-0.4.6/src/lxc_controller.c
|
||||
===================================================================
|
||||
--- libvirt-0.4.6.orig/src/lxc_controller.c
|
||||
+++ libvirt-0.4.6/src/lxc_controller.c
|
||||
@@ -106,6 +106,10 @@ static int lxcSetContainerResources(virD
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ rc = virCgroupAllowDeviceMajor(cgroup, 'c', LXC_DEV_MAJ_PTY);
|
||||
+ if (rc != 0)
|
||||
+ goto out;
|
||||
+
|
||||
rc = virCgroupAddTask(cgroup, getpid());
|
||||
out:
|
||||
if (rc != 0) {
|
||||
@@ -452,6 +456,9 @@ lxcControllerRun(virDomainDefPtr def,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ if (lxcSetContainerResources(def) < 0)
|
||||
+ goto cleanup;
|
||||
+
|
||||
if ((container = lxcContainerStart(def,
|
||||
nveths,
|
||||
veths,
|
||||
@@ -464,9 +471,6 @@ lxcControllerRun(virDomainDefPtr def,
|
||||
if (lxcControllerMoveInterfaces(nveths, veths, container) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- if (lxcSetContainerResources(def) < 0)
|
||||
- goto cleanup;
|
||||
-
|
||||
if (lxcContainerSendContinue(control[0]) < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user