[systemd-devel] [PATCH] device cgroup: don't create a new CGroupDeviceAllow when it already in the list

2013-08-26 Thread Gao feng
If a device node is already in the device_allow list of CGroupContext, we should replace it instead of create a new one and append this new one to the end of device_allow list. --- src/core/dbus-cgroup.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff

Re: [systemd-devel] [PATCH 2/3] mount: move device links handling from generator

2013-08-26 Thread Harald Hoyer
On 08/21/2013 03:46 PM, Tom Gundersen wrote: On Wed, Aug 21, 2013 at 8:50 PM, Harald Hoyer harald.ho...@gmail.com wrote: On 08/21/2013 01:53 PM, Tom Gundersen wrote: -if (!isbind -!path_equal(where, /)) { - -r = device_name(what,

[systemd-devel] loginctl grammar.

2013-08-26 Thread Apostolos Bartziokas
Hello. When you use loginctl list _x_ in a single user/seat/session system it displays 1 session*s*/user*s*/seat*s*. Shouldn't the code for it be something like the attached patch?? I am not much of a coder so it might be wrong. Thanks in advance. 136,137c136,141 if (on_tty())

Re: [systemd-devel] [PATCH] inline static endswith()

2013-08-26 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Aug 26, 2013 at 01:15:12PM +0800, WANG Chao wrote: +static inline char *endswith(const char *s, const char *postfix) { +size_t sl = strlen(s); +size_t pl = strlen(postfix); + +if (sl pl strncmp(s + sl -pl, postfix, pl) == 0) +

Re: [systemd-devel] [PATCH] inline static endswith()

2013-08-26 Thread WANG Chao
On 08/26/13 at 02:22pm, Zbigniew Jędrzejewski-Szmek wrote: On Mon, Aug 26, 2013 at 01:15:12PM +0800, WANG Chao wrote: +static inline char *endswith(const char *s, const char *postfix) { +size_t sl = strlen(s); +size_t pl = strlen(postfix); + +if (sl pl

Re: [systemd-devel] loginctl grammar.

2013-08-26 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Aug 26, 2013 at 03:15:28PM +0300, Apostolos Bartziokas wrote: Hello. When you use loginctl list _x_ in a single user/seat/session system it displays 1 session*s*/user*s*/seat*s*. Shouldn't the code for it be something like the attached patch?? Hi, you are right that the output is

Re: [systemd-devel] [PATCH] netns: unix: only allow to find out unix socket in same net namespace

2013-08-26 Thread Serge Hallyn
Quoting Gao feng (gaof...@cn.fujitsu.com): On 08/26/2013 11:19 AM, James Bottomley wrote: On Mon, 2013-08-26 at 09:06 +0800, Gao feng wrote: On 08/26/2013 02:16 AM, James Bottomley wrote: On Sun, 2013-08-25 at 19:37 +0200, Kay Sievers wrote: On Sun, Aug 25, 2013 at 7:16 PM, James

Re: [systemd-devel] [RFC v2] mount: improve DefaultDependencies and use in generator

2013-08-26 Thread Tollef Fog Heen
]] Kay Sievers Mounting /home and / should be non-dangerous, nothing should choke really if things go wrong. We will not try to mount machine-local/specific stuff like /var or /usr automatically, that would really end up in a mess if things get mixed up. Mounting anything is dangerous if

[systemd-devel] [PATCH 1/3] cgroup: setup BlockIODeviceWeight in bus_cgroup_set_property

2013-08-26 Thread Gao feng
This patch adds the support for setting up BlockIODeviceWeight in bus_cgroup_set_property. most of the codes are copied from the case that sets up DeviceAllow. --- src/core/dbus-cgroup.c | 85 ++ 1 file changed, 85 insertions(+) diff --git

[systemd-devel] [PATCH 2/3] systemcl: add support for setting BlockIODeviceWeight for unit

2013-08-26 Thread Gao feng
This patch allows user to set up BlockIODeviceWeight for unit through systemctl. Such as systemctl set-property sshd.service BlockIODeviceWeight=/dev/sda 100 --- src/systemctl/systemctl.c | 37 + 1 file changed, 37 insertions(+) diff --git

[systemd-devel] [PATCH 3/3] systemctl: show BlockIODeviceWeight for unit

2013-08-26 Thread Gao feng
We can use systemctl show unitname to show the BlockIODeviceWeight of unit. --- src/systemctl/systemctl.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index ff29b0f..4ea301a 100644 --- a/src/systemctl/systemctl.c +++